From aad97d3654a59957861d0aa8f3cafee0f4bc6c39 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 29 Jan 2026 17:50:18 +0300 Subject: [PATCH 1/7] Codegen: CRM Goals --- codegen/Crm/Objects/Goals/Api/BasicApi.php | 530 +++++-------- codegen/Crm/Objects/Goals/Api/BatchApi.php | 637 ++++------------ codegen/Crm/Objects/Goals/Api/SearchApi.php | 179 ++--- codegen/Crm/Objects/Goals/ApiException.php | 6 +- codegen/Crm/Objects/Goals/Configuration.php | 65 +- .../Crm/Objects/Goals/FormDataProcessor.php | 246 +++++++ codegen/Crm/Objects/Goals/HeaderSelector.php | 6 +- .../Crm/Objects/Goals/Model/AssociatedId.php | 23 +- .../Objects/Goals/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/Goals/Model/Error.php | 160 ++-- .../Crm/Objects/Goals/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Goals/Model/Filter.php | 167 ++--- .../Crm/Objects/Goals/Model/FilterGroup.php | 18 +- .../Crm/Objects/Goals/Model/ForwardPaging.php | 409 ---------- .../Objects/Goals/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Goals/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Goals/Model/Paging.php | 18 +- .../Crm/Objects/Goals/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Goals/Model/PublicObjectId.php | 21 +- .../Goals/Model/PublicObjectSearchRequest.php | 191 ++--- .../Goals/Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Goals/Model/SimplePublicObjectId.php | 21 +- .../Goals/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Goals/Model/SimplePublicUpsertObject.php | 196 ++--- .../Crm/Objects/Goals/Model/StandardError.php | 205 +++--- .../Goals/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Goals/ObjectSerializer.php | 26 +- 45 files changed, 2249 insertions(+), 4108 deletions(-) create mode 100644 codegen/Crm/Objects/Goals/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Goals/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Goals/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Goals/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Goals/Api/BasicApi.php b/codegen/Crm/Objects/Goals/Api/BasicApi.php index c970f281..84af7995 100644 --- a/codegen/Crm/Objects/Goals/Api/BasicApi.php +++ b/codegen/Crm/Objects/Goals/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($goal_target_id, string $contentType = self: $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -210,7 +214,7 @@ public function archiveWithHttpInfo($goal_target_id, string $contentType = self: /** * Operation archiveAsync * - * Archive + * Delete a goal target by ID * * @param string $goal_target_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation @@ -231,7 +235,7 @@ function ($response) { /** * Operation archiveAsyncWithHttpInfo * - * Archive + * Delete a goal target by ID * * @param string $goal_target_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation @@ -285,7 +289,10 @@ public function archiveRequest($goal_target_id, string $contentType = self::cont 'Missing the required parameter $goal_target_id when calling archive' ); } - + if (!preg_match("/.+/", $goal_target_id)) { + throw new \InvalidArgumentException("invalid value for \"goal_target_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/goal_targets/{goalTargetId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Goals\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($goal_target_id, $properties = null, $proper switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($goal_target_id, $properties = null, $proper ); } - $returnType = '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($goal_target_id, $properties = null, $proper $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($goal_target_id, $properties = null, $proper $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($goal_target_id, $properties = null, $properties_ 'Missing the required parameter $goal_target_id when calling getById' ); } - + if (!preg_match("/.+/", $goal_target_id)) { + throw new \InvalidArgumentException("invalid value for \"goal_target_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1134,19 +1022,19 @@ public function getByIdRequest($goal_target_id, $properties = null, $properties_ /** * Operation getPage * - * List + * Get a page of goal targets * * @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 goal targets 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\Goals\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Goals\Model\Error + * @return \HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Goals\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]) { @@ -1157,19 +1045,19 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert /** * Operation getPageWithHttpInfo * - * List + * Get a page of goal targets * * @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 goal targets 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\Goals\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\Goals\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Goals\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Goals\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; } } @@ -1322,12 +1149,12 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu /** * Operation getPageAsync * - * List + * Get a page of goal targets * * @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 goal targets 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 @@ -1348,12 +1175,12 @@ function ($response) { /** * Operation getPageAsyncWithHttpInfo * - * List + * Get a page of goal targets * * @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 goal targets 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\Goals\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Goals\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 goal targets 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($goal_target_id, $simple_public_object_input, switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($goal_target_id, $simple_public_object_input, ); } - $returnType = '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($goal_target_id, $simple_public_object_input, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($goal_target_id, $simple_public_object_input, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($goal_target_id, $simple_public_object_input, $id_ 'Missing the required parameter $goal_target_id when calling update' ); } - + if (!preg_match("/.+/", $goal_target_id)) { + throw new \InvalidArgumentException("invalid value for \"goal_target_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/Goals/Api/BatchApi.php b/codegen/Crm/Objects/Goals/Api/BatchApi.php index ab6333ec..9f225987 100644 --- a/codegen/Crm/Objects/Goals/Api/BatchApi.php +++ b/codegen/Crm/Objects/Goals/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\Goals\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error + * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Goals\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\Goals\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error + * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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\Goals\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\Goals\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error + * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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\Goals\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\Goals\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error + * @return \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Goals\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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\Goals\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/Goals/Api/SearchApi.php b/codegen/Crm/Objects/Goals/Api/SearchApi.php index e9d5e2e1..5a51c605 100644 --- a/codegen/Crm/Objects/Goals/Api/SearchApi.php +++ b/codegen/Crm/Objects/Goals/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Goals\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Goals\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Goals\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 * + * Perform a search for goal targets based on various filters and criteria. + * * @param \HubSpot\Client\Crm\Objects\Goals\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 * + * Perform a search for goal targets based on various filters and criteria. + * * @param \HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Goals\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/Goals/ApiException.php b/codegen/Crm/Objects/Goals/ApiException.php index 7d719445..467a591e 100644 --- a/codegen/Crm/Objects/Goals/ApiException.php +++ b/codegen/Crm/Objects/Goals/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/Goals/FormDataProcessor.php b/codegen/Crm/Objects/Goals/FormDataProcessor.php new file mode 100644 index 00000000..c28560f3 --- /dev/null +++ b/codegen/Crm/Objects/Goals/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/Goals/HeaderSelector.php b/codegen/Crm/Objects/Goals/HeaderSelector.php index 5f7f7d45..b7b56efb 100644 --- a/codegen/Crm/Objects/Goals/HeaderSelector.php +++ b/codegen/Crm/Objects/Goals/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/Goals/Model/AssociationSpec.php b/codegen/Crm/Objects/Goals/Model/AssociationSpec.php index 963045ff..43174023 100644 --- a/codegen/Crm/Objects/Goals/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Goals/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInput.php index e5af64ae..a007374a 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 1faa9926..981a9468 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 4405165f..171fdcea 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectId.php index 2be6bb4e..d8544470 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Goals/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Goals/Model/BatchReadInputSimplePublicObjectId.php index 2b488eb8..37192061 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Goals/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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\Goals\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/Goals/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicObject.php index f755a301..2022bcc8 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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\Goals\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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/Goals/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index c096d4c1..00000000 --- a/codegen/Crm/Objects/Goals/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\Goals\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Goals\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/Goals/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicUpsertObject.php index 6fd1d8b0..a51c2630 100644 --- a/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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\Goals\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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/Goals/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Goals/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index ff27be16..00000000 --- a/codegen/Crm/Objects/Goals/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\Goals\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Goals\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/Goals/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Goals/Model/CollectionResponseAssociatedId.php index 0070f061..f9ed1fb0 100644 --- a/codegen/Crm/Objects/Goals/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Goals/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Goals/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Goals/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Goals/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 1d55824b..264a69bd 100644 --- a/codegen/Crm/Objects/Goals/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Goals/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\Goals\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Goals\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Goals\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Goals\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Goals\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Goals\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/Goals/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Goals/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Goals/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Goals/Model/CollectionResponseWithTotalSimplePublicObject.php index 53475a15..f16d6795 100644 --- a/codegen/Crm/Objects/Goals/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Goals/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\Goals\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Goals\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Goals\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Goals\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Goals\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Goals\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/Goals/Model/Error.php b/codegen/Crm/Objects/Goals/Model/Error.php index 9b5987a1..012cfcf0 100644 --- a/codegen/Crm/Objects/Goals/Model/Error.php +++ b/codegen/Crm/Objects/Goals/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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/Goals/Model/ErrorDetail.php b/codegen/Crm/Objects/Goals/Model/ErrorDetail.php index 01630f6d..2b368be5 100644 --- a/codegen/Crm/Objects/Goals/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Goals/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/Filter.php b/codegen/Crm/Objects/Goals/Model/Filter.php index e78c5717..c2c89444 100644 --- a/codegen/Crm/Objects/Goals/Model/Filter.php +++ b/codegen/Crm/Objects/Goals/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/FilterGroup.php b/codegen/Crm/Objects/Goals/Model/FilterGroup.php index 3aaf3930..a3c141a6 100644 --- a/codegen/Crm/Objects/Goals/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Goals/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/ForwardPaging.php b/codegen/Crm/Objects/Goals/Model/ForwardPaging.php deleted file mode 100644 index b7ca5d23..00000000 --- a/codegen/Crm/Objects/Goals/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\Goals\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\Goals\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Goals\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/Goals/Model/ModelInterface.php b/codegen/Crm/Objects/Goals/Model/ModelInterface.php index 40b58812..0b4b5304 100644 --- a/codegen/Crm/Objects/Goals/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Goals/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals\Model @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/NextPage.php b/codegen/Crm/Objects/Goals/Model/NextPage.php index e4faca61..17426792 100644 --- a/codegen/Crm/Objects/Goals/Model/NextPage.php +++ b/codegen/Crm/Objects/Goals/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/Paging.php b/codegen/Crm/Objects/Goals/Model/Paging.php index 1939c4c0..2d0a513d 100644 --- a/codegen/Crm/Objects/Goals/Model/Paging.php +++ b/codegen/Crm/Objects/Goals/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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/Goals/Model/PreviousPage.php b/codegen/Crm/Objects/Goals/Model/PreviousPage.php index fff042d2..e4d42e33 100644 --- a/codegen/Crm/Objects/Goals/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Goals/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Goals/Model/PublicAssociationsForObject.php index 57b56fcb..938d006e 100644 --- a/codegen/Crm/Objects/Goals/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Goals/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Goals\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Goals\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Goals\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\Goals\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Goals\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/Goals/Model/PublicObjectId.php b/codegen/Crm/Objects/Goals/Model/PublicObjectId.php index ebf513e6..0497d5c0 100644 --- a/codegen/Crm/Objects/Goals/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Goals/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Goals/Model/PublicObjectSearchRequest.php index 5169c8d1..c4178e95 100644 --- a/codegen/Crm/Objects/Goals/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Goals/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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\Goals\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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\Goals\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\Goals\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/Goals/Model/SimplePublicObject.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObject.php index 444b7ace..80fb6d03 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInput.php index 4cf38ce3..706b86e6 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInputForCreate.php index 774a6287..dde1b2ac 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInputUpsert.php index c5bb7de5..8532ff8f 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectId.php index 001fac32..e70fa6a4 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectInput.php index a184ece8..f6b7e025 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectInputForCreate.php index 2b00d338..fce2c4c6 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectWithAssociations.php index cfdb7308..4a29bd20 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Goals/Model/SimplePublicUpsertObject.php index 8cf83aca..cec32743 100644 --- a/codegen/Crm/Objects/Goals/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Goals/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/Model/StandardError.php b/codegen/Crm/Objects/Goals/Model/StandardError.php index 85ae8315..2f008f0c 100644 --- a/codegen/Crm/Objects/Goals/Model/StandardError.php +++ b/codegen/Crm/Objects/Goals/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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\Goals\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Goals\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\Goals\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\Goals\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\Goals\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\Goals\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/Goals/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Goals/Model/ValueWithTimestamp.php index 7e1031dd..8465b72f 100644 --- a/codegen/Crm/Objects/Goals/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Goals/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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\Goals * @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/Goals/ObjectSerializer.php b/codegen/Crm/Objects/Goals/ObjectSerializer.php index 4c50f69b..83ea5852 100644 --- a/codegen/Crm/Objects/Goals/ObjectSerializer.php +++ b/codegen/Crm/Objects/Goals/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Goals @@ -13,11 +13,11 @@ /** * Goal Targets * - * 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 394b5047ed50b20ffb824c39e146618a62edba36 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 30 Jan 2026 11:28:04 +0300 Subject: [PATCH 2/7] Codegen: CRM Leads --- codegen/Crm/Objects/Leads/Api/BasicApi.php | 514 ++++------- codegen/Crm/Objects/Leads/Api/BatchApi.php | 867 +++--------------- codegen/Crm/Objects/Leads/Api/SearchApi.php | 179 ++-- codegen/Crm/Objects/Leads/ApiException.php | 6 +- codegen/Crm/Objects/Leads/Configuration.php | 65 +- .../Crm/Objects/Leads/FormDataProcessor.php | 246 +++++ codegen/Crm/Objects/Leads/HeaderSelector.php | 6 +- .../Crm/Objects/Leads/Model/AssociatedId.php | 23 +- .../Objects/Leads/Model/AssociationSpec.php | 27 +- ...BatchInputSimplePublicObjectBatchInput.php | 18 +- ...tSimplePublicObjectBatchInputForCreate.php | 18 +- ...nputSimplePublicObjectBatchInputUpsert.php | 412 --------- .../Model/BatchInputSimplePublicObjectId.php | 18 +- .../BatchReadInputSimplePublicObjectId.php | 107 +-- .../Model/BatchResponseSimplePublicObject.php | 193 ++-- ...chResponseSimplePublicObjectWithErrors.php | 697 -------------- .../BatchResponseSimplePublicUpsertObject.php | 629 ------------- ...onseSimplePublicUpsertObjectWithErrors.php | 697 -------------- .../Model/CollectionResponseAssociatedId.php | 18 +- ...nseSimplePublicObjectWithAssociations.php} | 32 +- ...onResponseWithTotalSimplePublicObject.php} | 119 +-- codegen/Crm/Objects/Leads/Model/Error.php | 160 ++-- .../Crm/Objects/Leads/Model/ErrorDetail.php | 136 +-- codegen/Crm/Objects/Leads/Model/Filter.php | 167 ++-- .../Crm/Objects/Leads/Model/FilterGroup.php | 18 +- .../Crm/Objects/Leads/Model/ForwardPaging.php | 409 --------- .../Objects/Leads/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Leads/Model/NextPage.php | 85 +- codegen/Crm/Objects/Leads/Model/Paging.php | 18 +- .../Crm/Objects/Leads/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +- .../Objects/Leads/Model/PublicObjectId.php | 21 +- .../Leads/Model/PublicObjectSearchRequest.php | 191 ++-- .../Leads/Model/SimplePublicObject.php | 138 +-- .../Model/SimplePublicObjectBatchInput.php | 91 +- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 517 ----------- .../Leads/Model/SimplePublicObjectId.php | 21 +- .../Leads/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++-- .../Leads/Model/SimplePublicUpsertObject.php | 696 -------------- .../Crm/Objects/Leads/Model/StandardError.php | 205 ++--- .../Leads/Model/ValueWithTimestamp.php | 147 +-- .../Crm/Objects/Leads/ObjectSerializer.php | 26 +- 45 files changed, 1926 insertions(+), 6401 deletions(-) create mode 100644 codegen/Crm/Objects/Leads/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInputUpsert.php delete mode 100644 codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicUpsertObject.php delete mode 100644 codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Leads/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Leads/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Leads/Model/ForwardPaging.php delete mode 100644 codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInputUpsert.php delete mode 100644 codegen/Crm/Objects/Leads/Model/SimplePublicUpsertObject.php diff --git a/codegen/Crm/Objects/Leads/Api/BasicApi.php b/codegen/Crm/Objects/Leads/Api/BasicApi.php index 08273dec..69abed76 100644 --- a/codegen/Crm/Objects/Leads/Api/BasicApi.php +++ b/codegen/Crm/Objects/Leads/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($leads_id, string $contentType = self::conte $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($leads_id, string $contentType = self::contentTyp 'Missing the required parameter $leads_id when calling archive' ); } - + if (!preg_match("/.+/", $leads_id)) { + throw new \InvalidArgumentException("invalid value for \"leads_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/leads/{leadsId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Leads\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($leads_id, $properties = null, $properties_w switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($leads_id, $properties = null, $properties_w ); } - $returnType = '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($leads_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($leads_id, $properties = null, $properties_w $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($leads_id, $properties = null, $properties_with_h 'Missing the required parameter $leads_id when calling getById' ); } - + if (!preg_match("/.+/", $leads_id)) { + throw new \InvalidArgumentException("invalid value for \"leads_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($leads_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 leads 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\Leads\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Leads\Model\Error + * @return \HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Leads\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 leads 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\Leads\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\Leads\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Leads\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Leads\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 leads 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 leads 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\Leads\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Leads\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 leads 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($leads_id, $simple_public_object_input, $id_p switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($leads_id, $simple_public_object_input, $id_p ); } - $returnType = '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($leads_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($leads_id, $simple_public_object_input, $id_p $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($leads_id, $simple_public_object_input, $id_proper 'Missing the required parameter $leads_id when calling update' ); } - + if (!preg_match("/.+/", $leads_id)) { + throw new \InvalidArgumentException("invalid value for \"leads_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/Leads/Api/BatchApi.php b/codegen/Crm/Objects/Leads/Api/BatchApi.php index 3944fb37..1efdf61a 100644 --- a/codegen/Crm/Objects/Leads/Api/BatchApi.php +++ b/codegen/Crm/Objects/Leads/Api/BatchApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], - 'upsert' => [ - 'application/json', - ], ]; /** @@ -191,7 +191,6 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +200,10 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -372,7 +373,7 @@ public function archiveRequest($batch_input_simple_public_object_id, string $con * * @throws \HubSpot\Client\Crm\Objects\Leads\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error + * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\Error */ public function create($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -390,7 +391,7 @@ public function create($batch_input_simple_public_object_batch_input_for_create, * * @throws \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\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 +421,22 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -516,52 +450,21 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -569,8 +472,10 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -754,7 +659,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_ * * @throws \HubSpot\Client\Crm\Objects\Leads\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error + * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\Error */ public function read($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -773,7 +678,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals * * @throws \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\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 +709,21 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -899,34 +737,11 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc ); } - $returnType = '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -936,15 +751,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\Leads\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -952,8 +759,10 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1149,7 +958,7 @@ public function readRequest($batch_read_input_simple_public_object_id, $archived * * @throws \HubSpot\Client\Crm\Objects\Leads\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error + * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\Error */ public function update($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1167,7 +976,7 @@ public function update($batch_input_simple_public_object_batch_input, string $co * * @throws \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Leads\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 +1007,21 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1293,34 +1035,11 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input ); } - $returnType = '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1330,15 +1049,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\Leads\Model\BatchResponseSimplePublicObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1346,8 +1057,10 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1521,402 +1234,72 @@ public function updateRequest($batch_input_simple_public_object_batch_input, str } /** - * Operation upsert - * - * Create or update a batch of leads by unique property values - * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert batch_input_simple_public_object_batch_input_upsert (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation - * - * @throws \HubSpot\Client\Crm\Objects\Leads\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error - */ - public function upsert($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) - { - list($response) = $this->upsertWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, $contentType); - return $response; - } - - /** - * Operation upsertWithHttpInfo - * - * Create or update a batch of leads by unique property values - * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation + * Create http client option * - * @throws \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Leads\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @throws \RuntimeException on file opening failure + * @return array of http client options */ - public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) + protected function createHttpClientOption() { - $request = $this->upsertRequest($batch_input_simple_public_object_batch_input_upsert, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - - switch($statusCode) { - case 200: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\HubSpot\Client\Crm\Objects\Leads\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 - ); - } - } + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } + } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObject', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObjectWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - default: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Leads\Model\Error', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); } - } - /** - * Operation upsertAsync - * - * Create or update a batch of leads by unique property values - * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function upsertAsync($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) - { - return $this->upsertAsyncWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); + return $options; } - /** - * Operation upsertAsyncWithHttpInfo - * - * Create or update a batch of leads by unique property values - * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function upsertAsyncWithHttpInfo($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) - { - $returnType = '\HubSpot\Client\Crm\Objects\Leads\Model\BatchResponseSimplePublicUpsertObject'; - $request = $this->upsertRequest($batch_input_simple_public_object_batch_input_upsert, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); + 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( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() + 'Error JSON decoding server response (%s)', + $request->getUri() ), - $statusCode, + $response->getStatusCode(), $response->getHeaders(), - (string) $response->getBody() + $content ); } - ); - } - - /** - * Create request for operation 'upsert' - * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function upsertRequest($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) - { - - // verify the required parameter 'batch_input_simple_public_object_batch_input_upsert' is set - if ($batch_input_simple_public_object_batch_input_upsert === null || (is_array($batch_input_simple_public_object_batch_input_upsert) && count($batch_input_simple_public_object_batch_input_upsert) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $batch_input_simple_public_object_batch_input_upsert when calling upsert' - ); - } - - - $resourcePath = '/crm/v3/objects/leads/batch/upsert'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', '*/*', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (isset($batch_input_simple_public_object_batch_input_upsert)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($batch_input_simple_public_object_batch_input_upsert)); - } else { - $httpBody = $batch_input_simple_public_object_batch_input_upsert; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); } } - // this endpoint requires OAuth (access token) - if (!empty($this->config->getAccessToken())) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'POST', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); - return $options; + return $statusCode >= $left && $statusCode <= $right; } } diff --git a/codegen/Crm/Objects/Leads/Api/SearchApi.php b/codegen/Crm/Objects/Leads/Api/SearchApi.php index 0c3932c2..6597b340 100644 --- a/codegen/Crm/Objects/Leads/Api/SearchApi.php +++ b/codegen/Crm/Objects/Leads/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Leads\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Leads\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Leads\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 leads using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Leads\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 leads using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Leads\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/Leads/ApiException.php b/codegen/Crm/Objects/Leads/ApiException.php index 90fd5528..8e6c5ca9 100644 --- a/codegen/Crm/Objects/Leads/ApiException.php +++ b/codegen/Crm/Objects/Leads/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/Leads/FormDataProcessor.php b/codegen/Crm/Objects/Leads/FormDataProcessor.php new file mode 100644 index 00000000..4b936073 --- /dev/null +++ b/codegen/Crm/Objects/Leads/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/Leads/HeaderSelector.php b/codegen/Crm/Objects/Leads/HeaderSelector.php index 24249749..9cfee8bf 100644 --- a/codegen/Crm/Objects/Leads/HeaderSelector.php +++ b/codegen/Crm/Objects/Leads/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/Leads/Model/AssociationSpec.php b/codegen/Crm/Objects/Leads/Model/AssociationSpec.php index 0b81d6fc..f2bb36c7 100644 --- a/codegen/Crm/Objects/Leads/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Leads/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInput.php index 15a9c5dc..4302f0f0 100644 --- a/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 42551466..fe017d00 100644 --- a/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInputUpsert.php deleted file mode 100644 index b2c7e176..00000000 --- a/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ /dev/null @@ -1,412 +0,0 @@ - - */ -class BatchInputSimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchInputSimplePublicObjectBatchInputUpsert'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'inputs' => '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObjectBatchInputUpsert[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'inputs' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'inputs' => 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 = [ - 'inputs' => 'inputs' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'inputs' => 'setInputs' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'inputs' => 'getInputs' - ]; - - /** - * 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('inputs', $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['inputs'] === null) { - $invalidProperties[] = "'inputs' can't be null"; - } - 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 inputs - * - * @return \HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObjectBatchInputUpsert[] - */ - public function getInputs() - { - return $this->container['inputs']; - } - - /** - * Sets inputs - * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObjectBatchInputUpsert[] $inputs inputs - * - * @return self - */ - public function setInputs($inputs) - { - if (is_null($inputs)) { - throw new \InvalidArgumentException('non-nullable inputs cannot be null'); - } - $this->container['inputs'] = $inputs; - - 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/Leads/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectId.php index 513dccea..d82ef9ca 100644 --- a/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Leads/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Leads/Model/BatchReadInputSimplePublicObjectId.php index c71a4b55..ea1e0bc1 100644 --- a/codegen/Crm/Objects/Leads/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Leads/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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\Leads\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/Leads/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicObject.php index 2f673dd9..f915e3a1 100644 --- a/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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\Leads\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\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/Leads/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index b9eacd21..00000000 --- a/codegen/Crm/Objects/Leads/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\Leads\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Leads\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/Leads/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicUpsertObject.php deleted file mode 100644 index 336c00ff..00000000 --- a/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicUpsertObject.php +++ /dev/null @@ -1,629 +0,0 @@ - - */ -class BatchResponseSimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponseSimplePublicUpsertObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicUpsertObject[]', - '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', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, - 'results' => null, - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, - 'links' => false, - 'results' => 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', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', - 'results' => 'results', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'results' => 'setResults', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'results' => 'getResults', - '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('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('results', $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 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\Leads\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Leads\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 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/Leads/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Leads/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index c45101e7..00000000 --- a/codegen/Crm/Objects/Leads/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\Leads\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Leads\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/Leads/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Leads/Model/CollectionResponseAssociatedId.php index 791e32cd..f07d7683 100644 --- a/codegen/Crm/Objects/Leads/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Leads/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Leads/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Leads/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Leads/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 82974a52..7757ddef 100644 --- a/codegen/Crm/Objects/Leads/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Leads/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\Leads\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Leads\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Leads\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Leads\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Leads\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/Leads/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Leads/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Leads/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Leads/Model/CollectionResponseWithTotalSimplePublicObject.php index 8b2be437..0f3b46b3 100644 --- a/codegen/Crm/Objects/Leads/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Leads/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\Leads\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Leads\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Leads\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Leads\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Leads\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Leads\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/Leads/Model/Error.php b/codegen/Crm/Objects/Leads/Model/Error.php index ea99b641..5f16ecbb 100644 --- a/codegen/Crm/Objects/Leads/Model/Error.php +++ b/codegen/Crm/Objects/Leads/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\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/Leads/Model/ErrorDetail.php b/codegen/Crm/Objects/Leads/Model/ErrorDetail.php index d19d75b6..1fc6f4e3 100644 --- a/codegen/Crm/Objects/Leads/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Leads/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/Filter.php b/codegen/Crm/Objects/Leads/Model/Filter.php index 06c9ab6a..83df3801 100644 --- a/codegen/Crm/Objects/Leads/Model/Filter.php +++ b/codegen/Crm/Objects/Leads/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/FilterGroup.php b/codegen/Crm/Objects/Leads/Model/FilterGroup.php index f7722d84..da7c2ab5 100644 --- a/codegen/Crm/Objects/Leads/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Leads/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/ForwardPaging.php b/codegen/Crm/Objects/Leads/Model/ForwardPaging.php deleted file mode 100644 index 8053cc62..00000000 --- a/codegen/Crm/Objects/Leads/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\Leads\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\Leads\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Leads\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/Leads/Model/ModelInterface.php b/codegen/Crm/Objects/Leads/Model/ModelInterface.php index 536bc353..690a68c7 100644 --- a/codegen/Crm/Objects/Leads/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Leads/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads\Model @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/NextPage.php b/codegen/Crm/Objects/Leads/Model/NextPage.php index 771eebb3..23ab6da8 100644 --- a/codegen/Crm/Objects/Leads/Model/NextPage.php +++ b/codegen/Crm/Objects/Leads/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/Paging.php b/codegen/Crm/Objects/Leads/Model/Paging.php index 28a1cfae..a9e9a9d2 100644 --- a/codegen/Crm/Objects/Leads/Model/Paging.php +++ b/codegen/Crm/Objects/Leads/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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/Leads/Model/PreviousPage.php b/codegen/Crm/Objects/Leads/Model/PreviousPage.php index 8d77bc63..9a50166e 100644 --- a/codegen/Crm/Objects/Leads/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Leads/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Leads/Model/PublicAssociationsForObject.php index 26986bbb..d84c5953 100644 --- a/codegen/Crm/Objects/Leads/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Leads/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Leads\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Leads\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Leads\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\Leads\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Leads\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/Leads/Model/PublicObjectId.php b/codegen/Crm/Objects/Leads/Model/PublicObjectId.php index 20128395..c9cf6cd2 100644 --- a/codegen/Crm/Objects/Leads/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Leads/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Leads/Model/PublicObjectSearchRequest.php index 83ba9293..4b44be22 100644 --- a/codegen/Crm/Objects/Leads/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Leads/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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\Leads\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\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\Leads\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\Leads\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/Leads/Model/SimplePublicObject.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObject.php index b97c4c13..f727f01d 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInput.php index da867c22..42567ecb 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInputForCreate.php index f737a2be..27c6287b 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInputUpsert.php deleted file mode 100644 index 80c99e11..00000000 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectBatchInputUpsert.php +++ /dev/null @@ -1,517 +0,0 @@ - - */ -class SimplePublicObjectBatchInputUpsert implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'SimplePublicObjectBatchInputUpsert'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id_property' => 'string', - 'object_write_trace_id' => 'string', - 'id' => 'string', - 'properties' => 'array' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id_property' => null, - 'object_write_trace_id' => null, - 'id' => null, - 'properties' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'id_property' => false, - 'object_write_trace_id' => false, - 'id' => false, - 'properties' => 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 = [ - 'id_property' => 'idProperty', - 'object_write_trace_id' => 'objectWriteTraceId', - 'id' => 'id', - 'properties' => 'properties' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id_property' => 'setIdProperty', - 'object_write_trace_id' => 'setObjectWriteTraceId', - 'id' => 'setId', - 'properties' => 'setProperties' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id_property' => 'getIdProperty', - 'object_write_trace_id' => 'getObjectWriteTraceId', - 'id' => 'getId', - 'properties' => 'getProperties' - ]; - - /** - * 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('id_property', $data ?? [], null); - $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('properties', $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['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['properties'] === null) { - $invalidProperties[] = "'properties' can't be null"; - } - 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 id_property - * - * @return string|null - */ - public function getIdProperty() - { - return $this->container['id_property']; - } - - /** - * Sets id_property - * - * @param string|null $id_property The name of a property whose values are unique for this object - * - * @return self - */ - public function setIdProperty($id_property) - { - if (is_null($id_property)) { - throw new \InvalidArgumentException('non-nullable id_property cannot be null'); - } - $this->container['id_property'] = $id_property; - - return $this; - } - - /** - * Gets object_write_trace_id - * - * @return string|null - */ - public function getObjectWriteTraceId() - { - return $this->container['object_write_trace_id']; - } - - /** - * Sets object_write_trace_id - * - * @param string|null $object_write_trace_id object_write_trace_id - * - * @return self - */ - public function setObjectWriteTraceId($object_write_trace_id) - { - if (is_null($object_write_trace_id)) { - throw new \InvalidArgumentException('non-nullable object_write_trace_id cannot be null'); - } - $this->container['object_write_trace_id'] = $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 - * - * @return array - */ - public function getProperties() - { - return $this->container['properties']; - } - - /** - * Sets properties - * - * @param array $properties properties - * - * @return self - */ - public function setProperties($properties) - { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); - } - $this->container['properties'] = $properties; - - 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/Leads/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectId.php index 62b9481e..2145e2f9 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectInput.php index fda6ef60..4b70a5fa 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectInputForCreate.php index 2dc8b50a..94eac436 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectWithAssociations.php index d46253ea..208adc65 100644 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Leads/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Leads/Model/SimplePublicUpsertObject.php deleted file mode 100644 index 99f9aa96..00000000 --- a/codegen/Crm/Objects/Leads/Model/SimplePublicUpsertObject.php +++ /dev/null @@ -1,696 +0,0 @@ - - */ -class SimplePublicUpsertObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'SimplePublicUpsertObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'created_at' => '\DateTime', - 'archived' => 'bool', - 'archived_at' => '\DateTime', - 'new' => 'bool', - 'properties_with_history' => 'array', - 'id' => 'string', - 'object_write_trace_id' => 'string', - 'properties' => 'array', - 'updated_at' => '\DateTime' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'created_at' => 'date-time', - 'archived' => null, - 'archived_at' => 'date-time', - 'new' => null, - 'properties_with_history' => null, - 'id' => null, - 'object_write_trace_id' => null, - 'properties' => null, - 'updated_at' => 'date-time' - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'created_at' => false, - 'archived' => false, - 'archived_at' => false, - 'new' => false, - 'properties_with_history' => false, - 'id' => false, - 'object_write_trace_id' => false, - 'properties' => false, - 'updated_at' => 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 = [ - 'created_at' => 'createdAt', - 'archived' => 'archived', - 'archived_at' => 'archivedAt', - 'new' => 'new', - 'properties_with_history' => 'propertiesWithHistory', - 'id' => 'id', - 'object_write_trace_id' => 'objectWriteTraceId', - 'properties' => 'properties', - 'updated_at' => 'updatedAt' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'created_at' => 'setCreatedAt', - 'archived' => 'setArchived', - 'archived_at' => 'setArchivedAt', - 'new' => 'setNew', - 'properties_with_history' => 'setPropertiesWithHistory', - 'id' => 'setId', - 'object_write_trace_id' => 'setObjectWriteTraceId', - 'properties' => 'setProperties', - 'updated_at' => 'setUpdatedAt' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'created_at' => 'getCreatedAt', - 'archived' => 'getArchived', - 'archived_at' => 'getArchivedAt', - 'new' => 'getNew', - 'properties_with_history' => 'getPropertiesWithHistory', - 'id' => 'getId', - 'object_write_trace_id' => 'getObjectWriteTraceId', - 'properties' => 'getProperties', - 'updated_at' => 'getUpdatedAt' - ]; - - /** - * 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('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('id', $data ?? [], null); - $this->setIfExists('object_write_trace_id', $data ?? [], null); - $this->setIfExists('properties', $data ?? [], null); - $this->setIfExists('updated_at', $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['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['properties'] === null) { - $invalidProperties[] = "'properties' can't be null"; - } - if ($this->container['updated_at'] === null) { - $invalidProperties[] = "'updated_at' can't be null"; - } - 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 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 - */ - public function getArchived() - { - return $this->container['archived']; - } - - /** - * Sets archived - * - * @param bool|null $archived archived - * - * @return self - */ - public function setArchived($archived) - { - if (is_null($archived)) { - throw new \InvalidArgumentException('non-nullable archived cannot be null'); - } - $this->container['archived'] = $archived; - - return $this; - } - - /** - * Gets archived_at - * - * @return \DateTime|null - */ - public function getArchivedAt() - { - return $this->container['archived_at']; - } - - /** - * Sets archived_at - * - * @param \DateTime|null $archived_at archived_at - * - * @return self - */ - public function setArchivedAt($archived_at) - { - if (is_null($archived_at)) { - throw new \InvalidArgumentException('non-nullable archived_at cannot be null'); - } - $this->container['archived_at'] = $archived_at; - - return $this; - } - - /** - * Gets new - * - * @return bool - */ - public function getNew() - { - return $this->container['new']; - } - - /** - * Sets new - * - * @param bool $new new - * - * @return self - */ - public function setNew($new) - { - if (is_null($new)) { - throw new \InvalidArgumentException('non-nullable new cannot be null'); - } - $this->container['new'] = $new; - - 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 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 - * - * @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 object_write_trace_id - * - * @return string|null - */ - public function getObjectWriteTraceId() - { - return $this->container['object_write_trace_id']; - } - - /** - * Sets object_write_trace_id - * - * @param string|null $object_write_trace_id object_write_trace_id - * - * @return self - */ - public function setObjectWriteTraceId($object_write_trace_id) - { - if (is_null($object_write_trace_id)) { - throw new \InvalidArgumentException('non-nullable object_write_trace_id cannot be null'); - } - $this->container['object_write_trace_id'] = $object_write_trace_id; - - return $this; - } - - /** - * Gets properties - * - * @return array - */ - public function getProperties() - { - return $this->container['properties']; - } - - /** - * Sets properties - * - * @param array $properties properties - * - * @return self - */ - public function setProperties($properties) - { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); - } - $this->container['properties'] = $properties; - - return $this; - } - - /** - * Gets updated_at - * - * @return \DateTime - */ - public function getUpdatedAt() - { - return $this->container['updated_at']; - } - - /** - * Sets updated_at - * - * @param \DateTime $updated_at updated_at - * - * @return self - */ - public function setUpdatedAt($updated_at) - { - if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); - } - $this->container['updated_at'] = $updated_at; - - 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/Leads/Model/StandardError.php b/codegen/Crm/Objects/Leads/Model/StandardError.php index 39df05d2..e04aaa86 100644 --- a/codegen/Crm/Objects/Leads/Model/StandardError.php +++ b/codegen/Crm/Objects/Leads/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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\Leads\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Leads\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\Leads\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\Leads\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\Leads\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\Leads\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/Leads/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Leads/Model/ValueWithTimestamp.php index 58210912..1acce9d8 100644 --- a/codegen/Crm/Objects/Leads/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Leads/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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\Leads * @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/Leads/ObjectSerializer.php b/codegen/Crm/Objects/Leads/ObjectSerializer.php index baa4215d..a8dfef3e 100644 --- a/codegen/Crm/Objects/Leads/ObjectSerializer.php +++ b/codegen/Crm/Objects/Leads/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Leads @@ -13,11 +13,11 @@ /** * Leads * - * 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 88587c3bc51140fcc16a35cda9fc00b45bb344fd Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 30 Jan 2026 11:40:59 +0300 Subject: [PATCH 3/7] Codegen: CRM Meetings --- codegen/Crm/Objects/Meetings/Api/BasicApi.php | 514 +++++-------- codegen/Crm/Objects/Meetings/Api/BatchApi.php | 637 ++++------------ .../Crm/Objects/Meetings/Api/SearchApi.php | 171 +++-- codegen/Crm/Objects/Meetings/ApiException.php | 6 +- .../Crm/Objects/Meetings/Configuration.php | 65 +- .../Objects/Meetings/FormDataProcessor.php | 246 +++++++ .../Crm/Objects/Meetings/HeaderSelector.php | 6 +- .../Objects/Meetings/Model/AssociatedId.php | 23 +- .../Meetings/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/Meetings/Model/Error.php | 160 ++-- .../Objects/Meetings/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Meetings/Model/Filter.php | 167 ++--- .../Objects/Meetings/Model/FilterGroup.php | 18 +- .../Objects/Meetings/Model/ForwardPaging.php | 409 ---------- .../Objects/Meetings/Model/ModelInterface.php | 6 +- .../Crm/Objects/Meetings/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Meetings/Model/Paging.php | 18 +- .../Objects/Meetings/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Meetings/Model/PublicObjectId.php | 21 +- .../Model/PublicObjectSearchRequest.php | 191 ++--- .../Meetings/Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Meetings/Model/SimplePublicObjectId.php | 21 +- .../Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Model/SimplePublicUpsertObject.php | 196 ++--- .../Objects/Meetings/Model/StandardError.php | 205 +++--- .../Meetings/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Meetings/ObjectSerializer.php | 26 +- 45 files changed, 2233 insertions(+), 4100 deletions(-) create mode 100644 codegen/Crm/Objects/Meetings/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Meetings/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Meetings/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (80%) delete mode 100644 codegen/Crm/Objects/Meetings/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Meetings/Api/BasicApi.php b/codegen/Crm/Objects/Meetings/Api/BasicApi.php index acac4ba2..3cc02765 100644 --- a/codegen/Crm/Objects/Meetings/Api/BasicApi.php +++ b/codegen/Crm/Objects/Meetings/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($meeting_id, string $contentType = self::con $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($meeting_id, string $contentType = self::contentT 'Missing the required parameter $meeting_id when calling archive' ); } - + if (!preg_match("/.+/", $meeting_id)) { + throw new \InvalidArgumentException("invalid value for \"meeting_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/meetings/{meetingId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Meetings\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($meeting_id, $properties = null, $properties switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($meeting_id, $properties = null, $properties ); } - $returnType = '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($meeting_id, $properties = null, $properties $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($meeting_id, $properties = null, $properties $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($meeting_id, $properties = null, $properties_with 'Missing the required parameter $meeting_id when calling getById' ); } - + if (!preg_match("/.+/", $meeting_id)) { + throw new \InvalidArgumentException("invalid value for \"meeting_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($meeting_id, $properties = null, $properties_with * @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 meetings 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\Meetings\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Meetings\Model\Error + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Meetings\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 meetings 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\Meetings\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\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Meetings\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Meetings\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 meetings 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 meetings 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\Meetings\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Meetings\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 meetings 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($meeting_id, $simple_public_object_input, $id switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($meeting_id, $simple_public_object_input, $id ); } - $returnType = '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($meeting_id, $simple_public_object_input, $id $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($meeting_id, $simple_public_object_input, $id $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($meeting_id, $simple_public_object_input, $id_prop 'Missing the required parameter $meeting_id when calling update' ); } - + if (!preg_match("/.+/", $meeting_id)) { + throw new \InvalidArgumentException("invalid value for \"meeting_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/Meetings/Api/BatchApi.php b/codegen/Crm/Objects/Meetings/Api/BatchApi.php index 9a4e896e..6f0039fd 100644 --- a/codegen/Crm/Objects/Meetings/Api/BatchApi.php +++ b/codegen/Crm/Objects/Meetings/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\Meetings\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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\Meetings\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\Meetings\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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\Meetings\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\Meetings\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Meetings\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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\Meetings\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/Meetings/Api/SearchApi.php b/codegen/Crm/Objects/Meetings/Api/SearchApi.php index 1e2027e9..60d6a6e8 100644 --- a/codegen/Crm/Objects/Meetings/Api/SearchApi.php +++ b/codegen/Crm/Objects/Meetings/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Meetings\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Meetings\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -245,44 +208,21 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseWithTotalSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -290,8 +230,10 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -326,7 +268,7 @@ function ($response) { */ public function doSearchAsyncWithHttpInfo($public_object_search_request, string $contentType = self::contentTypes['doSearch'][0]) { - $returnType = '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Meetings\Model\CollectionResponseWithTotalSimplePublicObject'; $request = $this->doSearchRequest($public_object_search_request, $contentType); return $this->client @@ -476,6 +418,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/Meetings/ApiException.php b/codegen/Crm/Objects/Meetings/ApiException.php index bf9d8a1d..54353f40 100644 --- a/codegen/Crm/Objects/Meetings/ApiException.php +++ b/codegen/Crm/Objects/Meetings/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/Meetings/FormDataProcessor.php b/codegen/Crm/Objects/Meetings/FormDataProcessor.php new file mode 100644 index 00000000..5900b83b --- /dev/null +++ b/codegen/Crm/Objects/Meetings/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/Meetings/HeaderSelector.php b/codegen/Crm/Objects/Meetings/HeaderSelector.php index 238f1d33..ab6c33be 100644 --- a/codegen/Crm/Objects/Meetings/HeaderSelector.php +++ b/codegen/Crm/Objects/Meetings/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/Meetings/Model/AssociationSpec.php b/codegen/Crm/Objects/Meetings/Model/AssociationSpec.php index dbceebed..e7e8b1bd 100644 --- a/codegen/Crm/Objects/Meetings/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Meetings/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInput.php index 66543420..cf11ac7f 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 6ac1aabc..7c90071b 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 0f11830a..c77ea2e9 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectId.php index 336a6db7..32458576 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Meetings/Model/BatchReadInputSimplePublicObjectId.php index 2fb214d8..12f8f557 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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\Meetings\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/Meetings/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicObject.php index 129ee358..11f5f724 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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\Meetings\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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/Meetings/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index cd53f363..00000000 --- a/codegen/Crm/Objects/Meetings/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\Meetings\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Meetings\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/Meetings/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicUpsertObject.php index 5bd3983c..30c4b8f4 100644 --- a/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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\Meetings\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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/Meetings/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Meetings/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 0caade50..00000000 --- a/codegen/Crm/Objects/Meetings/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\Meetings\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Meetings\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/Meetings/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Meetings/Model/CollectionResponseAssociatedId.php index f94f676e..30f367c1 100644 --- a/codegen/Crm/Objects/Meetings/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Meetings/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Meetings/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Meetings/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Meetings/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 93c9bf01..a8dfa961 100644 --- a/codegen/Crm/Objects/Meetings/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Meetings/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\Meetings\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Meetings\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Meetings\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Meetings\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Meetings\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/Meetings/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Meetings/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 80% rename from codegen/Crm/Objects/Meetings/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Meetings/Model/CollectionResponseWithTotalSimplePublicObject.php index 88489961..26b8ec2c 100644 --- a/codegen/Crm/Objects/Meetings/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Meetings/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\Meetings\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Meetings\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Meetings\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Meetings\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Meetings\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Meetings\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/Meetings/Model/Error.php b/codegen/Crm/Objects/Meetings/Model/Error.php index cb01738d..94f1188d 100644 --- a/codegen/Crm/Objects/Meetings/Model/Error.php +++ b/codegen/Crm/Objects/Meetings/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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/Meetings/Model/ErrorDetail.php b/codegen/Crm/Objects/Meetings/Model/ErrorDetail.php index 5ce03875..76a6db32 100644 --- a/codegen/Crm/Objects/Meetings/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Meetings/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/Filter.php b/codegen/Crm/Objects/Meetings/Model/Filter.php index 1ad860b2..c245ed2a 100644 --- a/codegen/Crm/Objects/Meetings/Model/Filter.php +++ b/codegen/Crm/Objects/Meetings/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/FilterGroup.php b/codegen/Crm/Objects/Meetings/Model/FilterGroup.php index 19d49a1b..7e8f2bcb 100644 --- a/codegen/Crm/Objects/Meetings/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Meetings/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/ForwardPaging.php b/codegen/Crm/Objects/Meetings/Model/ForwardPaging.php deleted file mode 100644 index 1c134d75..00000000 --- a/codegen/Crm/Objects/Meetings/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\Meetings\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\Meetings\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Meetings\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/Meetings/Model/ModelInterface.php b/codegen/Crm/Objects/Meetings/Model/ModelInterface.php index d05a1d3f..1d186fd3 100644 --- a/codegen/Crm/Objects/Meetings/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Meetings/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings\Model @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/NextPage.php b/codegen/Crm/Objects/Meetings/Model/NextPage.php index ef548b49..11a17a6d 100644 --- a/codegen/Crm/Objects/Meetings/Model/NextPage.php +++ b/codegen/Crm/Objects/Meetings/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/Paging.php b/codegen/Crm/Objects/Meetings/Model/Paging.php index 944530a2..c9e764b7 100644 --- a/codegen/Crm/Objects/Meetings/Model/Paging.php +++ b/codegen/Crm/Objects/Meetings/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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/Meetings/Model/PreviousPage.php b/codegen/Crm/Objects/Meetings/Model/PreviousPage.php index 8b4e6f3e..aaef9e53 100644 --- a/codegen/Crm/Objects/Meetings/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Meetings/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Meetings/Model/PublicAssociationsForObject.php index 4905566f..f3225292 100644 --- a/codegen/Crm/Objects/Meetings/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Meetings/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Meetings\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Meetings\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Meetings\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\Meetings\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Meetings\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/Meetings/Model/PublicObjectId.php b/codegen/Crm/Objects/Meetings/Model/PublicObjectId.php index 1160f010..5a6fc002 100644 --- a/codegen/Crm/Objects/Meetings/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Meetings/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Meetings/Model/PublicObjectSearchRequest.php index b68c138f..2442fbba 100644 --- a/codegen/Crm/Objects/Meetings/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Meetings/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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\Meetings\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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\Meetings\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\Meetings\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/Meetings/Model/SimplePublicObject.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObject.php index 4b6e74e2..f050cec8 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInput.php index 0cca8ea8..f21c7838 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInputForCreate.php index 67f4eb46..5244f742 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInputUpsert.php index d64ee3ab..cfd5bb3f 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectId.php index 8b74179d..708d6338 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectInput.php index 70ea4547..a1d5c60c 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectInputForCreate.php index baf1895e..f7df410f 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectWithAssociations.php index fa8639f3..d4d34925 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Meetings/Model/SimplePublicUpsertObject.php index a7a46737..c171bf28 100644 --- a/codegen/Crm/Objects/Meetings/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Meetings/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/Model/StandardError.php b/codegen/Crm/Objects/Meetings/Model/StandardError.php index 6aa2e92e..ddab6e73 100644 --- a/codegen/Crm/Objects/Meetings/Model/StandardError.php +++ b/codegen/Crm/Objects/Meetings/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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\Meetings\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Meetings\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\Meetings\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\Meetings\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\Meetings\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\Meetings\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/Meetings/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Meetings/Model/ValueWithTimestamp.php index f4abaa26..d5879fe0 100644 --- a/codegen/Crm/Objects/Meetings/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Meetings/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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\Meetings * @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/Meetings/ObjectSerializer.php b/codegen/Crm/Objects/Meetings/ObjectSerializer.php index ed1d2915..efedd69c 100644 --- a/codegen/Crm/Objects/Meetings/ObjectSerializer.php +++ b/codegen/Crm/Objects/Meetings/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Meetings @@ -13,11 +13,11 @@ /** * Meetings * - * 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 9f2d6a4b570ecc00e79cf7ca175b520c754018b8 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 30 Jan 2026 11:53:15 +0300 Subject: [PATCH 4/7] Codegen: CRM Notes --- codegen/Crm/Objects/Notes/Api/BasicApi.php | 514 +++++-------- codegen/Crm/Objects/Notes/Api/BatchApi.php | 637 ++++------------ codegen/Crm/Objects/Notes/Api/SearchApi.php | 179 ++--- codegen/Crm/Objects/Notes/ApiException.php | 6 +- codegen/Crm/Objects/Notes/Configuration.php | 65 +- .../Crm/Objects/Notes/FormDataProcessor.php | 246 +++++++ codegen/Crm/Objects/Notes/HeaderSelector.php | 6 +- .../Crm/Objects/Notes/Model/AssociatedId.php | 23 +- .../Objects/Notes/Model/AssociationSpec.php | 29 +- ...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/Notes/Model/Error.php | 160 ++-- .../Crm/Objects/Notes/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Notes/Model/Filter.php | 167 ++--- .../Crm/Objects/Notes/Model/FilterGroup.php | 18 +- .../Crm/Objects/Notes/Model/ForwardPaging.php | 409 ---------- .../Objects/Notes/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Notes/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Notes/Model/Paging.php | 18 +- .../Crm/Objects/Notes/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Notes/Model/PublicObjectId.php | 21 +- .../Notes/Model/PublicObjectSearchRequest.php | 191 ++--- .../Notes/Model/SimplePublicObject.php | 184 +++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Notes/Model/SimplePublicObjectId.php | 21 +- .../Notes/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 252 ++++--- .../Notes/Model/SimplePublicUpsertObject.php | 242 +++--- .../Crm/Objects/Notes/Model/StandardError.php | 205 +++--- .../Notes/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Notes/ObjectSerializer.php | 26 +- 45 files changed, 2363 insertions(+), 4118 deletions(-) create mode 100644 codegen/Crm/Objects/Notes/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Notes/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Notes/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Notes/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Notes/Api/BasicApi.php b/codegen/Crm/Objects/Notes/Api/BasicApi.php index 8d6d0235..87bd83be 100644 --- a/codegen/Crm/Objects/Notes/Api/BasicApi.php +++ b/codegen/Crm/Objects/Notes/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($note_id, string $contentType = self::conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($note_id, string $contentType = self::contentType 'Missing the required parameter $note_id when calling archive' ); } - + if (!preg_match("/.+/", $note_id)) { + throw new \InvalidArgumentException("invalid value for \"note_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/notes/{noteId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Notes\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($note_id, $properties = null, $properties_wi switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($note_id, $properties = null, $properties_wi ); } - $returnType = '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($note_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($note_id, $properties = null, $properties_wi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($note_id, $properties = null, $properties_with_hi 'Missing the required parameter $note_id when calling getById' ); } - + if (!preg_match("/.+/", $note_id)) { + throw new \InvalidArgumentException("invalid value for \"note_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($note_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 notes 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\Notes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Notes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Notes\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 notes 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\Notes\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\Notes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Notes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Notes\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 notes 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 notes 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\Notes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Notes\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 notes 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($note_id, $simple_public_object_input, $id_pr switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($note_id, $simple_public_object_input, $id_pr ); } - $returnType = '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($note_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($note_id, $simple_public_object_input, $id_pr $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($note_id, $simple_public_object_input, $id_propert 'Missing the required parameter $note_id when calling update' ); } - + if (!preg_match("/.+/", $note_id)) { + throw new \InvalidArgumentException("invalid value for \"note_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/Notes/Api/BatchApi.php b/codegen/Crm/Objects/Notes/Api/BatchApi.php index 77a91691..745f9942 100644 --- a/codegen/Crm/Objects/Notes/Api/BatchApi.php +++ b/codegen/Crm/Objects/Notes/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\Notes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Notes\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\Notes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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\Notes\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\Notes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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\Notes\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\Notes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Notes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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\Notes\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/Notes/Api/SearchApi.php b/codegen/Crm/Objects/Notes/Api/SearchApi.php index d6ea7b6d..c5f8cc7d 100644 --- a/codegen/Crm/Objects/Notes/Api/SearchApi.php +++ b/codegen/Crm/Objects/Notes/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Notes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Notes\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Notes\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 notes based on specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Notes\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 notes based on specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Notes\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/Notes/ApiException.php b/codegen/Crm/Objects/Notes/ApiException.php index d4608fc2..b5372683 100644 --- a/codegen/Crm/Objects/Notes/ApiException.php +++ b/codegen/Crm/Objects/Notes/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/Notes/FormDataProcessor.php b/codegen/Crm/Objects/Notes/FormDataProcessor.php new file mode 100644 index 00000000..dc49b978 --- /dev/null +++ b/codegen/Crm/Objects/Notes/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/Notes/HeaderSelector.php b/codegen/Crm/Objects/Notes/HeaderSelector.php index 9d43b0ab..99f90c0f 100644 --- a/codegen/Crm/Objects/Notes/HeaderSelector.php +++ b/codegen/Crm/Objects/Notes/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/Notes/Model/AssociationSpec.php b/codegen/Crm/Objects/Notes/Model/AssociationSpec.php index 05d312e4..5c97b750 100644 --- a/codegen/Crm/Objects/Notes/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Notes/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -235,8 +236,9 @@ 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'; + public const ASSOCIATION_CATEGORY_WORK = 'WORK'; /** * Gets allowable values of the enum @@ -247,8 +249,9 @@ public function getAssociationCategoryAllowableValues() { return [ self::ASSOCIATION_CATEGORY_HUBSPOT_DEFINED, - self::ASSOCIATION_CATEGORY_USER_DEFINED, self::ASSOCIATION_CATEGORY_INTEGRATOR_DEFINED, + self::ASSOCIATION_CATEGORY_USER_DEFINED, + self::ASSOCIATION_CATEGORY_WORK, ]; } @@ -341,7 +344,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 +381,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 +397,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 +409,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 +439,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/Notes/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInput.php index 8c719e58..5543d7c4 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 53220be9..94c8f27b 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 7e61eccb..ec576615 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectId.php index b2c23b52..1523e42d 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Notes/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Notes/Model/BatchReadInputSimplePublicObjectId.php index f63166ff..65784d66 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Notes/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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\Notes\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/Notes/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicObject.php index e965e000..6a805a8a 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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\Notes\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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/Notes/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 084bd3ba..00000000 --- a/codegen/Crm/Objects/Notes/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\Notes\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Notes\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/Notes/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicUpsertObject.php index 2163a672..81bff5dc 100644 --- a/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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\Notes\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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/Notes/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Notes/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 92fbbe56..00000000 --- a/codegen/Crm/Objects/Notes/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\Notes\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Notes\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/Notes/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Notes/Model/CollectionResponseAssociatedId.php index 3da5c513..710ca29e 100644 --- a/codegen/Crm/Objects/Notes/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Notes/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Notes/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Notes/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Notes/Model/CollectionResponseSimplePublicObjectWithAssociations.php index fdbe20bf..854a2c6b 100644 --- a/codegen/Crm/Objects/Notes/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Notes/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\Notes\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Notes\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Notes\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Notes\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Notes\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Notes\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/Notes/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Notes/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Notes/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Notes/Model/CollectionResponseWithTotalSimplePublicObject.php index 694784f3..3d0631a6 100644 --- a/codegen/Crm/Objects/Notes/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Notes/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\Notes\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Notes\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Notes\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Notes\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Notes\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Notes\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/Notes/Model/Error.php b/codegen/Crm/Objects/Notes/Model/Error.php index 52c5ee78..dd74d384 100644 --- a/codegen/Crm/Objects/Notes/Model/Error.php +++ b/codegen/Crm/Objects/Notes/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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/Notes/Model/ErrorDetail.php b/codegen/Crm/Objects/Notes/Model/ErrorDetail.php index a5469ad2..46b2a989 100644 --- a/codegen/Crm/Objects/Notes/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Notes/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/Filter.php b/codegen/Crm/Objects/Notes/Model/Filter.php index 6f543377..a9f9f06a 100644 --- a/codegen/Crm/Objects/Notes/Model/Filter.php +++ b/codegen/Crm/Objects/Notes/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/FilterGroup.php b/codegen/Crm/Objects/Notes/Model/FilterGroup.php index 02e8b1ad..66242823 100644 --- a/codegen/Crm/Objects/Notes/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Notes/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/ForwardPaging.php b/codegen/Crm/Objects/Notes/Model/ForwardPaging.php deleted file mode 100644 index 63db37f5..00000000 --- a/codegen/Crm/Objects/Notes/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\Notes\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\Notes\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Notes\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/Notes/Model/ModelInterface.php b/codegen/Crm/Objects/Notes/Model/ModelInterface.php index 12eb4666..033925f9 100644 --- a/codegen/Crm/Objects/Notes/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Notes/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes\Model @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/NextPage.php b/codegen/Crm/Objects/Notes/Model/NextPage.php index 5375d88f..ab24cafc 100644 --- a/codegen/Crm/Objects/Notes/Model/NextPage.php +++ b/codegen/Crm/Objects/Notes/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/Paging.php b/codegen/Crm/Objects/Notes/Model/Paging.php index 7a1c5ba8..08fbf57b 100644 --- a/codegen/Crm/Objects/Notes/Model/Paging.php +++ b/codegen/Crm/Objects/Notes/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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/Notes/Model/PreviousPage.php b/codegen/Crm/Objects/Notes/Model/PreviousPage.php index 68007697..220a06a3 100644 --- a/codegen/Crm/Objects/Notes/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Notes/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Notes/Model/PublicAssociationsForObject.php index 1e614bb9..a9ba2523 100644 --- a/codegen/Crm/Objects/Notes/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Notes/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Notes\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Notes\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Notes\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\Notes\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Notes\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/Notes/Model/PublicObjectId.php b/codegen/Crm/Objects/Notes/Model/PublicObjectId.php index 18f700b3..0ee0fdea 100644 --- a/codegen/Crm/Objects/Notes/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Notes/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Notes/Model/PublicObjectSearchRequest.php index 39b6e88b..a8d2874e 100644 --- a/codegen/Crm/Objects/Notes/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Notes/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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\Notes\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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\Notes\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\Notes\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/Notes/Model/SimplePublicObject.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObject.php index fbb98aa7..f1843b49 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,15 @@ 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', - 'updated_at' => '\DateTime' + 'properties_with_history' => 'array', + 'updated_at' => '\DateTime', + 'url' => 'string' ]; /** @@ -75,14 +77,15 @@ 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, - 'updated_at' => 'date-time' + 'properties_with_history' => null, + 'updated_at' => 'date-time', + 'url' => null ]; /** @@ -91,14 +94,15 @@ 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, - 'updated_at' => false + 'properties_with_history' => false, + 'updated_at' => false, + 'url' => false ]; /** @@ -187,14 +191,15 @@ 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', - 'updated_at' => 'updatedAt' + 'properties_with_history' => 'propertiesWithHistory', + 'updated_at' => 'updatedAt', + 'url' => 'url' ]; /** @@ -203,14 +208,15 @@ 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', - 'updated_at' => 'setUpdatedAt' + 'properties_with_history' => 'setPropertiesWithHistory', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' ]; /** @@ -219,14 +225,15 @@ 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', - 'updated_at' => 'getUpdatedAt' + 'properties_with_history' => 'getPropertiesWithHistory', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' ]; /** @@ -286,14 +293,15 @@ 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); + $this->setIfExists('url', $data ?? [], null); } /** @@ -323,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"; } @@ -350,37 +361,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 +374,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -417,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 */ @@ -432,28 +416,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 +455,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -498,7 +482,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 +509,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 +523,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 +563,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 */ @@ -565,14 +576,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL associated with the object. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + 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]); } @@ -580,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; } @@ -610,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/Notes/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInput.php index e0946cbe..4586367e 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInputForCreate.php index 2cf9d028..dbb4e053 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInputUpsert.php index e593143b..3b83e155 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectId.php index d019ac6c..96b4156b 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectInput.php index d42a2bc0..535ea720 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectInputForCreate.php index 341aa6c8..1c92b2cf 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectWithAssociations.php index 2100cf04..62a215ed 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,15 +58,16 @@ 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', - 'updated_at' => '\DateTime' + 'properties_with_history' => 'array', + 'updated_at' => '\DateTime', + 'url' => 'string' ]; /** @@ -76,15 +78,16 @@ 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, - 'updated_at' => 'date-time' + 'properties_with_history' => null, + 'updated_at' => 'date-time', + 'url' => null ]; /** @@ -93,15 +96,16 @@ 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, - 'updated_at' => false + 'properties_with_history' => false, + 'updated_at' => false, + 'url' => false ]; /** @@ -190,15 +194,16 @@ 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', - 'updated_at' => 'updatedAt' + 'properties_with_history' => 'propertiesWithHistory', + 'updated_at' => 'updatedAt', + 'url' => 'url' ]; /** @@ -207,15 +212,16 @@ 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', - 'updated_at' => 'setUpdatedAt' + 'properties_with_history' => 'setPropertiesWithHistory', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' ]; /** @@ -224,15 +230,16 @@ 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', - 'updated_at' => 'getUpdatedAt' + 'properties_with_history' => 'getPropertiesWithHistory', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' ]; /** @@ -292,15 +299,16 @@ 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); + $this->setIfExists('url', $data ?? [], null); } /** @@ -330,6 +338,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 +368,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 +381,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -451,7 +408,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 +423,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 +489,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -532,7 +516,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 +543,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 +557,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 +597,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 */ @@ -599,14 +610,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL on the API that provide direct navigation to the corresponding UI pages for the connectors. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + 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]); } @@ -614,12 +652,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 +682,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/Notes/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Notes/Model/SimplePublicUpsertObject.php index bd9aa57c..30b0a230 100644 --- a/codegen/Crm/Objects/Notes/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Notes/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,15 +58,16 @@ 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', - 'updated_at' => '\DateTime' + 'properties_with_history' => 'array', + 'updated_at' => '\DateTime', + 'url' => 'string' ]; /** @@ -76,15 +78,16 @@ 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, - 'updated_at' => 'date-time' + 'properties_with_history' => null, + 'updated_at' => 'date-time', + 'url' => null ]; /** @@ -93,15 +96,16 @@ 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, - 'updated_at' => false + 'properties_with_history' => false, + 'updated_at' => false, + 'url' => false ]; /** @@ -190,15 +194,16 @@ 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', - 'updated_at' => 'updatedAt' + 'properties_with_history' => 'propertiesWithHistory', + 'updated_at' => 'updatedAt', + 'url' => 'url' ]; /** @@ -207,15 +212,16 @@ 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', - 'updated_at' => 'setUpdatedAt' + 'properties_with_history' => 'setPropertiesWithHistory', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' ]; /** @@ -224,15 +230,16 @@ 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', - 'updated_at' => 'getUpdatedAt' + 'properties_with_history' => 'getPropertiesWithHistory', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' ]; /** @@ -292,15 +299,16 @@ 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); + $this->setIfExists('url', $data ?? [], null); } /** @@ -330,15 +338,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 +371,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 +384,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -427,7 +411,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 +426,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 +519,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 +546,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 +560,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 +600,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,14 +613,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL associated with the object. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + 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]); } @@ -617,12 +655,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 +685,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/Notes/Model/StandardError.php b/codegen/Crm/Objects/Notes/Model/StandardError.php index cf3a0a1b..0001e538 100644 --- a/codegen/Crm/Objects/Notes/Model/StandardError.php +++ b/codegen/Crm/Objects/Notes/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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\Notes\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Notes\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\Notes\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\Notes\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\Notes\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\Notes\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/Notes/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Notes/Model/ValueWithTimestamp.php index bd2ee916..4f723b35 100644 --- a/codegen/Crm/Objects/Notes/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Notes/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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\Notes * @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/Notes/ObjectSerializer.php b/codegen/Crm/Objects/Notes/ObjectSerializer.php index e61281be..82215e4a 100644 --- a/codegen/Crm/Objects/Notes/ObjectSerializer.php +++ b/codegen/Crm/Objects/Notes/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Notes @@ -13,11 +13,11 @@ /** * Notes * - * 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 bd8a05f2f0167485617a7b13906f9452aa413e45 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 30 Jan 2026 12:19:03 +0300 Subject: [PATCH 5/7] Codegen: CRM Postal Mail --- .../Crm/Objects/PostalMail/Api/BasicApi.php | 650 ++++++---------- .../Crm/Objects/PostalMail/Api/BatchApi.php | 689 +++++------------ .../Crm/Objects/PostalMail/Api/SearchApi.php | 181 ++--- .../Crm/Objects/PostalMail/ApiException.php | 8 +- .../Crm/Objects/PostalMail/Configuration.php | 67 +- .../Objects/PostalMail/FormDataProcessor.php | 246 +++++++ .../Crm/Objects/PostalMail/HeaderSelector.php | 8 +- .../Objects/PostalMail/Model/AssociatedId.php | 25 +- .../PostalMail/Model/AssociationSpec.php | 29 +- ...BatchInputSimplePublicObjectBatchInput.php | 20 +- ...tSimplePublicObjectBatchInputForCreate.php | 20 +- ...nputSimplePublicObjectBatchInputUpsert.php | 20 +- .../Model/BatchInputSimplePublicObjectId.php | 20 +- .../BatchReadInputSimplePublicObjectId.php | 111 +-- .../Model/BatchResponseSimplePublicObject.php | 195 +++-- ...chResponseSimplePublicObjectWithErrors.php | 697 ------------------ .../BatchResponseSimplePublicUpsertObject.php | 195 +++-- ...onseSimplePublicUpsertObjectWithErrors.php | 697 ------------------ .../Model/CollectionResponseAssociatedId.php | 20 +- ...nseSimplePublicObjectWithAssociations.php} | 34 +- ...onResponseWithTotalSimplePublicObject.php} | 121 +-- .../Crm/Objects/PostalMail/Model/Error.php | 162 ++-- .../Objects/PostalMail/Model/ErrorDetail.php | 138 ++-- .../Crm/Objects/PostalMail/Model/Filter.php | 169 ++--- .../Objects/PostalMail/Model/FilterGroup.php | 20 +- .../PostalMail/Model/ForwardPaging.php | 409 ---------- .../PostalMail/Model/ModelInterface.php | 8 +- .../Crm/Objects/PostalMail/Model/NextPage.php | 87 +-- .../Crm/Objects/PostalMail/Model/Paging.php | 20 +- .../Objects/PostalMail/Model/PreviousPage.php | 25 +- .../Model/PublicAssociationsForObject.php | 92 +-- .../PostalMail/Model/PublicObjectId.php | 23 +- .../Model/PublicObjectSearchRequest.php | 193 ++--- .../PostalMail/Model/SimplePublicObject.php | 186 +++-- .../Model/SimplePublicObjectBatchInput.php | 95 +-- .../SimplePublicObjectBatchInputForCreate.php | 25 +- .../SimplePublicObjectBatchInputUpsert.php | 95 +-- .../PostalMail/Model/SimplePublicObjectId.php | 23 +- .../Model/SimplePublicObjectInput.php | 23 +- .../SimplePublicObjectInputForCreate.php | 23 +- .../SimplePublicObjectWithAssociations.php | 254 ++++--- .../Model/SimplePublicUpsertObject.php | 244 +++--- .../PostalMail/Model/StandardError.php | 207 +++--- .../PostalMail/Model/ValueWithTimestamp.php | 149 ++-- .../Objects/PostalMail/ObjectSerializer.php | 28 +- 45 files changed, 2497 insertions(+), 4254 deletions(-) create mode 100644 codegen/Crm/Objects/PostalMail/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/PostalMail/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/PostalMail/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/PostalMail/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/PostalMail/Api/BasicApi.php b/codegen/Crm/Objects/PostalMail/Api/BasicApi.php index 45711f78..079a1675 100644 --- a/codegen/Crm/Objects/PostalMail/Api/BasicApi.php +++ b/codegen/Crm/Objects/PostalMail/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($postal_mail_id, string $contentType = self: $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($postal_mail_id, string $contentType = self::cont 'Missing the required parameter $postal_mail_id when calling archive' ); } - + if (!preg_match("/.+/", $postal_mail_id)) { + throw new \InvalidArgumentException("invalid value for \"postal_mail_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/postal_mail/{postalMailId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\PostalMail\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; } } @@ -712,14 +658,14 @@ public function createRequest($simple_public_object_input_for_create, string $co /** * Operation getById * - * Read + * * * @param string $postal_mail_id postal_mail_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) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) - * @param string|null $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties properties (optional) + * @param string[]|null $properties_with_history properties_with_history (optional) + * @param string[]|null $associations associations (optional) + * @param bool|null $archived archived (optional, default to false) + * @param string|null $id_property id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format @@ -735,14 +681,14 @@ public function getById($postal_mail_id, $properties = null, $properties_with_hi /** * Operation getByIdWithHttpInfo * - * Read + * * * @param string $postal_mail_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) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) - * @param string|null $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) + * @param string|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format @@ -778,61 +724,21 @@ public function getByIdWithHttpInfo($postal_mail_id, $properties = null, $proper switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($postal_mail_id, $properties = null, $proper ); } - $returnType = '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($postal_mail_id, $properties = null, $proper $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($postal_mail_id, $properties = null, $proper $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -900,14 +785,14 @@ public function getByIdWithHttpInfo($postal_mail_id, $properties = null, $proper /** * Operation getByIdAsync * - * Read + * * * @param string $postal_mail_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) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) - * @param string|null $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) + * @param string|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -926,14 +811,14 @@ function ($response) { /** * Operation getByIdAsyncWithHttpInfo * - * Read + * * * @param string $postal_mail_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) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) - * @param string|null $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) + * @param string|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -984,11 +869,11 @@ function ($exception) { * Create request for operation 'getById' * * @param string $postal_mail_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) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) - * @param string|null $id_property The name of a property whose values are unique for this object (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) + * @param string|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1003,7 +888,10 @@ public function getByIdRequest($postal_mail_id, $properties = null, $properties_ 'Missing the required parameter $postal_mail_id when calling getById' ); } - + if (!preg_match("/.+/", $postal_mail_id)) { + throw new \InvalidArgumentException("invalid value for \"postal_mail_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1134,19 +1022,19 @@ public function getByIdRequest($postal_mail_id, $properties = null, $properties_ /** * Operation getPage * - * List + * * - * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) - * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit limit (optional, default to 10) + * @param string|null $after after (optional) + * @param string[]|null $properties properties (optional) + * @param string[]|null $properties_with_history properties_with_history (optional) + * @param string[]|null $associations associations (optional) + * @param bool|null $archived 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\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\PostalMail\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]) { @@ -1157,19 +1045,19 @@ public function getPage($limit = 10, $after = null, $properties = null, $propert /** * Operation getPageWithHttpInfo * - * List + * * - * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) - * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit (optional, default to 10) + * @param string|null $after (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $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\PostalMail\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\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\PostalMail\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; } } @@ -1322,14 +1149,14 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu /** * Operation getPageAsync * - * List + * * - * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) - * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit (optional, default to 10) + * @param string|null $after (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1348,14 +1175,14 @@ function ($response) { /** * Operation getPageAsyncWithHttpInfo * - * List + * * - * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) - * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit (optional, default to 10) + * @param string|null $after (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -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\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseSimplePublicObjectWithAssociations'; $request = $this->getPageRequest($limit, $after, $properties, $properties_with_history, $associations, $archived, $contentType); return $this->client @@ -1405,12 +1232,12 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param int|null $limit The maximum number of results to display per page. (optional, default to 10) - * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string[]|null $properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. (optional) - * @param string[]|null $properties_with_history A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. (optional) - * @param string[]|null $associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. (optional) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param int|null $limit (optional, default to 10) + * @param string|null $after (optional) + * @param string[]|null $properties (optional) + * @param string[]|null $properties_with_history (optional) + * @param string[]|null $associations (optional) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1551,11 +1378,11 @@ public function getPageRequest($limit = 10, $after = null, $properties = null, $ /** * Operation update * - * Update + * * * @param string $postal_mail_id postal_mail_id (required) * @param \HubSpot\Client\Crm\Objects\PostalMail\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|null $id_property id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format @@ -1571,11 +1398,11 @@ public function update($postal_mail_id, $simple_public_object_input, $id_propert /** * Operation updateWithHttpInfo * - * Update + * * * @param string $postal_mail_id (required) * @param \HubSpot\Client\Crm\Objects\PostalMail\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|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format @@ -1611,61 +1438,21 @@ public function updateWithHttpInfo($postal_mail_id, $simple_public_object_input, switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($postal_mail_id, $simple_public_object_input, ); } - $returnType = '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($postal_mail_id, $simple_public_object_input, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($postal_mail_id, $simple_public_object_input, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1733,11 +1499,11 @@ public function updateWithHttpInfo($postal_mail_id, $simple_public_object_input, /** * Operation updateAsync * - * Update + * * * @param string $postal_mail_id (required) * @param \HubSpot\Client\Crm\Objects\PostalMail\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|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1756,11 +1522,11 @@ function ($response) { /** * Operation updateAsyncWithHttpInfo * - * Update + * * * @param string $postal_mail_id (required) * @param \HubSpot\Client\Crm\Objects\PostalMail\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|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1812,7 +1578,7 @@ function ($exception) { * * @param string $postal_mail_id (required) * @param \HubSpot\Client\Crm\Objects\PostalMail\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|null $id_property (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1827,7 +1593,10 @@ public function updateRequest($postal_mail_id, $simple_public_object_input, $id_ 'Missing the required parameter $postal_mail_id when calling update' ); } - + if (!preg_match("/.+/", $postal_mail_id)) { + throw new \InvalidArgumentException("invalid value for \"postal_mail_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/PostalMail/Api/BatchApi.php b/codegen/Crm/Objects/PostalMail/Api/BatchApi.php index e562f8bc..aa6b0dcd 100644 --- a/codegen/Crm/Objects/PostalMail/Api/BatchApi.php +++ b/codegen/Crm/Objects/PostalMail/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; } } @@ -210,7 +214,7 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string /** * Operation archiveAsync * - * Archive a batch of postal mail by ID + * Batch archive * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectId $batch_input_simple_public_object_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation @@ -231,7 +235,7 @@ function ($response) { /** * Operation archiveAsyncWithHttpInfo * - * Archive a batch of postal mail by ID + * Batch archive * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectId $batch_input_simple_public_object_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation @@ -365,14 +369,14 @@ public function archiveRequest($batch_input_simple_public_object_id, string $con /** * Operation create * - * Create a batch of postal mail + * Batch create * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create batch_input_simple_public_object_batch_input_for_create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error */ public function create($batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0]) { @@ -383,14 +387,14 @@ public function create($batch_input_simple_public_object_batch_input_for_create, /** * Operation createWithHttpInfo * - * Create a batch of postal mail + * Batch create * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\PostalMail\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; } } @@ -578,7 +486,7 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input /** * Operation createAsync * - * Create a batch of postal mail + * Batch create * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation @@ -599,7 +507,7 @@ function ($response) { /** * Operation createAsyncWithHttpInfo * - * Create a batch of postal mail + * Batch create * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation @@ -746,15 +654,15 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_ /** * Operation read * - * Read a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id batch_read_input_simple_public_object_id (required) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error */ public function read($batch_read_input_simple_public_object_id, $archived = false, string $contentType = self::contentTypes['read'][0]) { @@ -765,15 +673,15 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals /** * Operation readWithHttpInfo * - * Read a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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; } } @@ -961,10 +773,10 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc /** * Operation readAsync * - * Read a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -983,10 +795,10 @@ function ($response) { /** * Operation readAsyncWithHttpInfo * - * Read a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1037,7 +849,7 @@ function ($exception) { * Create request for operation 'read' * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required) - * @param bool|null $archived Whether to return only results that have been archived. (optional, default to false) + * @param bool|null $archived (optional, default to false) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1142,14 +954,14 @@ public function readRequest($batch_read_input_simple_public_object_id, $archived /** * Operation update * - * Update a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInput $batch_input_simple_public_object_batch_input batch_input_simple_public_object_batch_input (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error */ public function update($batch_input_simple_public_object_batch_input, string $contentType = self::contentTypes['update'][0]) { @@ -1160,14 +972,14 @@ public function update($batch_input_simple_public_object_batch_input, string $co /** * Operation updateWithHttpInfo * - * Update a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInput $batch_input_simple_public_object_batch_input (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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; } } @@ -1355,7 +1071,7 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input /** * Operation updateAsync * - * Update a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInput $batch_input_simple_public_object_batch_input (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1376,7 +1092,7 @@ function ($response) { /** * Operation updateAsyncWithHttpInfo * - * Update a batch of postal mail by internal ID, or unique property values + * * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInput $batch_input_simple_public_object_batch_input (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation @@ -1523,14 +1239,14 @@ public function updateRequest($batch_input_simple_public_object_batch_input, str /** * Operation upsert * - * Create or update a batch of postal mail by unique property values + * Batch upsert * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert batch_input_simple_public_object_batch_input_upsert (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error */ public function upsert($batch_input_simple_public_object_batch_input_upsert, string $contentType = self::contentTypes['upsert'][0]) { @@ -1541,14 +1257,14 @@ public function upsert($batch_input_simple_public_object_batch_input_upsert, str /** * Operation upsertWithHttpInfo * - * Create or update a batch of postal mail by unique property values + * Batch upsert * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\PostalMail\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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; } } @@ -1736,7 +1356,7 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input /** * Operation upsertAsync * - * Create or update a batch of postal mail by unique property values + * Batch upsert * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation @@ -1757,7 +1377,7 @@ function ($response) { /** * Operation upsertAsyncWithHttpInfo * - * Create or update a batch of postal mail by unique property values + * Batch upsert * * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\BatchInputSimplePublicObjectBatchInputUpsert $batch_input_simple_public_object_batch_input_upsert (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upsert'] to see the possible values for this operation @@ -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/PostalMail/Api/SearchApi.php b/codegen/Crm/Objects/PostalMail/Api/SearchApi.php index 7df67c16..0abb7865 100644 --- a/codegen/Crm/Objects/PostalMail/Api/SearchApi.php +++ b/codegen/Crm/Objects/PostalMail/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\PostalMail\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\PostalMail\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\PostalMail\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 + * * @param \HubSpot\Client\Crm\Objects\PostalMail\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 + * * @param \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/ApiException.php b/codegen/Crm/Objects/PostalMail/ApiException.php index 76a2fab9..d7d8636a 100644 --- a/codegen/Crm/Objects/PostalMail/ApiException.php +++ b/codegen/Crm/Objects/PostalMail/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/PostalMail/FormDataProcessor.php b/codegen/Crm/Objects/PostalMail/FormDataProcessor.php new file mode 100644 index 00000000..4a0d8530 --- /dev/null +++ b/codegen/Crm/Objects/PostalMail/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/PostalMail/HeaderSelector.php b/codegen/Crm/Objects/PostalMail/HeaderSelector.php index 2aa4d0b5..cbc16729 100644 --- a/codegen/Crm/Objects/PostalMail/HeaderSelector.php +++ b/codegen/Crm/Objects/PostalMail/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/PostalMail/Model/AssociationSpec.php b/codegen/Crm/Objects/PostalMail/Model/AssociationSpec.php index cbf2e618..062240ff 100644 --- a/codegen/Crm/Objects/PostalMail/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/PostalMail/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInput.php index 18416a75..4ee30405 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 606f844d..6bac3372 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 4ad5e429..4d0a17d4 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectId.php index 2fc3d9ce..a1936118 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/PostalMail/Model/BatchReadInputSimplePublicObjectId.php index 59410c48..9fc68417 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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\PostalMail\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 * @@ -359,7 +333,7 @@ public function getIdProperty() /** * Sets id_property * - * @param string|null $id_property When using a custom unique value property to retrieve records, the name of the property. Do not include this parameter if retrieving by record ID. + * @param string|null $id_property id_property * * @return self */ @@ -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/PostalMail/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicObject.php index fc8b5fc7..db242289 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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\PostalMail\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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/PostalMail/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 26db79eb..00000000 --- a/codegen/Crm/Objects/PostalMail/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\PostalMail\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicUpsertObject.php index f2543301..d270b6b7 100644 --- a/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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\PostalMail\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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/PostalMail/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/PostalMail/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 14a24e7b..00000000 --- a/codegen/Crm/Objects/PostalMail/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\PostalMail\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/PostalMail/Model/CollectionResponseAssociatedId.php index ffe99a24..7168b09b 100644 --- a/codegen/Crm/Objects/PostalMail/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/PostalMail/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/PostalMail/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/PostalMail/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/PostalMail/Model/CollectionResponseSimplePublicObjectWithAssociations.php index bf5f2966..6fb5d477 100644 --- a/codegen/Crm/Objects/PostalMail/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/PostalMail/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\PostalMail\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\PostalMail\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/PostalMail/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/PostalMail/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/PostalMail/Model/CollectionResponseWithTotalSimplePublicObject.php index 2e17ee57..76d4ecfc 100644 --- a/codegen/Crm/Objects/PostalMail/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/PostalMail/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\PostalMail\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\PostalMail\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\PostalMail\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\PostalMail\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\PostalMail\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/Model/Error.php b/codegen/Crm/Objects/PostalMail/Model/Error.php index 63697dbf..807e9f39 100644 --- a/codegen/Crm/Objects/PostalMail/Model/Error.php +++ b/codegen/Crm/Objects/PostalMail/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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/PostalMail/Model/ErrorDetail.php b/codegen/Crm/Objects/PostalMail/Model/ErrorDetail.php index a6bcec17..e92f56ae 100644 --- a/codegen/Crm/Objects/PostalMail/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/PostalMail/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/Filter.php b/codegen/Crm/Objects/PostalMail/Model/Filter.php index 72c059b4..d2ebbd88 100644 --- a/codegen/Crm/Objects/PostalMail/Model/Filter.php +++ b/codegen/Crm/Objects/PostalMail/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/FilterGroup.php b/codegen/Crm/Objects/PostalMail/Model/FilterGroup.php index 15c745de..22cf9681 100644 --- a/codegen/Crm/Objects/PostalMail/Model/FilterGroup.php +++ b/codegen/Crm/Objects/PostalMail/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/ForwardPaging.php b/codegen/Crm/Objects/PostalMail/Model/ForwardPaging.php deleted file mode 100644 index 60bbaf1a..00000000 --- a/codegen/Crm/Objects/PostalMail/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\PostalMail\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\PostalMail\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/Model/ModelInterface.php b/codegen/Crm/Objects/PostalMail/Model/ModelInterface.php index 5ddda9ed..f036d8cf 100644 --- a/codegen/Crm/Objects/PostalMail/Model/ModelInterface.php +++ b/codegen/Crm/Objects/PostalMail/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail\Model @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/NextPage.php b/codegen/Crm/Objects/PostalMail/Model/NextPage.php index 191a2f8b..46546d80 100644 --- a/codegen/Crm/Objects/PostalMail/Model/NextPage.php +++ b/codegen/Crm/Objects/PostalMail/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/Paging.php b/codegen/Crm/Objects/PostalMail/Model/Paging.php index 81ee375b..efc74d70 100644 --- a/codegen/Crm/Objects/PostalMail/Model/Paging.php +++ b/codegen/Crm/Objects/PostalMail/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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/PostalMail/Model/PreviousPage.php b/codegen/Crm/Objects/PostalMail/Model/PreviousPage.php index b75b4d43..5ae9fb61 100644 --- a/codegen/Crm/Objects/PostalMail/Model/PreviousPage.php +++ b/codegen/Crm/Objects/PostalMail/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/PostalMail/Model/PublicAssociationsForObject.php index e0dbe7c4..f0103ca5 100644 --- a/codegen/Crm/Objects/PostalMail/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/PostalMail/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\PostalMail\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\PostalMail\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\PostalMail\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/PostalMail/Model/PublicObjectId.php b/codegen/Crm/Objects/PostalMail/Model/PublicObjectId.php index b1138b21..cb70af71 100644 --- a/codegen/Crm/Objects/PostalMail/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/PostalMail/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/PostalMail/Model/PublicObjectSearchRequest.php index 6d7c48ef..ea127063 100644 --- a/codegen/Crm/Objects/PostalMail/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/PostalMail/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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\PostalMail\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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/PostalMail/Model/SimplePublicObject.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObject.php index 66ee41b3..2d86d76e 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,15 @@ 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', - 'updated_at' => '\DateTime' + 'properties_with_history' => 'array', + 'updated_at' => '\DateTime', + 'url' => 'string' ]; /** @@ -75,14 +77,15 @@ 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, - 'updated_at' => 'date-time' + 'properties_with_history' => null, + 'updated_at' => 'date-time', + 'url' => null ]; /** @@ -91,14 +94,15 @@ 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, - 'updated_at' => false + 'properties_with_history' => false, + 'updated_at' => false, + 'url' => false ]; /** @@ -187,14 +191,15 @@ 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', - 'updated_at' => 'updatedAt' + 'properties_with_history' => 'propertiesWithHistory', + 'updated_at' => 'updatedAt', + 'url' => 'url' ]; /** @@ -203,14 +208,15 @@ 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', - 'updated_at' => 'setUpdatedAt' + 'properties_with_history' => 'setPropertiesWithHistory', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' ]; /** @@ -219,14 +225,15 @@ 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', - 'updated_at' => 'getUpdatedAt' + 'properties_with_history' => 'getPropertiesWithHistory', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' ]; /** @@ -286,14 +293,15 @@ 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); + $this->setIfExists('url', $data ?? [], null); } /** @@ -323,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"; } @@ -350,37 +361,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 +374,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -417,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 */ @@ -432,28 +416,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 +455,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -498,7 +482,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 to trace the creation or update request of the CRM object. * * @return self */ @@ -525,7 +509,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 +523,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 +563,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 */ @@ -565,14 +576,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL associated with the object. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + 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]); } @@ -580,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; } @@ -610,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/PostalMail/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInput.php index d0c475f0..d81c0442 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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); } @@ -317,82 +318,82 @@ public function valid() /** - * Gets id_property + * Gets id * - * @return string|null + * @return string */ - public function getIdProperty() + public function getId() { - return $this->container['id_property']; + return $this->container['id']; } /** - * Sets id_property + * Sets id * - * @param string|null $id_property The name of a property whose values are unique for this object + * @param string $id The unique ID of the object. * * @return self */ - public function setIdProperty($id_property) + public function setId($id) { - if (is_null($id_property)) { - throw new \InvalidArgumentException('non-nullable id_property cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id_property'] = $id_property; + $this->container['id'] = $id; return $this; } /** - * Gets object_write_trace_id + * Gets id_property * * @return string|null */ - public function getObjectWriteTraceId() + public function getIdProperty() { - return $this->container['object_write_trace_id']; + return $this->container['id_property']; } /** - * Sets object_write_trace_id + * Sets id_property * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $id_property The name of a unique identifier property, which can be used for identifying objects instead of the object ID. * * @return self */ - public function setObjectWriteTraceId($object_write_trace_id) + public function setIdProperty($id_property) { - if (is_null($object_write_trace_id)) { - throw new \InvalidArgumentException('non-nullable object_write_trace_id cannot be null'); + if (is_null($id_property)) { + throw new \InvalidArgumentException('non-nullable id_property cannot be null'); } - $this->container['object_write_trace_id'] = $object_write_trace_id; + $this->container['id_property'] = $id_property; return $this; } /** - * Gets id + * Gets object_write_trace_id * - * @return string + * @return string|null */ - public function getId() + public function getObjectWriteTraceId() { - return $this->container['id']; + return $this->container['object_write_trace_id']; } /** - * Sets id + * Sets object_write_trace_id * - * @param string $id The id to be updated. This can be the object id, or the unique property value of the idProperty property + * @param string|null $object_write_trace_id A unique identifier for tracing the request. * * @return self */ - public function setId($id) + public function setObjectWriteTraceId($object_write_trace_id) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($object_write_trace_id)) { + throw new \InvalidArgumentException('non-nullable object_write_trace_id cannot be null'); } - $this->container['id'] = $id; + $this->container['object_write_trace_id'] = $object_write_trace_id; return $this; } @@ -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/PostalMail/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInputForCreate.php index c08dfe73..4aca6d1e 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInputUpsert.php index d1dc58b3..1232f78d 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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); } @@ -317,82 +318,82 @@ public function valid() /** - * Gets id_property + * Gets id * - * @return string|null + * @return string */ - public function getIdProperty() + public function getId() { - return $this->container['id_property']; + return $this->container['id']; } /** - * Sets id_property + * Sets id * - * @param string|null $id_property The name of a property whose values are unique for this object + * @param string $id The unique ID of the object. * * @return self */ - public function setIdProperty($id_property) + public function setId($id) { - if (is_null($id_property)) { - throw new \InvalidArgumentException('non-nullable id_property cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id_property'] = $id_property; + $this->container['id'] = $id; return $this; } /** - * Gets object_write_trace_id + * Gets id_property * * @return string|null */ - public function getObjectWriteTraceId() + public function getIdProperty() { - return $this->container['object_write_trace_id']; + return $this->container['id_property']; } /** - * Sets object_write_trace_id + * Sets id_property * - * @param string|null $object_write_trace_id object_write_trace_id + * @param string|null $id_property The name of a unique identifier property, which can be used for identifying objects instead of the object ID. * * @return self */ - public function setObjectWriteTraceId($object_write_trace_id) + public function setIdProperty($id_property) { - if (is_null($object_write_trace_id)) { - throw new \InvalidArgumentException('non-nullable object_write_trace_id cannot be null'); + if (is_null($id_property)) { + throw new \InvalidArgumentException('non-nullable id_property cannot be null'); } - $this->container['object_write_trace_id'] = $object_write_trace_id; + $this->container['id_property'] = $id_property; return $this; } /** - * Gets id + * Gets object_write_trace_id * - * @return string + * @return string|null */ - public function getId() + public function getObjectWriteTraceId() { - return $this->container['id']; + return $this->container['object_write_trace_id']; } /** - * Sets id + * Sets object_write_trace_id * - * @param string $id id + * @param string|null $object_write_trace_id An identifier for tracing the creation request. * * @return self */ - public function setId($id) + public function setObjectWriteTraceId($object_write_trace_id) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($object_write_trace_id)) { + throw new \InvalidArgumentException('non-nullable object_write_trace_id cannot be null'); } - $this->container['id'] = $id; + $this->container['object_write_trace_id'] = $object_write_trace_id; return $this; } @@ -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/PostalMail/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectId.php index abbaa6ef..ba57b5ee 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectInput.php index 9426dc53..96cb8abf 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectInputForCreate.php index b942763a..dcf62cc6 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectWithAssociations.php index 4809a189..5a61da00 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,15 +58,16 @@ 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', - 'updated_at' => '\DateTime' + 'properties_with_history' => 'array', + 'updated_at' => '\DateTime', + 'url' => 'string' ]; /** @@ -76,15 +78,16 @@ 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, - 'updated_at' => 'date-time' + 'properties_with_history' => null, + 'updated_at' => 'date-time', + 'url' => null ]; /** @@ -93,15 +96,16 @@ 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, - 'updated_at' => false + 'properties_with_history' => false, + 'updated_at' => false, + 'url' => false ]; /** @@ -190,15 +194,16 @@ 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', - 'updated_at' => 'updatedAt' + 'properties_with_history' => 'propertiesWithHistory', + 'updated_at' => 'updatedAt', + 'url' => 'url' ]; /** @@ -207,15 +212,16 @@ 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', - 'updated_at' => 'setUpdatedAt' + 'properties_with_history' => 'setPropertiesWithHistory', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' ]; /** @@ -224,15 +230,16 @@ 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', - 'updated_at' => 'getUpdatedAt' + 'properties_with_history' => 'getPropertiesWithHistory', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' ]; /** @@ -292,15 +299,16 @@ 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); + $this->setIfExists('url', $data ?? [], null); } /** @@ -330,6 +338,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 +368,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 +381,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -451,7 +408,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 +423,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 +489,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -532,7 +516,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 +543,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 +557,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 +597,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 */ @@ -599,14 +610,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL on the API that provide direct navigation to the corresponding UI pages for the connectors. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + 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]); } @@ -614,12 +652,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 +682,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/PostalMail/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/PostalMail/Model/SimplePublicUpsertObject.php index 58fb7248..45cc97f5 100644 --- a/codegen/Crm/Objects/PostalMail/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/PostalMail/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,15 +58,16 @@ 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', - 'updated_at' => '\DateTime' + 'properties_with_history' => 'array', + 'updated_at' => '\DateTime', + 'url' => 'string' ]; /** @@ -76,15 +78,16 @@ 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, - 'updated_at' => 'date-time' + 'properties_with_history' => null, + 'updated_at' => 'date-time', + 'url' => null ]; /** @@ -93,15 +96,16 @@ 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, - 'updated_at' => false + 'properties_with_history' => false, + 'updated_at' => false, + 'url' => false ]; /** @@ -190,15 +194,16 @@ 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', - 'updated_at' => 'updatedAt' + 'properties_with_history' => 'propertiesWithHistory', + 'updated_at' => 'updatedAt', + 'url' => 'url' ]; /** @@ -207,15 +212,16 @@ 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', - 'updated_at' => 'setUpdatedAt' + 'properties_with_history' => 'setPropertiesWithHistory', + 'updated_at' => 'setUpdatedAt', + 'url' => 'setUrl' ]; /** @@ -224,15 +230,16 @@ 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', - 'updated_at' => 'getUpdatedAt' + 'properties_with_history' => 'getPropertiesWithHistory', + 'updated_at' => 'getUpdatedAt', + 'url' => 'getUrl' ]; /** @@ -292,15 +299,16 @@ 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); + $this->setIfExists('url', $data ?? [], null); } /** @@ -330,15 +338,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 +371,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 +384,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool $archived Whether the object is archived. * * @return self */ @@ -427,7 +411,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 +426,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 +519,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 +546,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 +560,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 +600,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,14 +613,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL associated with the object. + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + 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]); } @@ -617,12 +655,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 +685,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/PostalMail/Model/StandardError.php b/codegen/Crm/Objects/PostalMail/Model/StandardError.php index 6c6d3415..21eae250 100644 --- a/codegen/Crm/Objects/PostalMail/Model/StandardError.php +++ b/codegen/Crm/Objects/PostalMail/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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\PostalMail\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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\PostalMail\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/PostalMail/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/PostalMail/Model/ValueWithTimestamp.php index 611158aa..17327379 100644 --- a/codegen/Crm/Objects/PostalMail/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/PostalMail/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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\PostalMail * @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/PostalMail/ObjectSerializer.php b/codegen/Crm/Objects/PostalMail/ObjectSerializer.php index dc2f7c22..3d6efd5b 100644 --- a/codegen/Crm/Objects/PostalMail/ObjectSerializer.php +++ b/codegen/Crm/Objects/PostalMail/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\PostalMail @@ -11,13 +11,13 @@ */ /** - * Postal Mail + * CRM Postal Mail * - * 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 33d706c2421578f86f91405aa872980a5065ac5a Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 30 Jan 2026 12:36:45 +0300 Subject: [PATCH 6/7] Codegen: CRM Tasks --- codegen/Crm/Objects/Tasks/Api/BasicApi.php | 514 +++++-------- codegen/Crm/Objects/Tasks/Api/BatchApi.php | 637 ++++------------ codegen/Crm/Objects/Tasks/Api/SearchApi.php | 179 ++--- codegen/Crm/Objects/Tasks/ApiException.php | 6 +- codegen/Crm/Objects/Tasks/Configuration.php | 65 +- .../Crm/Objects/Tasks/FormDataProcessor.php | 246 +++++++ codegen/Crm/Objects/Tasks/HeaderSelector.php | 6 +- .../Crm/Objects/Tasks/Model/AssociatedId.php | 23 +- .../Objects/Tasks/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/Tasks/Model/Error.php | 160 ++-- .../Crm/Objects/Tasks/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Tasks/Model/Filter.php | 167 ++--- .../Crm/Objects/Tasks/Model/FilterGroup.php | 18 +- .../Crm/Objects/Tasks/Model/ForwardPaging.php | 409 ---------- .../Objects/Tasks/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Tasks/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Tasks/Model/Paging.php | 18 +- .../Crm/Objects/Tasks/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Tasks/Model/PublicObjectId.php | 21 +- .../Tasks/Model/PublicObjectSearchRequest.php | 191 ++--- .../Tasks/Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Tasks/Model/SimplePublicObjectId.php | 21 +- .../Tasks/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Tasks/Model/SimplePublicUpsertObject.php | 196 ++--- .../Crm/Objects/Tasks/Model/StandardError.php | 205 +++--- .../Tasks/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Tasks/ObjectSerializer.php | 26 +- 45 files changed, 2241 insertions(+), 4100 deletions(-) create mode 100644 codegen/Crm/Objects/Tasks/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Tasks/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Tasks/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Tasks/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Tasks/Api/BasicApi.php b/codegen/Crm/Objects/Tasks/Api/BasicApi.php index 588741c2..17aa5b1a 100644 --- a/codegen/Crm/Objects/Tasks/Api/BasicApi.php +++ b/codegen/Crm/Objects/Tasks/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($task_id, string $contentType = self::conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($task_id, string $contentType = self::contentType 'Missing the required parameter $task_id when calling archive' ); } - + if (!preg_match("/.+/", $task_id)) { + throw new \InvalidArgumentException("invalid value for \"task_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/tasks/{taskId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Tasks\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($task_id, $properties = null, $properties_wi switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($task_id, $properties = null, $properties_wi ); } - $returnType = '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($task_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($task_id, $properties = null, $properties_wi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($task_id, $properties = null, $properties_with_hi 'Missing the required parameter $task_id when calling getById' ); } - + if (!preg_match("/.+/", $task_id)) { + throw new \InvalidArgumentException("invalid value for \"task_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($task_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 tasks 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\Tasks\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Tasks\Model\Error + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Tasks\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 tasks 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\Tasks\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\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Tasks\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Tasks\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 tasks 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 tasks 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\Tasks\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Tasks\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 tasks 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($task_id, $simple_public_object_input, $id_pr switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($task_id, $simple_public_object_input, $id_pr ); } - $returnType = '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($task_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($task_id, $simple_public_object_input, $id_pr $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($task_id, $simple_public_object_input, $id_propert 'Missing the required parameter $task_id when calling update' ); } - + if (!preg_match("/.+/", $task_id)) { + throw new \InvalidArgumentException("invalid value for \"task_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/Tasks/Api/BatchApi.php b/codegen/Crm/Objects/Tasks/Api/BatchApi.php index ff25011d..40b68163 100644 --- a/codegen/Crm/Objects/Tasks/Api/BatchApi.php +++ b/codegen/Crm/Objects/Tasks/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\Tasks\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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\Tasks\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\Tasks\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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\Tasks\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\Tasks\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Tasks\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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\Tasks\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/Tasks/Api/SearchApi.php b/codegen/Crm/Objects/Tasks/Api/SearchApi.php index bafab46e..a63519bd 100644 --- a/codegen/Crm/Objects/Tasks/Api/SearchApi.php +++ b/codegen/Crm/Objects/Tasks/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Tasks\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Tasks\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Tasks\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 tasks using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Tasks\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 tasks using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Tasks\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/Tasks/ApiException.php b/codegen/Crm/Objects/Tasks/ApiException.php index 9550d607..3c12d92b 100644 --- a/codegen/Crm/Objects/Tasks/ApiException.php +++ b/codegen/Crm/Objects/Tasks/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/Tasks/FormDataProcessor.php b/codegen/Crm/Objects/Tasks/FormDataProcessor.php new file mode 100644 index 00000000..03a45337 --- /dev/null +++ b/codegen/Crm/Objects/Tasks/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/Tasks/HeaderSelector.php b/codegen/Crm/Objects/Tasks/HeaderSelector.php index 1c8ac172..2eb3eca3 100644 --- a/codegen/Crm/Objects/Tasks/HeaderSelector.php +++ b/codegen/Crm/Objects/Tasks/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/Tasks/Model/AssociationSpec.php b/codegen/Crm/Objects/Tasks/Model/AssociationSpec.php index 2c77d71b..1311f3ce 100644 --- a/codegen/Crm/Objects/Tasks/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Tasks/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInput.php index 991f66c9..0a712ffc 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 9d369272..ea642cfb 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 477e250d..3e70da02 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectId.php index 73d300ab..c1b6efd2 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Tasks/Model/BatchReadInputSimplePublicObjectId.php index 93ca0c7e..1590f60a 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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\Tasks\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/Tasks/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicObject.php index 898b9130..efa1ed45 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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\Tasks\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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/Tasks/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 48eb634d..00000000 --- a/codegen/Crm/Objects/Tasks/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\Tasks\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Tasks\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/Tasks/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicUpsertObject.php index 10af46b8..20ca00af 100644 --- a/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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\Tasks\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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/Tasks/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Tasks/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index 2327997a..00000000 --- a/codegen/Crm/Objects/Tasks/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\Tasks\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Tasks\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/Tasks/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Tasks/Model/CollectionResponseAssociatedId.php index 33b76ee3..e7500419 100644 --- a/codegen/Crm/Objects/Tasks/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Tasks/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Tasks/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Tasks/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Tasks/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 11a38fc2..25e9107c 100644 --- a/codegen/Crm/Objects/Tasks/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Tasks/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\Tasks\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Tasks\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Tasks\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Tasks\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Tasks\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/Tasks/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Tasks/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Tasks/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Tasks/Model/CollectionResponseWithTotalSimplePublicObject.php index c0b90ae6..869b8452 100644 --- a/codegen/Crm/Objects/Tasks/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Tasks/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\Tasks\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Tasks\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Tasks\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Tasks\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Tasks\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Tasks\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/Tasks/Model/Error.php b/codegen/Crm/Objects/Tasks/Model/Error.php index abfcae89..3556c3d0 100644 --- a/codegen/Crm/Objects/Tasks/Model/Error.php +++ b/codegen/Crm/Objects/Tasks/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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/Tasks/Model/ErrorDetail.php b/codegen/Crm/Objects/Tasks/Model/ErrorDetail.php index f5c1d0d4..89f70254 100644 --- a/codegen/Crm/Objects/Tasks/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Tasks/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/Filter.php b/codegen/Crm/Objects/Tasks/Model/Filter.php index 096cde37..49ad5e0b 100644 --- a/codegen/Crm/Objects/Tasks/Model/Filter.php +++ b/codegen/Crm/Objects/Tasks/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/FilterGroup.php b/codegen/Crm/Objects/Tasks/Model/FilterGroup.php index 452ed5d2..2ed0d223 100644 --- a/codegen/Crm/Objects/Tasks/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Tasks/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/ForwardPaging.php b/codegen/Crm/Objects/Tasks/Model/ForwardPaging.php deleted file mode 100644 index c2f4903b..00000000 --- a/codegen/Crm/Objects/Tasks/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\Tasks\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\Tasks\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Tasks\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/Tasks/Model/ModelInterface.php b/codegen/Crm/Objects/Tasks/Model/ModelInterface.php index d3cde058..db9336a7 100644 --- a/codegen/Crm/Objects/Tasks/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Tasks/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks\Model @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/NextPage.php b/codegen/Crm/Objects/Tasks/Model/NextPage.php index fde92189..30da27ed 100644 --- a/codegen/Crm/Objects/Tasks/Model/NextPage.php +++ b/codegen/Crm/Objects/Tasks/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/Paging.php b/codegen/Crm/Objects/Tasks/Model/Paging.php index 4d9c318b..6d1cb830 100644 --- a/codegen/Crm/Objects/Tasks/Model/Paging.php +++ b/codegen/Crm/Objects/Tasks/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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/Tasks/Model/PreviousPage.php b/codegen/Crm/Objects/Tasks/Model/PreviousPage.php index c38bab0b..91b30067 100644 --- a/codegen/Crm/Objects/Tasks/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Tasks/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Tasks/Model/PublicAssociationsForObject.php index dde6b8db..f74773cd 100644 --- a/codegen/Crm/Objects/Tasks/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Tasks/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Tasks\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Tasks\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Tasks\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\Tasks\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Tasks\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/Tasks/Model/PublicObjectId.php b/codegen/Crm/Objects/Tasks/Model/PublicObjectId.php index 9988e33b..b8d6ff53 100644 --- a/codegen/Crm/Objects/Tasks/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Tasks/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Tasks/Model/PublicObjectSearchRequest.php index 66c40725..1bfc3220 100644 --- a/codegen/Crm/Objects/Tasks/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Tasks/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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\Tasks\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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\Tasks\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\Tasks\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/Tasks/Model/SimplePublicObject.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObject.php index 2b596f45..b376662a 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInput.php index cad7f392..0e703e6c 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInputForCreate.php index 3532599e..3ba7772e 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInputUpsert.php index bb1427db..cca66a09 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectId.php index 9847e3b8..1803aece 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectInput.php index d622eb2e..e16ab709 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectInputForCreate.php index 23e31fca..c38c725c 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectWithAssociations.php index 8d175b59..b52eab85 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Tasks/Model/SimplePublicUpsertObject.php index 2130da95..ea489064 100644 --- a/codegen/Crm/Objects/Tasks/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Tasks/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/Model/StandardError.php b/codegen/Crm/Objects/Tasks/Model/StandardError.php index 1bc54f3c..04c3012f 100644 --- a/codegen/Crm/Objects/Tasks/Model/StandardError.php +++ b/codegen/Crm/Objects/Tasks/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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\Tasks\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Tasks\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\Tasks\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\Tasks\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\Tasks\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\Tasks\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/Tasks/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Tasks/Model/ValueWithTimestamp.php index 46a2532a..426a8dcb 100644 --- a/codegen/Crm/Objects/Tasks/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Tasks/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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\Tasks * @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/Tasks/ObjectSerializer.php b/codegen/Crm/Objects/Tasks/ObjectSerializer.php index 64d71caa..36aa1eca 100644 --- a/codegen/Crm/Objects/Tasks/ObjectSerializer.php +++ b/codegen/Crm/Objects/Tasks/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Tasks @@ -13,11 +13,11 @@ /** * Tasks * - * 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 1900aad30c87098e50806df33764bfb467f9eb44 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Fri, 30 Jan 2026 12:44:48 +0300 Subject: [PATCH 7/7] Codegen: CRM Taxes --- codegen/Crm/Objects/Taxes/Api/BasicApi.php | 514 +++++-------- codegen/Crm/Objects/Taxes/Api/BatchApi.php | 637 ++++------------ codegen/Crm/Objects/Taxes/Api/SearchApi.php | 179 ++--- codegen/Crm/Objects/Taxes/ApiException.php | 6 +- codegen/Crm/Objects/Taxes/Configuration.php | 65 +- .../Crm/Objects/Taxes/FormDataProcessor.php | 246 +++++++ codegen/Crm/Objects/Taxes/HeaderSelector.php | 6 +- .../Crm/Objects/Taxes/Model/AssociatedId.php | 23 +- .../Objects/Taxes/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/Taxes/Model/Error.php | 160 ++-- .../Crm/Objects/Taxes/Model/ErrorDetail.php | 136 ++-- codegen/Crm/Objects/Taxes/Model/Filter.php | 167 ++--- .../Crm/Objects/Taxes/Model/FilterGroup.php | 18 +- .../Crm/Objects/Taxes/Model/ForwardPaging.php | 409 ---------- .../Objects/Taxes/Model/ModelInterface.php | 6 +- codegen/Crm/Objects/Taxes/Model/NextPage.php | 85 +-- codegen/Crm/Objects/Taxes/Model/Paging.php | 18 +- .../Crm/Objects/Taxes/Model/PreviousPage.php | 23 +- .../Model/PublicAssociationsForObject.php | 90 +-- .../Objects/Taxes/Model/PublicObjectId.php | 21 +- .../Taxes/Model/PublicObjectSearchRequest.php | 191 ++--- .../Taxes/Model/SimplePublicObject.php | 138 ++-- .../Model/SimplePublicObjectBatchInput.php | 91 +-- .../SimplePublicObjectBatchInputForCreate.php | 23 +- .../SimplePublicObjectBatchInputUpsert.php | 91 +-- .../Taxes/Model/SimplePublicObjectId.php | 21 +- .../Taxes/Model/SimplePublicObjectInput.php | 21 +- .../SimplePublicObjectInputForCreate.php | 21 +- .../SimplePublicObjectWithAssociations.php | 206 +++--- .../Taxes/Model/SimplePublicUpsertObject.php | 196 ++--- .../Crm/Objects/Taxes/Model/StandardError.php | 205 +++--- .../Taxes/Model/ValueWithTimestamp.php | 147 ++-- .../Crm/Objects/Taxes/ObjectSerializer.php | 26 +- 45 files changed, 2241 insertions(+), 4100 deletions(-) create mode 100644 codegen/Crm/Objects/Taxes/FormDataProcessor.php delete mode 100644 codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicObjectWithErrors.php delete mode 100644 codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php rename codegen/Crm/Objects/Taxes/Model/{CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php => CollectionResponseSimplePublicObjectWithAssociations.php} (82%) rename codegen/Crm/Objects/Taxes/Model/{CollectionResponseWithTotalSimplePublicObjectForwardPaging.php => CollectionResponseWithTotalSimplePublicObject.php} (79%) delete mode 100644 codegen/Crm/Objects/Taxes/Model/ForwardPaging.php diff --git a/codegen/Crm/Objects/Taxes/Api/BasicApi.php b/codegen/Crm/Objects/Taxes/Api/BasicApi.php index 4259e880..b5a9ead4 100644 --- a/codegen/Crm/Objects/Taxes/Api/BasicApi.php +++ b/codegen/Crm/Objects/Taxes/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -201,8 +203,10 @@ public function archiveWithHttpInfo($tax_id, string $contentType = self::content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -285,7 +289,10 @@ public function archiveRequest($tax_id, string $contentType = self::contentTypes 'Missing the required parameter $tax_id when calling archive' ); } - + if (!preg_match("/.+/", $tax_id)) { + throw new \InvalidArgumentException("invalid value for \"tax_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/taxes/{taxId}'; $formParams = []; @@ -421,62 +428,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Taxes\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($tax_id, $properties = null, $properties_wit switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -846,34 +752,11 @@ public function getByIdWithHttpInfo($tax_id, $properties = null, $properties_wit ); } - $returnType = '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -883,7 +766,7 @@ public function getByIdWithHttpInfo($tax_id, $properties = null, $properties_wit $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -891,8 +774,10 @@ public function getByIdWithHttpInfo($tax_id, $properties = null, $properties_wit $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1003,7 +888,10 @@ public function getByIdRequest($tax_id, $properties = null, $properties_with_his 'Missing the required parameter $tax_id when calling getById' ); } - + if (!preg_match("/.+/", $tax_id)) { + throw new \InvalidArgumentException("invalid value for \"tax_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1139,14 +1027,14 @@ public function getByIdRequest($tax_id, $properties = null, $properties_with_his * @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 taxes 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\Taxes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Taxes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Taxes\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 taxes 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\Taxes\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\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Objects\Taxes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Objects\Taxes\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 taxes 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 taxes 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\Taxes\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Taxes\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 taxes 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($tax_id, $simple_public_object_input, $id_pro switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1679,34 +1466,11 @@ public function updateWithHttpInfo($tax_id, $simple_public_object_input, $id_pro ); } - $returnType = '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1716,7 +1480,7 @@ public function updateWithHttpInfo($tax_id, $simple_public_object_input, $id_pro $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1724,8 +1488,10 @@ public function updateWithHttpInfo($tax_id, $simple_public_object_input, $id_pro $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1827,7 +1593,10 @@ public function updateRequest($tax_id, $simple_public_object_input, $id_property 'Missing the required parameter $tax_id when calling update' ); } - + if (!preg_match("/.+/", $tax_id)) { + throw new \InvalidArgumentException("invalid value for \"tax_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/Taxes/Api/BatchApi.php b/codegen/Crm/Objects/Taxes/Api/BatchApi.php index eb200d56..c3ca5cea 100644 --- a/codegen/Crm/Objects/Taxes/Api/BatchApi.php +++ b/codegen/Crm/Objects/Taxes/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\Taxes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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\Taxes\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\Taxes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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\Taxes\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\Taxes\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Objects\Taxes\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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\Taxes\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/Taxes/Api/SearchApi.php b/codegen/Crm/Objects/Taxes/Api/SearchApi.php index fd876791..efa8d942 100644 --- a/codegen/Crm/Objects/Taxes/Api/SearchApi.php +++ b/codegen/Crm/Objects/Taxes/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\Taxes\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Objects\Taxes\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Objects\Taxes\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 taxes using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Taxes\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 taxes using specified criteria. + * * @param \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Objects\Taxes\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/Taxes/ApiException.php b/codegen/Crm/Objects/Taxes/ApiException.php index ca9f2af1..bdeb379b 100644 --- a/codegen/Crm/Objects/Taxes/ApiException.php +++ b/codegen/Crm/Objects/Taxes/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/Taxes/FormDataProcessor.php b/codegen/Crm/Objects/Taxes/FormDataProcessor.php new file mode 100644 index 00000000..19ecd6dd --- /dev/null +++ b/codegen/Crm/Objects/Taxes/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/Taxes/HeaderSelector.php b/codegen/Crm/Objects/Taxes/HeaderSelector.php index 65586a8c..8650bf12 100644 --- a/codegen/Crm/Objects/Taxes/HeaderSelector.php +++ b/codegen/Crm/Objects/Taxes/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/Taxes/Model/AssociationSpec.php b/codegen/Crm/Objects/Taxes/Model/AssociationSpec.php index 8a5d4545..796c3238 100644 --- a/codegen/Crm/Objects/Taxes/Model/AssociationSpec.php +++ b/codegen/Crm/Objects/Taxes/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInput.php index 1f8e1e01..25b2e49f 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index 1591e7f7..cbf1d768 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index 5285701f..985996b6 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectId.php index 3ecbe7a6..a3dc5cb7 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Objects/Taxes/Model/BatchReadInputSimplePublicObjectId.php index 97c0b27c..9c37020a 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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\Taxes\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/Taxes/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicObject.php index d1ca4b6e..16f4ba42 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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\Taxes\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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/Taxes/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index c36a7df9..00000000 --- a/codegen/Crm/Objects/Taxes/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\Taxes\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Taxes\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/Taxes/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicUpsertObject.php index 89836b4c..de2a0a3d 100644 --- a/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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\Taxes\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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/Taxes/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Objects/Taxes/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index fc98c851..00000000 --- a/codegen/Crm/Objects/Taxes/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\Taxes\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Objects\Taxes\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/Taxes/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Objects/Taxes/Model/CollectionResponseAssociatedId.php index 8468b371..3a6308c6 100644 --- a/codegen/Crm/Objects/Taxes/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Objects/Taxes/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Objects/Taxes/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Objects/Taxes/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Objects/Taxes/Model/CollectionResponseSimplePublicObjectWithAssociations.php index a5a55112..2aa71a09 100644 --- a/codegen/Crm/Objects/Taxes/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Objects/Taxes/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\Taxes\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Objects\Taxes\Model\Paging', 'results' => '\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Objects\Taxes\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Taxes\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Taxes\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/Taxes/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Objects/Taxes/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Objects/Taxes/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Objects/Taxes/Model/CollectionResponseWithTotalSimplePublicObject.php index e27df221..c2a9dc2d 100644 --- a/codegen/Crm/Objects/Taxes/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Objects/Taxes/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\Taxes\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Objects\Taxes\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Objects\Taxes\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Objects\Taxes\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Objects\Taxes\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Objects\Taxes\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/Taxes/Model/Error.php b/codegen/Crm/Objects/Taxes/Model/Error.php index 6ae7d89e..26ea324c 100644 --- a/codegen/Crm/Objects/Taxes/Model/Error.php +++ b/codegen/Crm/Objects/Taxes/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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/Taxes/Model/ErrorDetail.php b/codegen/Crm/Objects/Taxes/Model/ErrorDetail.php index bd1ce5b2..a7db13f9 100644 --- a/codegen/Crm/Objects/Taxes/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/Taxes/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/Filter.php b/codegen/Crm/Objects/Taxes/Model/Filter.php index 30cccf94..e35dcdb0 100644 --- a/codegen/Crm/Objects/Taxes/Model/Filter.php +++ b/codegen/Crm/Objects/Taxes/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/FilterGroup.php b/codegen/Crm/Objects/Taxes/Model/FilterGroup.php index b0c2cdab..7ba1cafe 100644 --- a/codegen/Crm/Objects/Taxes/Model/FilterGroup.php +++ b/codegen/Crm/Objects/Taxes/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/ForwardPaging.php b/codegen/Crm/Objects/Taxes/Model/ForwardPaging.php deleted file mode 100644 index e8d0662d..00000000 --- a/codegen/Crm/Objects/Taxes/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\Taxes\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\Taxes\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Objects\Taxes\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/Taxes/Model/ModelInterface.php b/codegen/Crm/Objects/Taxes/Model/ModelInterface.php index 1cce8815..baffadf4 100644 --- a/codegen/Crm/Objects/Taxes/Model/ModelInterface.php +++ b/codegen/Crm/Objects/Taxes/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes\Model @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/NextPage.php b/codegen/Crm/Objects/Taxes/Model/NextPage.php index ec8b2ac3..b848af2c 100644 --- a/codegen/Crm/Objects/Taxes/Model/NextPage.php +++ b/codegen/Crm/Objects/Taxes/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/Paging.php b/codegen/Crm/Objects/Taxes/Model/Paging.php index e1e9e742..a52c60f5 100644 --- a/codegen/Crm/Objects/Taxes/Model/Paging.php +++ b/codegen/Crm/Objects/Taxes/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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/Taxes/Model/PreviousPage.php b/codegen/Crm/Objects/Taxes/Model/PreviousPage.php index 74696d77..25eb8a99 100644 --- a/codegen/Crm/Objects/Taxes/Model/PreviousPage.php +++ b/codegen/Crm/Objects/Taxes/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/PublicAssociationsForObject.php b/codegen/Crm/Objects/Taxes/Model/PublicAssociationsForObject.php index dd615791..3ca0843e 100644 --- a/codegen/Crm/Objects/Taxes/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Objects/Taxes/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Objects\Taxes\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Objects\Taxes\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Objects\Taxes\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\Taxes\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Objects\Taxes\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/Taxes/Model/PublicObjectId.php b/codegen/Crm/Objects/Taxes/Model/PublicObjectId.php index 195a80de..3daafbe0 100644 --- a/codegen/Crm/Objects/Taxes/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/Taxes/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/PublicObjectSearchRequest.php b/codegen/Crm/Objects/Taxes/Model/PublicObjectSearchRequest.php index 60c9a12f..579058db 100644 --- a/codegen/Crm/Objects/Taxes/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Objects/Taxes/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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\Taxes\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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\Taxes\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\Taxes\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/Taxes/Model/SimplePublicObject.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObject.php index 358fe8e2..d7ad6bf0 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInput.php index 95ed5bc1..c03a6192 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInputForCreate.php index 3dd2740a..6448aed7 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInputUpsert.php index 170e79f6..64a7465b 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectId.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectId.php index 806804b3..552a652d 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectInput.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectInput.php index d04cc38c..e73d0a6c 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectInputForCreate.php index 8b86985b..54066d37 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectWithAssociations.php index 51538c99..e7cbbb32 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/SimplePublicUpsertObject.php b/codegen/Crm/Objects/Taxes/Model/SimplePublicUpsertObject.php index 68c618ef..2245e76c 100644 --- a/codegen/Crm/Objects/Taxes/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Objects/Taxes/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/Model/StandardError.php b/codegen/Crm/Objects/Taxes/Model/StandardError.php index 5389cbb0..1fac36de 100644 --- a/codegen/Crm/Objects/Taxes/Model/StandardError.php +++ b/codegen/Crm/Objects/Taxes/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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\Taxes\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\Taxes\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\Taxes\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\Taxes\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\Taxes\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\Taxes\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/Taxes/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/Taxes/Model/ValueWithTimestamp.php index 7966dcfb..61d03dbd 100644 --- a/codegen/Crm/Objects/Taxes/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/Taxes/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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\Taxes * @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/Taxes/ObjectSerializer.php b/codegen/Crm/Objects/Taxes/ObjectSerializer.php index 0d409763..199e16e3 100644 --- a/codegen/Crm/Objects/Taxes/ObjectSerializer.php +++ b/codegen/Crm/Objects/Taxes/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\Taxes @@ -13,11 +13,11 @@ /** * Taxes * - * 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) : ''; } }