From 1085490d1c647645b01c7c5f0da5c8f9bfa825cf Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 2 Apr 2026 16:57:26 +0300 Subject: [PATCH 1/2] Codegen: CRM Associations V4 --- codegen/Crm/Associations/V4/Api/BasicApi.php | 32 +- codegen/Crm/Associations/V4/Api/BatchApi.php | 220 ++---- codegen/Crm/Associations/V4/Api/ReportApi.php | 8 +- .../BatchResponseLabelsBetweenObjectPair.php | 68 -- ...onseLabelsBetweenObjectPairWithErrors.php} | 26 +- ...esponsePublicAssociationMultiWithLabel.php | 68 -- ...licAssociationMultiWithLabelWithErrors.php | 697 ++++++++++++++++++ .../Associations/V4/Model/StandardError.php | 2 +- 8 files changed, 799 insertions(+), 322 deletions(-) rename codegen/Crm/Associations/V4/Model/{BatchResponseVoid.php => BatchResponseLabelsBetweenObjectPairWithErrors.php} (94%) create mode 100644 codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php diff --git a/codegen/Crm/Associations/V4/Api/BasicApi.php b/codegen/Crm/Associations/V4/Api/BasicApi.php index f50a0de5..172336e9 100644 --- a/codegen/Crm/Associations/V4/Api/BasicApi.php +++ b/codegen/Crm/Associations/V4/Api/BasicApi.php @@ -137,7 +137,7 @@ public function getConfig() /** * Operation archive * - * Delete + * Delete associations between two records * * @param string $object_type object_type (required) * @param string $object_id object_id (required) @@ -157,7 +157,7 @@ public function archive($object_type, $object_id, $to_object_type, $to_object_id /** * Operation archiveWithHttpInfo * - * Delete + * Delete associations between two records * * @param string $object_type (required) * @param string $object_id (required) @@ -217,7 +217,7 @@ public function archiveWithHttpInfo($object_type, $object_id, $to_object_type, $ /** * Operation archiveAsync * - * Delete + * Delete associations between two records * * @param string $object_type (required) * @param string $object_id (required) @@ -241,7 +241,7 @@ function ($response) { /** * Operation archiveAsyncWithHttpInfo * - * Delete + * Delete associations between two records * * @param string $object_type (required) * @param string $object_id (required) @@ -427,7 +427,7 @@ public function archiveRequest($object_type, $object_id, $to_object_type, $to_ob /** * Operation create * - * Create + * Associate records (labelled) * * @param string $object_type object_type (required) * @param string $object_id object_id (required) @@ -449,7 +449,7 @@ public function create($object_type, $object_id, $to_object_type, $to_object_id, /** * Operation createWithHttpInfo * - * Create + * Associate records (labelled) * * @param string $object_type (required) * @param string $object_id (required) @@ -552,7 +552,7 @@ public function createWithHttpInfo($object_type, $object_id, $to_object_type, $t /** * Operation createAsync * - * Create + * Associate records (labelled) * * @param string $object_type (required) * @param string $object_id (required) @@ -577,7 +577,7 @@ function ($response) { /** * Operation createAsyncWithHttpInfo * - * Create + * Associate records (labelled) * * @param string $object_type (required) * @param string $object_id (required) @@ -792,7 +792,7 @@ public function createRequest($object_type, $object_id, $to_object_type, $to_obj /** * Operation createDefault * - * Create Default + * Associate records (default) * * @param string $from_object_type from_object_type (required) * @param string $from_object_id from_object_id (required) @@ -813,7 +813,7 @@ public function createDefault($from_object_type, $from_object_id, $to_object_typ /** * Operation createDefaultWithHttpInfo * - * Create Default + * Associate records (default) * * @param string $from_object_type (required) * @param string $from_object_id (required) @@ -915,7 +915,7 @@ public function createDefaultWithHttpInfo($from_object_type, $from_object_id, $t /** * Operation createDefaultAsync * - * Create Default + * Associate records (default) * * @param string $from_object_type (required) * @param string $from_object_id (required) @@ -939,7 +939,7 @@ function ($response) { /** * Operation createDefaultAsyncWithHttpInfo * - * Create Default + * Associate records (default) * * @param string $from_object_type (required) * @param string $from_object_id (required) @@ -1138,7 +1138,7 @@ public function createDefaultRequest($from_object_type, $from_object_id, $to_obj /** * Operation getPage * - * List + * Retrieve all associations by object type * * @param string $object_type object_type (required) * @param string $object_id object_id (required) @@ -1160,7 +1160,7 @@ public function getPage($object_type, $object_id, $to_object_type, $after = null /** * Operation getPageWithHttpInfo * - * List + * Retrieve all associations by object type * * @param string $object_type (required) * @param string $object_id (required) @@ -1263,7 +1263,7 @@ public function getPageWithHttpInfo($object_type, $object_id, $to_object_type, $ /** * Operation getPageAsync * - * List + * Retrieve all associations by object type * * @param string $object_type (required) * @param string $object_id (required) @@ -1288,7 +1288,7 @@ function ($response) { /** * Operation getPageAsyncWithHttpInfo * - * List + * Retrieve all associations by object type * * @param string $object_type (required) * @param string $object_id (required) diff --git a/codegen/Crm/Associations/V4/Api/BatchApi.php b/codegen/Crm/Associations/V4/Api/BatchApi.php index e3a3796a..c93d01ba 100644 --- a/codegen/Crm/Associations/V4/Api/BatchApi.php +++ b/codegen/Crm/Associations/V4/Api/BatchApi.php @@ -140,7 +140,7 @@ public function getConfig() /** * Operation archive * - * Delete + * Remove associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -149,18 +149,17 @@ public function getConfig() * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return void */ public function archive($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, string $contentType = self::contentTypes['archive'][0]) { - list($response) = $this->archiveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, $contentType); - return $response; + $this->archiveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, $contentType); } /** * Operation archiveWithHttpInfo * - * Delete + * Remove associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -169,7 +168,7 @@ public function archive($from_object_type, $to_object_type, $batch_input_public_ * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, string $contentType = self::contentTypes['archive'][0]) { @@ -198,51 +197,9 @@ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_i $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - return $this->handleResponseWithDataType( - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid', - $request, - $response, - ); - default: - return $this->handleResponseWithDataType( - '\HubSpot\Client\Crm\Associations\V4\Model\Error', - $request, - $response, - ); - } - - - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return $this->handleResponseWithDataType( - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid', - $request, - $response, - ); + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -261,7 +218,7 @@ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_i /** * Operation archiveAsync * - * Delete + * Remove associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -284,7 +241,7 @@ function ($response) { /** * Operation archiveAsyncWithHttpInfo * - * Delete + * Remove associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -296,27 +253,14 @@ function ($response) { */ public function archiveAsyncWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, string $contentType = self::contentTypes['archive'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid'; + $returnType = ''; $request = $this->archiveRequest($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -399,7 +343,7 @@ public function archiveRequest($from_object_type, $to_object_type, $batch_input_ $headers = $this->headerSelector->selectHeaders( - ['application/json', '*/*', ], + ['*/*', ], $contentType, $multipart ); @@ -465,7 +409,7 @@ public function archiveRequest($from_object_type, $to_object_type, $batch_input_ /** * Operation archiveLabels * - * Delete Specific Labels + * Delete specific labels * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -474,18 +418,17 @@ public function archiveRequest($from_object_type, $to_object_type, $batch_input_ * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return void */ public function archiveLabels($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['archiveLabels'][0]) { - list($response) = $this->archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, $contentType); - return $response; + $this->archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, $contentType); } /** * Operation archiveLabelsWithHttpInfo * - * Delete Specific Labels + * Delete specific labels * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -494,7 +437,7 @@ public function archiveLabels($from_object_type, $to_object_type, $batch_input_p * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['archiveLabels'][0]) { @@ -523,51 +466,9 @@ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $b $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - return $this->handleResponseWithDataType( - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid', - $request, - $response, - ); - default: - return $this->handleResponseWithDataType( - '\HubSpot\Client\Crm\Associations\V4\Model\Error', - $request, - $response, - ); - } - - - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - return $this->handleResponseWithDataType( - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid', - $request, - $response, - ); + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -586,7 +487,7 @@ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $b /** * Operation archiveLabelsAsync * - * Delete Specific Labels + * Delete specific labels * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -609,7 +510,7 @@ function ($response) { /** * Operation archiveLabelsAsyncWithHttpInfo * - * Delete Specific Labels + * Delete specific labels * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -621,27 +522,14 @@ function ($response) { */ public function archiveLabelsAsyncWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['archiveLabels'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid'; + $returnType = ''; $request = $this->archiveLabelsRequest($from_object_type, $to_object_type, $batch_input_public_association_multi_post, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -724,7 +612,7 @@ public function archiveLabelsRequest($from_object_type, $to_object_type, $batch_ $headers = $this->headerSelector->selectHeaders( - ['application/json', '*/*', ], + ['*/*', ], $contentType, $multipart ); @@ -790,7 +678,7 @@ public function archiveLabelsRequest($from_object_type, $to_object_type, $batch_ /** * Operation create * - * Create + * Associate records (labelled) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -799,7 +687,7 @@ public function archiveLabelsRequest($from_object_type, $to_object_type, $batch_ * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors|\HubSpot\Client\Crm\Associations\V4\Model\Error */ public function create($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['create'][0]) { @@ -810,7 +698,7 @@ public function create($from_object_type, $to_object_type, $batch_input_public_a /** * Operation createWithHttpInfo * - * Create + * Associate records (labelled) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -819,7 +707,7 @@ public function create($from_object_type, $to_object_type, $batch_input_public_a * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['create'][0]) { @@ -849,12 +737,18 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in switch($statusCode) { - case 200: + case 201: return $this->handleResponseWithDataType( '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair', $request, $response, ); + case 207: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors', + $request, + $response, + ); default: return $this->handleResponseWithDataType( '\HubSpot\Client\Crm\Associations\V4\Model\Error', @@ -885,7 +779,7 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in ); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair', @@ -893,6 +787,14 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in ); $e->setResponseObject($data); throw $e; + case 207: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -911,7 +813,7 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in /** * Operation createAsync * - * Create + * Associate records (labelled) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -934,7 +836,7 @@ function ($response) { /** * Operation createAsyncWithHttpInfo * - * Create + * Associate records (labelled) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1115,7 +1017,7 @@ public function createRequest($from_object_type, $to_object_type, $batch_input_p /** * Operation createDefault * - * Create Default Associations + * Associate records (default) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1135,7 +1037,7 @@ public function createDefault($from_object_type, $to_object_type, $batch_input_p /** * Operation createDefaultWithHttpInfo * - * Create Default Associations + * Associate records (default) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1236,7 +1138,7 @@ public function createDefaultWithHttpInfo($from_object_type, $to_object_type, $b /** * Operation createDefaultAsync * - * Create Default Associations + * Associate records (default) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1259,7 +1161,7 @@ function ($response) { /** * Operation createDefaultAsyncWithHttpInfo * - * Create Default Associations + * Associate records (default) * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1440,7 +1342,7 @@ public function createDefaultRequest($from_object_type, $to_object_type, $batch_ /** * Operation getPage * - * Read + * Retrieve associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1449,7 +1351,7 @@ public function createDefaultRequest($from_object_type, $to_object_type, $batch_ * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel|\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors|\HubSpot\Client\Crm\Associations\V4\Model\Error */ public function getPage($from_object_type, $to_object_type, $batch_input_public_fetch_associations_batch_request, string $contentType = self::contentTypes['getPage'][0]) { @@ -1460,7 +1362,7 @@ public function getPage($from_object_type, $to_object_type, $batch_input_public_ /** * Operation getPageWithHttpInfo * - * Read + * Retrieve associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1469,7 +1371,7 @@ public function getPage($from_object_type, $to_object_type, $batch_input_public_ * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel|\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_fetch_associations_batch_request, string $contentType = self::contentTypes['getPage'][0]) { @@ -1505,6 +1407,12 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i $request, $response, ); + case 207: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors', + $request, + $response, + ); default: return $this->handleResponseWithDataType( '\HubSpot\Client\Crm\Associations\V4\Model\Error', @@ -1543,6 +1451,14 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i ); $e->setResponseObject($data); throw $e; + case 207: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1561,7 +1477,7 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i /** * Operation getPageAsync * - * Read + * Retrieve associations * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1584,7 +1500,7 @@ function ($response) { /** * Operation getPageAsyncWithHttpInfo * - * Read + * Retrieve associations * * @param string $from_object_type (required) * @param string $to_object_type (required) diff --git a/codegen/Crm/Associations/V4/Api/ReportApi.php b/codegen/Crm/Associations/V4/Api/ReportApi.php index 43c79e5a..c0da4fae 100644 --- a/codegen/Crm/Associations/V4/Api/ReportApi.php +++ b/codegen/Crm/Associations/V4/Api/ReportApi.php @@ -128,7 +128,7 @@ public function getConfig() /** * Operation request * - * Report + * Report high usage * * @param int $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation @@ -146,7 +146,7 @@ public function request($user_id, string $contentType = self::contentTypes['requ /** * Operation requestWithHttpInfo * - * Report + * Report high usage * * @param int $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation @@ -245,7 +245,7 @@ public function requestWithHttpInfo($user_id, string $contentType = self::conten /** * Operation requestAsync * - * Report + * Report high usage * * @param int $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation @@ -266,7 +266,7 @@ function ($response) { /** * Operation requestAsyncWithHttpInfo * - * Report + * Report high usage * * @param int $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation diff --git a/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php b/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php index e6840913..746e55ba 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php @@ -58,9 +58,7 @@ class BatchResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAcces */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', 'links' => 'array', - 'num_errors' => 'int', 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[]', 'started_at' => '\DateTime', @@ -76,9 +74,7 @@ class BatchResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAcces */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'errors' => null, 'links' => null, - 'num_errors' => 'int32', 'requested_at' => 'date-time', 'results' => null, 'started_at' => 'date-time', @@ -92,9 +88,7 @@ class BatchResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAcces */ protected static array $openAPINullables = [ 'completed_at' => false, - 'errors' => false, 'links' => false, - 'num_errors' => false, 'requested_at' => false, 'results' => false, 'started_at' => false, @@ -188,9 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'errors' => 'errors', 'links' => 'links', - 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', 'results' => 'results', 'started_at' => 'startedAt', @@ -204,9 +196,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'errors' => 'setErrors', 'links' => 'setLinks', - 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', 'results' => 'setResults', 'started_at' => 'setStartedAt', @@ -220,9 +210,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'errors' => 'getErrors', 'links' => 'getLinks', - 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', 'results' => 'getResults', 'started_at' => 'getStartedAt', @@ -306,9 +294,7 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_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); @@ -405,33 +391,6 @@ public function setCompletedAt($completed_at) return $this; } - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Associations\V4\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 links * @@ -459,33 +418,6 @@ public function setLinks($links) return $this; } - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors The number of errors encountered during the batch processing. - * - * @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 * diff --git a/codegen/Crm/Associations/V4/Model/BatchResponseVoid.php b/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPairWithErrors.php similarity index 94% rename from codegen/Crm/Associations/V4/Model/BatchResponseVoid.php rename to codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPairWithErrors.php index 0c4e00a0..b4b5b0b5 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponseVoid.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPairWithErrors.php @@ -1,6 +1,6 @@ */ -class BatchResponseVoid implements ModelInterface, ArrayAccess, \JsonSerializable +class BatchResponseLabelsBetweenObjectPairWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class BatchResponseVoid implements ModelInterface, ArrayAccess, \JsonSerializabl * * @var string */ - protected static $openAPIModelName = 'BatchResponseVoid'; + protected static $openAPIModelName = 'BatchResponseLabelsBetweenObjectPairWithErrors'; /** * Array of property to type mappings. Used for (de)serialization @@ -62,7 +62,7 @@ class BatchResponseVoid implements ModelInterface, ArrayAccess, \JsonSerializabl 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', - 'results' => 'mixed[]', + 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[]', 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -391,7 +391,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at Time operation completed + * @param \DateTime $completed_at completed_at * * @return self */ @@ -445,7 +445,7 @@ public function getLinks() /** * Sets links * - * @param array|null $links An object containing relevant links related to the batch request. + * @param array|null $links links * * @return self */ @@ -472,7 +472,7 @@ public function getNumErrors() /** * Sets num_errors * - * @param int|null $num_errors The number of errors encountered during the batch processing. + * @param int|null $num_errors num_errors * * @return self */ @@ -499,7 +499,7 @@ public function getRequestedAt() /** * Sets requested_at * - * @param \DateTime|null $requested_at The timestamp when the batch request was initially made, in ISO 8601 format. + * @param \DateTime|null $requested_at requested_at * * @return self */ @@ -516,7 +516,7 @@ public function setRequestedAt($requested_at) /** * Gets results * - * @return mixed[] + * @return \HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[] */ public function getResults() { @@ -526,7 +526,7 @@ public function getResults() /** * Sets results * - * @param mixed[] $results results + * @param \HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[] $results results * * @return self */ @@ -553,7 +553,7 @@ public function getStartedAt() /** * Sets started_at * - * @param \DateTime $started_at The timestamp when the batch processing began, in ISO 8601 format. + * @param \DateTime $started_at started_at * * @return self */ @@ -580,7 +580,7 @@ public function getStatus() /** * Sets status * - * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELED\", or \"COMPLETE\". + * @param string $status status * * @return self */ diff --git a/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php index 810180b3..b7b6c0b6 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php @@ -58,9 +58,7 @@ class BatchResponsePublicAssociationMultiWithLabel implements ModelInterface, Ar */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', 'links' => 'array', - 'num_errors' => 'int', 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicAssociationMultiWithLabel[]', 'started_at' => '\DateTime', @@ -76,9 +74,7 @@ class BatchResponsePublicAssociationMultiWithLabel implements ModelInterface, Ar */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'errors' => null, 'links' => null, - 'num_errors' => 'int32', 'requested_at' => 'date-time', 'results' => null, 'started_at' => 'date-time', @@ -92,9 +88,7 @@ class BatchResponsePublicAssociationMultiWithLabel implements ModelInterface, Ar */ protected static array $openAPINullables = [ 'completed_at' => false, - 'errors' => false, 'links' => false, - 'num_errors' => false, 'requested_at' => false, 'results' => false, 'started_at' => false, @@ -188,9 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'errors' => 'errors', 'links' => 'links', - 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', 'results' => 'results', 'started_at' => 'startedAt', @@ -204,9 +196,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'errors' => 'setErrors', 'links' => 'setLinks', - 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', 'results' => 'setResults', 'started_at' => 'setStartedAt', @@ -220,9 +210,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'errors' => 'getErrors', 'links' => 'getLinks', - 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', 'results' => 'getResults', 'started_at' => 'getStartedAt', @@ -306,9 +294,7 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_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); @@ -405,33 +391,6 @@ public function setCompletedAt($completed_at) return $this; } - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Associations\V4\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 links * @@ -459,33 +418,6 @@ public function setLinks($links) return $this; } - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors The number of errors encountered during the batch processing. - * - * @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 * diff --git a/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php new file mode 100644 index 00000000..bebbfbbb --- /dev/null +++ b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php @@ -0,0 +1,697 @@ + + */ +class BatchResponsePublicAssociationMultiWithLabelWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BatchResponsePublicAssociationMultiWithLabelWithErrors'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', + 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', + 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicAssociationMultiWithLabel[]', + 'started_at' => '\DateTime', + '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', + 'errors' => null, + 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', + 'results' => null, + 'started_at' => 'date-time', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'completed_at' => false, + 'errors' => false, + 'links' => false, + 'num_errors' => false, + 'requested_at' => false, + 'results' => false, + 'started_at' => 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', + 'errors' => 'errors', + 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', + 'results' => 'results', + 'started_at' => 'startedAt', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', + 'results' => 'setResults', + 'started_at' => 'setStartedAt', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', + 'results' => 'getResults', + 'started_at' => 'getStartedAt', + '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_CANCELED = 'CANCELED'; + public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_CANCELED, + self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, + ]; + } + + /** + * 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('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); + } + + /** + * 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['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"; + } + $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 errors + * + * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Associations\V4\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 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 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 results + * + * @return \HubSpot\Client\Crm\Associations\V4\Model\PublicAssociationMultiWithLabel[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \HubSpot\Client\Crm\Associations\V4\Model\PublicAssociationMultiWithLabel[] $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 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 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|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $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|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $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/Associations/V4/Model/StandardError.php b/codegen/Crm/Associations/V4/Model/StandardError.php index da0fa9dd..749395d0 100644 --- a/codegen/Crm/Associations/V4/Model/StandardError.php +++ b/codegen/Crm/Associations/V4/Model/StandardError.php @@ -35,7 +35,7 @@ * StandardError Class Doc Comment * * @category Class - * @description Ye olde error + * @description Represents a standard error response in the HubSpot API, providing detailed information about an error that occurred during an API request. * @package HubSpot\Client\Crm\Associations\V4 * @author OpenAPI Generator team * @link https://openapi-generator.tech From 439ef3e0af4bead74070adf6db6bafcd9f9159a4 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Thu, 2 Apr 2026 17:06:33 +0300 Subject: [PATCH 2/2] 14.0.5 --- CHANGELOG.md | 15 +++++++++++++-- composer.json | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6b85d7d..bc632c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/14.0.4...HEAD) +## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/14.0.5...HEAD) + +## [14.0.5](https://github.com/HubSpot/hubspot-api-php/releases/tag/14.0.5) - 2026-04-02 + +### CRM Associations V4 + +- Updated the return type of the response object in `crm()->associations()->v4()->batchApi()->archive()` and `archiveLabels()` to `void` instead of `BatchResponseVoid|Error`. The `BatchResponseVoid` model has been removed. +- `crm()->associations()->v4()->batchApi()->create()` now handles HTTP 207 (partial success) responses, returning new `BatchResponseLabelsBetweenObjectPairWithErrors` model. +- `crm()->associations()->v4()->batchApi()->getPage()` now handles HTTP 207 (partial success) responses, returning new `BatchResponsePublicAssociationMultiWithLabelWithErrors` model. +- `HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair` model no longer includes `errors` and `numErrors` fields — those are available on the new `HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors` model. +- Added new models: `HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors`, `HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors`. ## [14.0.4](https://github.com/HubSpot/hubspot-api-php/releases/tag/14.0.4) - 2026-03-24 @@ -1220,7 +1230,7 @@ to 25. getSubscriptions => getAll (webhooks()->subscriptionsApi()) 26. updateSubscription => update (webhooks()->subscriptionsApi()) -[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/14.0.4...HEAD +[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/14.0.5...HEAD [1.0.0-beta]: https://github.com/HubSpot/hubspot-api-php/releases/tag/v1.0.0-beta [1.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.1.0 [1.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.2.0 @@ -1291,3 +1301,4 @@ to [14.0.2]: https://github.com/HubSpot/hubspot-api-php/releases/tag/14.0.2 [14.0.3]: https://github.com/HubSpot/hubspot-api-php/releases/tag/14.0.3 [14.0.4]: https://github.com/HubSpot/hubspot-api-php/releases/tag/14.0.4 +[14.0.5]: https://github.com/HubSpot/hubspot-api-php/releases/tag/14.0.5 diff --git a/composer.json b/composer.json index 5a72137c..691575a7 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "hubspot/api-client", - "version": "14.0.4", + "version": "14.0.5", "description": "Hubspot API client", "keywords": [ "hubspot",