diff --git a/codegen/Crm/Contacts/Api/BasicApi.php b/codegen/Crm/Contacts/Api/BasicApi.php index 4100985a..efdd7e49 100644 --- a/codegen/Crm/Contacts/Api/BasicApi.php +++ b/codegen/Crm/Contacts/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -207,8 +209,10 @@ public function archiveWithHttpInfo($contact_id, string $contentType = self::con $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -218,7 +222,7 @@ public function archiveWithHttpInfo($contact_id, string $contentType = self::con * * Archive a contact * - * @param string $contact_id The ID of the contact to delete. (required) + * @param string $contact_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -239,7 +243,7 @@ function ($response) { * * Archive a contact * - * @param string $contact_id The ID of the contact to delete. (required) + * @param string $contact_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -276,7 +280,7 @@ function ($exception) { /** * Create request for operation 'archive' * - * @param string $contact_id The ID of the contact to delete. (required) + * @param string $contact_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -291,7 +295,10 @@ public function archiveRequest($contact_id, string $contentType = self::contentT 'Missing the required parameter $contact_id when calling archive' ); } - + if (!preg_match("/.+/", $contact_id)) { + throw new \InvalidArgumentException("invalid value for \"contact_id\" when calling BasicApi.archive, must conform to the pattern /.+/."); + } + $resourcePath = '/crm/v3/objects/contacts/{contactId}'; $formParams = []; @@ -427,62 +434,22 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -496,44 +463,21 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin ); } - $returnType = '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -541,8 +485,10 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -720,12 +666,12 @@ public function createRequest($simple_public_object_input_for_create, string $co * * Retrieve a contact * - * @param string $contact_id The ID of the contact to retrieve. (required) + * @param string $contact_id contact_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 type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Contacts\ApiException on non-2xx response or if the response body is not in the expected format @@ -743,12 +689,12 @@ public function getById($contact_id, $properties = null, $properties_with_histor * * Retrieve a contact * - * @param string $contact_id The ID of the contact to retrieve. (required) + * @param string $contact_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 type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Contacts\ApiException on non-2xx response or if the response body is not in the expected format @@ -784,61 +730,21 @@ public function getByIdWithHttpInfo($contact_id, $properties = null, $properties switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObjectWithAssociations', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -852,34 +758,11 @@ public function getByIdWithHttpInfo($contact_id, $properties = null, $properties ); } - $returnType = '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -889,7 +772,7 @@ public function getByIdWithHttpInfo($contact_id, $properties = null, $properties $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -897,8 +780,10 @@ public function getByIdWithHttpInfo($contact_id, $properties = null, $properties $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -908,12 +793,12 @@ public function getByIdWithHttpInfo($contact_id, $properties = null, $properties * * Retrieve a contact * - * @param string $contact_id The ID of the contact to retrieve. (required) + * @param string $contact_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 type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -934,12 +819,12 @@ function ($response) { * * Retrieve a contact * - * @param string $contact_id The ID of the contact to retrieve. (required) + * @param string $contact_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 type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -989,12 +874,12 @@ function ($exception) { /** * Create request for operation 'getById' * - * @param string $contact_id The ID of the contact to retrieve. (required) + * @param string $contact_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 type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1009,7 +894,10 @@ public function getByIdRequest($contact_id, $properties = null, $properties_with 'Missing the required parameter $contact_id when calling getById' ); } - + if (!preg_match("/.+/", $contact_id)) { + throw new \InvalidArgumentException("invalid value for \"contact_id\" when calling BasicApi.getById, must conform to the pattern /.+/."); + } + @@ -1145,14 +1033,14 @@ public function getByIdRequest($contact_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 contacts 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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Contacts\Model\Error + * @return \HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Contacts\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]) { @@ -1168,14 +1056,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 contacts 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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|\HubSpot\Client\Crm\Contacts\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociations|\HubSpot\Client\Crm\Contacts\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]) { @@ -1206,61 +1094,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1274,44 +1122,21 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu ); } - $returnType = '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociations', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging', + '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociations', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1319,8 +1144,10 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1333,7 +1160,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 contacts 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 @@ -1359,7 +1186,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 contacts 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 @@ -1369,7 +1196,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\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseSimplePublicObjectWithAssociations'; $request = $this->getPageRequest($limit, $after, $properties, $properties_with_history, $associations, $archived, $contentType); return $this->client @@ -1414,7 +1241,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 contacts 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 @@ -1613,61 +1440,21 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1681,34 +1468,11 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel ); } - $returnType = '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1718,7 +1482,7 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1726,8 +1490,10 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1957,7 +1723,6 @@ public function purgeWithHttpInfo($public_gdpr_delete_input, string $contentType return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -1967,8 +1732,10 @@ public function purgeWithHttpInfo($public_gdpr_delete_input, string $contentType $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2133,9 +1900,9 @@ public function purgeRequest($public_gdpr_delete_input, string $contentType = se * * Update a contact * - * @param string $contact_id The ID of the contact to update. (required) + * @param string $contact_id contact_id (required) * @param \HubSpot\Client\Crm\Contacts\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 type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Contacts\ApiException on non-2xx response or if the response body is not in the expected format @@ -2153,9 +1920,9 @@ public function update($contact_id, $simple_public_object_input, $id_property = * * Update a contact * - * @param string $contact_id The ID of the contact to update. (required) + * @param string $contact_id (required) * @param \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string|null $id_property The name of a property whose values are unique for this object type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Contacts\ApiException on non-2xx response or if the response body is not in the expected format @@ -2191,61 +1958,21 @@ public function updateWithHttpInfo($contact_id, $simple_public_object_input, $id switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2259,34 +1986,11 @@ public function updateWithHttpInfo($contact_id, $simple_public_object_input, $id ); } - $returnType = '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2296,7 +2000,7 @@ public function updateWithHttpInfo($contact_id, $simple_public_object_input, $id $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2304,8 +2008,10 @@ public function updateWithHttpInfo($contact_id, $simple_public_object_input, $id $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2315,9 +2021,9 @@ public function updateWithHttpInfo($contact_id, $simple_public_object_input, $id * * Update a contact * - * @param string $contact_id The ID of the contact to update. (required) + * @param string $contact_id (required) * @param \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string|null $id_property The name of a property whose values are unique for this object type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2338,9 +2044,9 @@ function ($response) { * * Update a contact * - * @param string $contact_id The ID of the contact to update. (required) + * @param string $contact_id (required) * @param \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string|null $id_property The name of a property whose values are unique for this object type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2390,9 +2096,9 @@ function ($exception) { /** * Create request for operation 'update' * - * @param string $contact_id The ID of the contact to update. (required) + * @param string $contact_id (required) * @param \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput $simple_public_object_input (required) - * @param string|null $id_property The name of a property whose values are unique for this object type (optional) + * @param string|null $id_property The name of a property whose values are unique for this object. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['update'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2407,7 +2113,10 @@ public function updateRequest($contact_id, $simple_public_object_input, $id_prop 'Missing the required parameter $contact_id when calling update' ); } - + if (!preg_match("/.+/", $contact_id)) { + throw new \InvalidArgumentException("invalid value for \"contact_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( @@ -2525,6 +2234,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/Contacts/Api/BatchApi.php b/codegen/Crm/Contacts/Api/BatchApi.php index 739144b4..3c4e85c7 100644 --- a/codegen/Crm/Contacts/Api/BatchApi.php +++ b/codegen/Crm/Contacts/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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error + * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error + * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error + * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error + * @return \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Contacts\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\Contacts\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObjectWithErrors|\HubSpot\Client\Crm\Contacts\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObject|\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicUpsertObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicUpsertObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObjectWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\BatchResponseSimplePublicUpsertObjectWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\BatchResponseSimplePublicUpsertObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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\Contacts\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/Contacts/Api/SearchApi.php b/codegen/Crm/Contacts/Api/SearchApi.php index 259ef812..3b4fc062 100644 --- a/codegen/Crm/Contacts/Api/SearchApi.php +++ b/codegen/Crm/Contacts/Api/SearchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Contacts\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Contacts\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\Contacts\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Contacts\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -249,44 +212,21 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\CollectionResponseWithTotalSimplePublicObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging', + '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseWithTotalSimplePublicObject', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -294,8 +234,10 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -334,7 +276,7 @@ function ($response) { */ public function doSearchAsyncWithHttpInfo($public_object_search_request, string $contentType = self::contentTypes['doSearch'][0]) { - $returnType = '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Contacts\Model\CollectionResponseWithTotalSimplePublicObject'; $request = $this->doSearchRequest($public_object_search_request, $contentType); return $this->client @@ -484,6 +426,57 @@ protected function createHttpClientOption() } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/codegen/Crm/Contacts/ApiException.php b/codegen/Crm/Contacts/ApiException.php index 88f75960..4d141864 100644 --- a/codegen/Crm/Contacts/ApiException.php +++ b/codegen/Crm/Contacts/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/Contacts/FormDataProcessor.php b/codegen/Crm/Contacts/FormDataProcessor.php new file mode 100644 index 00000000..ecf3afd2 --- /dev/null +++ b/codegen/Crm/Contacts/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/Contacts/HeaderSelector.php b/codegen/Crm/Contacts/HeaderSelector.php index 137b770f..e77cea28 100644 --- a/codegen/Crm/Contacts/HeaderSelector.php +++ b/codegen/Crm/Contacts/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/Contacts/Model/AssociationSpec.php b/codegen/Crm/Contacts/Model/AssociationSpec.php index 3051a702..673fe067 100644 --- a/codegen/Crm/Contacts/Model/AssociationSpec.php +++ b/codegen/Crm/Contacts/Model/AssociationSpec.php @@ -2,7 +2,7 @@ /** * AssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/BatchInputSimplePublicObjectBatchInput.php b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInput.php index 7536134c..46f3c69f 100644 --- a/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInput.php +++ b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/BatchInputSimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInputForCreate.php index f63fd8a8..a05503e0 100644 --- a/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/BatchInputSimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInputUpsert.php index a901bf33..e9998edd 100644 --- a/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/BatchInputSimplePublicObjectId.php b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectId.php index 835586ee..8ec63750 100644 --- a/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectId.php +++ b/codegen/Crm/Contacts/Model/BatchInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/BatchReadInputSimplePublicObjectId.php b/codegen/Crm/Contacts/Model/BatchReadInputSimplePublicObjectId.php index d1c35a8c..7417874d 100644 --- a/codegen/Crm/Contacts/Model/BatchReadInputSimplePublicObjectId.php +++ b/codegen/Crm/Contacts/Model/BatchReadInputSimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * BatchReadInputSimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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\Contacts\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/Contacts/Model/BatchResponseSimplePublicObject.php b/codegen/Crm/Contacts/Model/BatchResponseSimplePublicObject.php index 5c446c9f..69d23b96 100644 --- a/codegen/Crm/Contacts/Model/BatchResponseSimplePublicObject.php +++ b/codegen/Crm/Contacts/Model/BatchResponseSimplePublicObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * BatchResponseSimplePublicObject Class Doc Comment * * @category Class + * @description A public object batch response object * @package HubSpot\Client\Crm\Contacts * @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\Contacts\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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/Contacts/Model/BatchResponseSimplePublicObjectWithErrors.php b/codegen/Crm/Contacts/Model/BatchResponseSimplePublicObjectWithErrors.php deleted file mode 100644 index 5eb2fd71..00000000 --- a/codegen/Crm/Contacts/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\Contacts\Model\SimplePublicObject[]', - 'errors' => '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Contacts\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\Contacts\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Contacts\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/Contacts/Model/BatchResponseSimplePublicUpsertObject.php b/codegen/Crm/Contacts/Model/BatchResponseSimplePublicUpsertObject.php index 2a64fbb5..11b699e7 100644 --- a/codegen/Crm/Contacts/Model/BatchResponseSimplePublicUpsertObject.php +++ b/codegen/Crm/Contacts/Model/BatchResponseSimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * BatchResponseSimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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\Contacts\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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/Contacts/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php b/codegen/Crm/Contacts/Model/BatchResponseSimplePublicUpsertObjectWithErrors.php deleted file mode 100644 index dec55d77..00000000 --- a/codegen/Crm/Contacts/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\Contacts\Model\SimplePublicUpsertObject[]', - 'errors' => '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\SimplePublicUpsertObject[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Contacts\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\Contacts\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Contacts\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/Contacts/Model/CollectionResponseAssociatedId.php b/codegen/Crm/Contacts/Model/CollectionResponseAssociatedId.php index e56a6d87..3ab5eadb 100644 --- a/codegen/Crm/Contacts/Model/CollectionResponseAssociatedId.php +++ b/codegen/Crm/Contacts/Model/CollectionResponseAssociatedId.php @@ -2,7 +2,7 @@ /** * CollectionResponseAssociatedId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php b/codegen/Crm/Contacts/Model/CollectionResponseSimplePublicObjectWithAssociations.php similarity index 82% rename from codegen/Crm/Contacts/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php rename to codegen/Crm/Contacts/Model/CollectionResponseSimplePublicObjectWithAssociations.php index 65c8e6ed..76105286 100644 --- a/codegen/Crm/Contacts/Model/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging.php +++ b/codegen/Crm/Contacts/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\Contacts\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Contacts\Model\Paging', 'results' => '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Contacts\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Contacts\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Contacts\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Contacts\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/Contacts/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php b/codegen/Crm/Contacts/Model/CollectionResponseWithTotalSimplePublicObject.php similarity index 79% rename from codegen/Crm/Contacts/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php rename to codegen/Crm/Contacts/Model/CollectionResponseWithTotalSimplePublicObject.php index 117c58f7..5264a217 100644 --- a/codegen/Crm/Contacts/Model/CollectionResponseWithTotalSimplePublicObjectForwardPaging.php +++ b/codegen/Crm/Contacts/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\Contacts\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Crm\Contacts\Model\SimplePublicObject[]' + 'paging' => '\HubSpot\Client\Crm\Contacts\Model\Paging', + 'results' => '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Contacts\Model\Paging|null */ public function getPaging() { @@ -349,7 +323,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Contacts\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Contacts\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/Contacts/Model/Error.php b/codegen/Crm/Contacts/Model/Error.php index 5e9e2e98..c5c6e73b 100644 --- a/codegen/Crm/Contacts/Model/Error.php +++ b/codegen/Crm/Contacts/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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/Contacts/Model/ErrorDetail.php b/codegen/Crm/Contacts/Model/ErrorDetail.php index b5f63dce..e318d11d 100644 --- a/codegen/Crm/Contacts/Model/ErrorDetail.php +++ b/codegen/Crm/Contacts/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/Filter.php b/codegen/Crm/Contacts/Model/Filter.php index c81e0ad2..20876a32 100644 --- a/codegen/Crm/Contacts/Model/Filter.php +++ b/codegen/Crm/Contacts/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/FilterGroup.php b/codegen/Crm/Contacts/Model/FilterGroup.php index 855d6d0e..4b659cd1 100644 --- a/codegen/Crm/Contacts/Model/FilterGroup.php +++ b/codegen/Crm/Contacts/Model/FilterGroup.php @@ -2,7 +2,7 @@ /** * FilterGroup * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/ForwardPaging.php b/codegen/Crm/Contacts/Model/ForwardPaging.php deleted file mode 100644 index 0c067eae..00000000 --- a/codegen/Crm/Contacts/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\Contacts\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\Contacts\Model\NextPage|null - */ - public function getNext() - { - return $this->container['next']; - } - - /** - * Sets next - * - * @param \HubSpot\Client\Crm\Contacts\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/Contacts/Model/ModelInterface.php b/codegen/Crm/Contacts/Model/ModelInterface.php index d3ccb82d..a2708941 100644 --- a/codegen/Crm/Contacts/Model/ModelInterface.php +++ b/codegen/Crm/Contacts/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts\Model @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** diff --git a/codegen/Crm/Contacts/Model/NextPage.php b/codegen/Crm/Contacts/Model/NextPage.php index 56b2b19b..67823dd0 100644 --- a/codegen/Crm/Contacts/Model/NextPage.php +++ b/codegen/Crm/Contacts/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/Paging.php b/codegen/Crm/Contacts/Model/Paging.php index c20a473d..3d03a29c 100644 --- a/codegen/Crm/Contacts/Model/Paging.php +++ b/codegen/Crm/Contacts/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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/Contacts/Model/PreviousPage.php b/codegen/Crm/Contacts/Model/PreviousPage.php index 9ef6be71..f4294da3 100644 --- a/codegen/Crm/Contacts/Model/PreviousPage.php +++ b/codegen/Crm/Contacts/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/PublicAssociationsForObject.php b/codegen/Crm/Contacts/Model/PublicAssociationsForObject.php index a320d285..831af5a3 100644 --- a/codegen/Crm/Contacts/Model/PublicAssociationsForObject.php +++ b/codegen/Crm/Contacts/Model/PublicAssociationsForObject.php @@ -2,7 +2,7 @@ /** * PublicAssociationsForObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,8 +57,8 @@ class PublicAssociationsForObject implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'types' => '\HubSpot\Client\Crm\Contacts\Model\AssociationSpec[]', - 'to' => '\HubSpot\Client\Crm\Contacts\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Contacts\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Contacts\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\Contacts\Model\AssociationSpec[] + * @return \HubSpot\Client\Crm\Contacts\Model\PublicObjectId */ - public function getTypes() + public function getTo() { - return $this->container['types']; + return $this->container['to']; } /** - * Sets types + * Sets to * - * @param \HubSpot\Client\Crm\Contacts\Model\AssociationSpec[] $types types + * @param \HubSpot\Client\Crm\Contacts\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\Contacts\Model\PublicObjectId + * @return \HubSpot\Client\Crm\Contacts\Model\AssociationSpec[] */ - public function getTo() + public function getTypes() { - return $this->container['to']; + return $this->container['types']; } /** - * Sets to + * Sets types * - * @param \HubSpot\Client\Crm\Contacts\Model\PublicObjectId $to to + * @param \HubSpot\Client\Crm\Contacts\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/Contacts/Model/PublicGdprDeleteInput.php b/codegen/Crm/Contacts/Model/PublicGdprDeleteInput.php index db9fa954..5606015a 100644 --- a/codegen/Crm/Contacts/Model/PublicGdprDeleteInput.php +++ b/codegen/Crm/Contacts/Model/PublicGdprDeleteInput.php @@ -2,7 +2,7 @@ /** * PublicGdprDeleteInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * PublicGdprDeleteInput Class Doc Comment * * @category Class + * @description An input that contains the information required to process a public GDPR data deletion request. * @package HubSpot\Client\Crm\Contacts * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -355,11 +356,11 @@ public function setObjectId($object_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]); } @@ -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/Contacts/Model/PublicMergeInput.php b/codegen/Crm/Contacts/Model/PublicMergeInput.php index a47e40ce..9abed60a 100644 --- a/codegen/Crm/Contacts/Model/PublicMergeInput.php +++ b/codegen/Crm/Contacts/Model/PublicMergeInput.php @@ -2,7 +2,7 @@ /** * PublicMergeInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * PublicMergeInput Class Doc Comment * * @category Class + * @description Input data for merging two records. * @package HubSpot\Client\Crm\Contacts * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -315,7 +316,7 @@ public function getObjectIdToMerge() /** * Sets object_id_to_merge * - * @param string $object_id_to_merge object_id_to_merge + * @param string $object_id_to_merge The object ID of the record that the merge will not set as the current value after the merge. * * @return self */ @@ -342,7 +343,7 @@ public function getPrimaryObjectId() /** * Sets primary_object_id * - * @param string $primary_object_id primary_object_id + * @param string $primary_object_id The object ID of the record that the merge will generally set as the current value after the merge. * * @return self */ @@ -358,11 +359,11 @@ public function setPrimaryObjectId($primary_object_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]); } @@ -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/Contacts/Model/PublicObjectId.php b/codegen/Crm/Contacts/Model/PublicObjectId.php index 76745247..0e3072e4 100644 --- a/codegen/Crm/Contacts/Model/PublicObjectId.php +++ b/codegen/Crm/Contacts/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Contacts * @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/Contacts/Model/PublicObjectSearchRequest.php b/codegen/Crm/Contacts/Model/PublicObjectSearchRequest.php index f6eb940b..d14c8875 100644 --- a/codegen/Crm/Contacts/Model/PublicObjectSearchRequest.php +++ b/codegen/Crm/Contacts/Model/PublicObjectSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicObjectSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectSearchRequest Class Doc Comment * * @category Class + * @description Describes a search request * @package HubSpot\Client\Crm\Contacts * @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\Contacts\Model\FilterGroup[]', + 'limit' => 'int', 'properties' => 'string[]', - 'filter_groups' => '\HubSpot\Client\Crm\Contacts\Model\FilterGroup[]' + 'query' => 'string', + 'sorts' => 'string[]' ]; /** @@ -73,12 +74,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null, - 'limit' => 'int32', 'after' => null, - 'sorts' => null, + 'filter_groups' => null, + 'limit' => 'int32', 'properties' => null, - 'filter_groups' => null + 'query' => null, + 'sorts' => null ]; /** @@ -87,12 +88,12 @@ class PublicObjectSearchRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'query' => false, - 'limit' => false, 'after' => false, - 'sorts' => false, + 'filter_groups' => false, + 'limit' => false, 'properties' => false, - 'filter_groups' => false + 'query' => false, + 'sorts' => false ]; /** @@ -181,12 +182,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'query' => 'query', - 'limit' => 'limit', 'after' => 'after', - 'sorts' => 'sorts', + 'filter_groups' => 'filterGroups', + 'limit' => 'limit', 'properties' => 'properties', - 'filter_groups' => 'filterGroups' + 'query' => 'query', + 'sorts' => 'sorts' ]; /** @@ -195,12 +196,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'query' => 'setQuery', - 'limit' => 'setLimit', 'after' => 'setAfter', - 'sorts' => 'setSorts', + 'filter_groups' => 'setFilterGroups', + 'limit' => 'setLimit', 'properties' => 'setProperties', - 'filter_groups' => 'setFilterGroups' + 'query' => 'setQuery', + 'sorts' => 'setSorts' ]; /** @@ -209,12 +210,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'query' => 'getQuery', - 'limit' => 'getLimit', 'after' => 'getAfter', - 'sorts' => 'getSorts', + 'filter_groups' => 'getFilterGroups', + 'limit' => 'getLimit', 'properties' => 'getProperties', - 'filter_groups' => 'getFilterGroups' + 'query' => 'getQuery', + 'sorts' => 'getSorts' ]; /** @@ -274,12 +275,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('query', $data ?? [], null); - $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); - $this->setIfExists('sorts', $data ?? [], null); - $this->setIfExists('properties', $data ?? [], null); $this->setIfExists('filter_groups', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('sorts', $data ?? [], null); } /** @@ -309,6 +310,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['after'] === null) { + $invalidProperties[] = "'after' can't be null"; + } + if ($this->container['filter_groups'] === null) { + $invalidProperties[] = "'filter_groups' can't be null"; + } + if ($this->container['limit'] === null) { + $invalidProperties[] = "'limit' can't be null"; + } + if ($this->container['properties'] === null) { + $invalidProperties[] = "'properties' can't be null"; + } + if ($this->container['sorts'] === null) { + $invalidProperties[] = "'sorts' can't be null"; + } return $invalidProperties; } @@ -325,174 +341,174 @@ public function valid() /** - * Gets query + * Gets after * - * @return string|null + * @return string */ - public function getQuery() + public function getAfter() { - return $this->container['query']; + return $this->container['after']; } /** - * Sets query + * Sets after * - * @param string|null $query query + * @param string $after A paging cursor token for retrieving subsequent pages. * * @return self */ - public function setQuery($query) + public function setAfter($after) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['query'] = $query; + $this->container['after'] = $after; return $this; } /** - * Gets limit + * Gets filter_groups * - * @return int|null + * @return \HubSpot\Client\Crm\Contacts\Model\FilterGroup[] */ - public function getLimit() + public function getFilterGroups() { - return $this->container['limit']; + return $this->container['filter_groups']; } /** - * Sets limit + * Sets filter_groups * - * @param int|null $limit limit + * @param \HubSpot\Client\Crm\Contacts\Model\FilterGroup[] $filter_groups Up to 6 groups of filters defining additional query criteria. * * @return self */ - public function setLimit($limit) + public function setFilterGroups($filter_groups) { - if (is_null($limit)) { - throw new \InvalidArgumentException('non-nullable limit cannot be null'); + if (is_null($filter_groups)) { + throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); } - $this->container['limit'] = $limit; + $this->container['filter_groups'] = $filter_groups; return $this; } /** - * Gets after + * Gets limit * - * @return string|null + * @return int */ - public function getAfter() + public function getLimit() { - return $this->container['after']; + return $this->container['limit']; } /** - * Sets after + * Sets limit * - * @param string|null $after after + * @param int $limit The maximum results to return, up to 200 objects. * * @return self */ - public function setAfter($after) + public function setLimit($limit) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); } - $this->container['after'] = $after; + $this->container['limit'] = $limit; return $this; } /** - * Gets sorts + * Gets properties * - * @return string[]|null + * @return string[] */ - public function getSorts() + public function getProperties() { - return $this->container['sorts']; + return $this->container['properties']; } /** - * Sets sorts + * Sets properties * - * @param string[]|null $sorts sorts + * @param string[] $properties A list of property names to include in the response. * * @return self */ - public function setSorts($sorts) + public function setProperties($properties) { - if (is_null($sorts)) { - throw new \InvalidArgumentException('non-nullable sorts cannot be null'); + if (is_null($properties)) { + throw new \InvalidArgumentException('non-nullable properties cannot be null'); } - $this->container['sorts'] = $sorts; + $this->container['properties'] = $properties; return $this; } /** - * Gets properties + * Gets query * - * @return string[]|null + * @return string|null */ - public function getProperties() + public function getQuery() { - return $this->container['properties']; + return $this->container['query']; } /** - * Sets properties + * Sets query * - * @param string[]|null $properties properties + * @param string|null $query The search query string, up to 3000 characters. * * @return self */ - public function setProperties($properties) + public function setQuery($query) { - if (is_null($properties)) { - throw new \InvalidArgumentException('non-nullable properties cannot be null'); + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); } - $this->container['properties'] = $properties; + $this->container['query'] = $query; return $this; } /** - * Gets filter_groups + * Gets sorts * - * @return \HubSpot\Client\Crm\Contacts\Model\FilterGroup[]|null + * @return string[] */ - public function getFilterGroups() + public function getSorts() { - return $this->container['filter_groups']; + return $this->container['sorts']; } /** - * Sets filter_groups + * Sets sorts * - * @param \HubSpot\Client\Crm\Contacts\Model\FilterGroup[]|null $filter_groups filter_groups + * @param string[] $sorts Specifies sorting order based on object properties. * * @return self */ - public function setFilterGroups($filter_groups) + public function setSorts($sorts) { - if (is_null($filter_groups)) { - throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); + if (is_null($sorts)) { + throw new \InvalidArgumentException('non-nullable sorts cannot be null'); } - $this->container['filter_groups'] = $filter_groups; + $this->container['sorts'] = $sorts; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -500,12 +516,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -530,11 +546,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Contacts/Model/SimplePublicObject.php b/codegen/Crm/Contacts/Model/SimplePublicObject.php index 7e04dd7f..8a4b4431 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObject.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObject Class Doc Comment * * @category Class + * @description A simple public object. * @package HubSpot\Client\Crm\Contacts * @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/Contacts/Model/SimplePublicObjectBatchInput.php b/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInput.php index 5adec3da..be378b6a 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInput.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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 of the contact to update. 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 of the contact to update. 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/Contacts/Model/SimplePublicObjectBatchInputForCreate.php b/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInputForCreate.php index 8010972f..01565480 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInputForCreate.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/SimplePublicObjectBatchInputUpsert.php b/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInputUpsert.php index e036c1de..6b40539e 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInputUpsert.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectBatchInputUpsert.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectBatchInputUpsert * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/SimplePublicObjectId.php b/codegen/Crm/Contacts/Model/SimplePublicObjectId.php index 33bb9802..48679f5b 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectId.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectId.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObjectId Class Doc Comment * * @category Class + * @description Contains the Id of a Public Object * @package HubSpot\Client\Crm\Contacts * @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/Contacts/Model/SimplePublicObjectInput.php b/codegen/Crm/Contacts/Model/SimplePublicObjectInput.php index 437c9426..71f422ff 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectInput.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectInput.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/SimplePublicObjectInputForCreate.php b/codegen/Crm/Contacts/Model/SimplePublicObjectInputForCreate.php index e0ddde7f..0a5e7dc6 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectInputForCreate.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectInputForCreate.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectInputForCreate * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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/Contacts/Model/SimplePublicObjectWithAssociations.php b/codegen/Crm/Contacts/Model/SimplePublicObjectWithAssociations.php index f2981d94..9e74fbb4 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicObjectWithAssociations.php +++ b/codegen/Crm/Contacts/Model/SimplePublicObjectWithAssociations.php @@ -2,7 +2,7 @@ /** * SimplePublicObjectWithAssociations * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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 + * @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 + * @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 + * @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/Contacts/Model/SimplePublicUpsertObject.php b/codegen/Crm/Contacts/Model/SimplePublicUpsertObject.php index 4c9c4201..375ee3ca 100644 --- a/codegen/Crm/Contacts/Model/SimplePublicUpsertObject.php +++ b/codegen/Crm/Contacts/Model/SimplePublicUpsertObject.php @@ -2,7 +2,7 @@ /** * SimplePublicUpsertObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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\Contacts * @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 for tracing the creation request. * * @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/Contacts/Model/StandardError.php b/codegen/Crm/Contacts/Model/StandardError.php index 89f51c17..ea086707 100644 --- a/codegen/Crm/Contacts/Model/StandardError.php +++ b/codegen/Crm/Contacts/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Contacts * @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\Contacts\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Contacts\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\Contacts\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\Contacts\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\Contacts\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\Contacts\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/Contacts/Model/ValueWithTimestamp.php b/codegen/Crm/Contacts/Model/ValueWithTimestamp.php index 427fa73a..4fc8f456 100644 --- a/codegen/Crm/Contacts/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Contacts/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -35,6 +35,7 @@ * ValueWithTimestamp Class Doc Comment * * @category Class + * @description Property model that includes timestamp. * @package HubSpot\Client\Crm\Contacts * @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/Contacts/ObjectSerializer.php b/codegen/Crm/Contacts/ObjectSerializer.php index 99bc90be..75d539b9 100644 --- a/codegen/Crm/Contacts/ObjectSerializer.php +++ b/codegen/Crm/Contacts/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Contacts @@ -13,11 +13,11 @@ /** * Contacts * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body. * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.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) : ''; } }