diff --git a/codegen/Crm/Associations/V4/Api/BasicApi.php b/codegen/Crm/Associations/V4/Api/BasicApi.php index 6dcc7883..a22fd51a 100644 --- a/codegen/Crm/Associations/V4/Api/BasicApi.php +++ b/codegen/Crm/Associations/V4/Api/BasicApi.php @@ -1,7 +1,7 @@ getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -204,8 +206,10 @@ public function archiveWithHttpInfo($object_type, $object_id, $to_object_type, $ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -215,10 +219,10 @@ public function archiveWithHttpInfo($object_type, $object_id, $to_object_type, $ * * Delete * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be deleted. (required) + * @param string $object_id The unique identifier for the source object in the association to be deleted. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be deleted. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be deleted. (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,10 +243,10 @@ function ($response) { * * Delete * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be deleted. (required) + * @param string $object_id The unique identifier for the source object in the association to be deleted. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be deleted. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be deleted. (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 @@ -279,10 +283,10 @@ function ($exception) { /** * Create request for operation 'archive' * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be deleted. (required) + * @param string $object_id The unique identifier for the source object in the association to be deleted. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be deleted. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be deleted. (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 @@ -425,16 +429,16 @@ public function archiveRequest($object_type, $object_id, $to_object_type, $to_ob * * Create * - * @param string $object_type object_type (required) - * @param string $object_id object_id (required) - * @param string $to_object_type to_object_type (required) - * @param string $to_object_id to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be created. (required) + * @param string $object_id The unique identifier for the source object in the association to be created. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be created. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be created. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $association_spec association_spec (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\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\LabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Model\CreatedResponseLabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\Error */ public function create($object_type, $object_id, $to_object_type, $to_object_id, $association_spec, string $contentType = self::contentTypes['create'][0]) { @@ -447,16 +451,16 @@ public function create($object_type, $object_id, $to_object_type, $to_object_id, * * Create * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be created. (required) + * @param string $object_id The unique identifier for the source object in the association to be created. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be created. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be created. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $association_spec (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\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\LabelsBetweenObjectPair|\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\CreatedResponseLabelsBetweenObjectPair|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($object_type, $object_id, $to_object_type, $to_object_id, $association_spec, string $contentType = self::contentTypes['create'][0]) { @@ -486,62 +490,22 @@ public function createWithHttpInfo($object_type, $object_id, $to_object_type, $t switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\CreatedResponseLabelsBetweenObjectPair', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -555,44 +519,21 @@ public function createWithHttpInfo($object_type, $object_id, $to_object_type, $t ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair'; - 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\Associations\V4\Model\CreatedResponseLabelsBetweenObjectPair', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair', + '\HubSpot\Client\Crm\Associations\V4\Model\CreatedResponseLabelsBetweenObjectPair', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -600,8 +541,10 @@ public function createWithHttpInfo($object_type, $object_id, $to_object_type, $t $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -611,10 +554,10 @@ public function createWithHttpInfo($object_type, $object_id, $to_object_type, $t * * Create * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be created. (required) + * @param string $object_id The unique identifier for the source object in the association to be created. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be created. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be created. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $association_spec (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * @@ -636,10 +579,10 @@ function ($response) { * * Create * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be created. (required) + * @param string $object_id The unique identifier for the source object in the association to be created. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be created. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be created. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $association_spec (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * @@ -648,7 +591,7 @@ function ($response) { */ public function createAsyncWithHttpInfo($object_type, $object_id, $to_object_type, $to_object_id, $association_spec, string $contentType = self::contentTypes['create'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair'; + $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\CreatedResponseLabelsBetweenObjectPair'; $request = $this->createRequest($object_type, $object_id, $to_object_type, $to_object_id, $association_spec, $contentType); return $this->client @@ -690,10 +633,10 @@ function ($exception) { /** * Create request for operation 'create' * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $object_type Specifies the type of the source object in the association to be created. (required) + * @param string $object_id The unique identifier for the source object in the association to be created. (required) + * @param string $to_object_type Specifies the type of the target object in the association to be created. (required) + * @param string $to_object_id The unique identifier for the target object in the association to be created. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $association_spec (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * @@ -851,10 +794,10 @@ public function createRequest($object_type, $object_id, $to_object_type, $to_obj * * Create Default * - * @param string $from_object_type from_object_type (required) - * @param string $from_object_id from_object_id (required) - * @param string $to_object_type to_object_type (required) - * @param string $to_object_id to_object_id (required) + * @param string $from_object_type The type of the source object in the association. (required) + * @param string $from_object_id The ID of the source object in the association. (required) + * @param string $to_object_type The type of the target object in the association. (required) + * @param string $to_object_id The ID of the target object in the association. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format @@ -872,10 +815,10 @@ public function createDefault($from_object_type, $from_object_id, $to_object_typ * * Create Default * - * @param string $from_object_type (required) - * @param string $from_object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $from_object_type The type of the source object in the association. (required) + * @param string $from_object_id The ID of the source object in the association. (required) + * @param string $to_object_type The type of the target object in the association. (required) + * @param string $to_object_id The ID of the target object in the association. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Associations\V4\ApiException on non-2xx response or if the response body is not in the expected format @@ -911,61 +854,21 @@ public function createDefaultWithHttpInfo($from_object_type, $from_object_id, $t switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -979,34 +882,11 @@ public function createDefaultWithHttpInfo($from_object_type, $from_object_id, $t ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation'; - 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\Associations\V4\Model\BatchResponsePublicDefaultAssociation', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1016,7 +896,7 @@ public function createDefaultWithHttpInfo($from_object_type, $from_object_id, $t $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1024,8 +904,10 @@ public function createDefaultWithHttpInfo($from_object_type, $from_object_id, $t $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1035,10 +917,10 @@ public function createDefaultWithHttpInfo($from_object_type, $from_object_id, $t * * Create Default * - * @param string $from_object_type (required) - * @param string $from_object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $from_object_type The type of the source object in the association. (required) + * @param string $from_object_id The ID of the source object in the association. (required) + * @param string $to_object_type The type of the target object in the association. (required) + * @param string $to_object_id The ID of the target object in the association. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1059,10 +941,10 @@ function ($response) { * * Create Default * - * @param string $from_object_type (required) - * @param string $from_object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $from_object_type The type of the source object in the association. (required) + * @param string $from_object_id The ID of the source object in the association. (required) + * @param string $to_object_type The type of the target object in the association. (required) + * @param string $to_object_id The ID of the target object in the association. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1112,10 +994,10 @@ function ($exception) { /** * Create request for operation 'createDefault' * - * @param string $from_object_type (required) - * @param string $from_object_id (required) - * @param string $to_object_type (required) - * @param string $to_object_id (required) + * @param string $from_object_type The type of the source object in the association. (required) + * @param string $from_object_id The ID of the source object in the association. (required) + * @param string $to_object_type The type of the target object in the association. (required) + * @param string $to_object_id The ID of the target object in the association. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1258,16 +1140,16 @@ public function createDefaultRequest($from_object_type, $from_object_id, $to_obj * * List * - * @param string $object_type object_type (required) - * @param string $object_id object_id (required) - * @param string $to_object_type to_object_type (required) + * @param string $object_type Specifies the type of the source object in the association. (required) + * @param string $object_id The unique identifier for the source object whose associations are being retrieved. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @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 int|null $limit The maximum number of results to display per page. (optional, default to 500) * @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\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\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabel|\HubSpot\Client\Crm\Associations\V4\Model\Error */ public function getPage($object_type, $object_id, $to_object_type, $after = null, $limit = 500, string $contentType = self::contentTypes['getPage'][0]) { @@ -1280,16 +1162,16 @@ public function getPage($object_type, $object_id, $to_object_type, $after = null * * List * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) + * @param string $object_type Specifies the type of the source object in the association. (required) + * @param string $object_id The unique identifier for the source object whose associations are being retrieved. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @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 int|null $limit The maximum number of results to display per page. (optional, default to 500) * @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\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\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging|\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\CollectionResponseMultiAssociatedObjectWithLabel|\HubSpot\Client\Crm\Associations\V4\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function getPageWithHttpInfo($object_type, $object_id, $to_object_type, $after = null, $limit = 500, string $contentType = self::contentTypes['getPage'][0]) { @@ -1320,61 +1202,21 @@ public function getPageWithHttpInfo($object_type, $object_id, $to_object_type, $ switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabel', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1388,44 +1230,21 @@ public function getPageWithHttpInfo($object_type, $object_id, $to_object_type, $ ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'; - 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\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabel', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging', + '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabel', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1433,8 +1252,10 @@ public function getPageWithHttpInfo($object_type, $object_id, $to_object_type, $ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1444,9 +1265,9 @@ public function getPageWithHttpInfo($object_type, $object_id, $to_object_type, $ * * List * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) + * @param string $object_type Specifies the type of the source object in the association. (required) + * @param string $object_id The unique identifier for the source object whose associations are being retrieved. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @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 int|null $limit The maximum number of results to display per page. (optional, default to 500) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1469,9 +1290,9 @@ function ($response) { * * List * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) + * @param string $object_type Specifies the type of the source object in the association. (required) + * @param string $object_id The unique identifier for the source object whose associations are being retrieved. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @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 int|null $limit The maximum number of results to display per page. (optional, default to 500) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1481,7 +1302,7 @@ function ($response) { */ public function getPageAsyncWithHttpInfo($object_type, $object_id, $to_object_type, $after = null, $limit = 500, string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'; + $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\CollectionResponseMultiAssociatedObjectWithLabel'; $request = $this->getPageRequest($object_type, $object_id, $to_object_type, $after, $limit, $contentType); return $this->client @@ -1523,9 +1344,9 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param string $object_type (required) - * @param string $object_id (required) - * @param string $to_object_type (required) + * @param string $object_type Specifies the type of the source object in the association. (required) + * @param string $object_id The unique identifier for the source object whose associations are being retrieved. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @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 int|null $limit The maximum number of results to display per page. (optional, default to 500) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation @@ -1686,6 +1507,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/Associations/V4/Api/BatchApi.php b/codegen/Crm/Associations/V4/Api/BatchApi.php index 45032fe8..50198bfa 100644 --- a/codegen/Crm/Associations/V4/Api/BatchApi.php +++ b/codegen/Crm/Associations/V4/Api/BatchApi.php @@ -1,7 +1,7 @@ archiveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, $contentType); + list($response) = $this->archiveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, $contentType); + return $response; } /** @@ -158,14 +162,14 @@ public function archive($from_object_type, $to_object_type, $batch_input_public_ * * Delete * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the batch association deletion. (required) + * @param string $to_object_type Specifies the type of the target object in the batch association deletion. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiArchive $batch_input_public_association_multi_archive (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * * @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 null, HTTP status code, HTTP response headers (array of strings) + * @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) */ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, string $contentType = self::contentTypes['archive'][0]) { @@ -194,10 +198,51 @@ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_i $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + 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, + ); } 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(), @@ -205,8 +250,10 @@ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_i $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -216,8 +263,8 @@ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_i * * Delete * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the batch association deletion. (required) + * @param string $to_object_type Specifies the type of the target object in the batch association deletion. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiArchive $batch_input_public_association_multi_archive (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * @@ -239,8 +286,8 @@ function ($response) { * * Delete * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the batch association deletion. (required) + * @param string $to_object_type Specifies the type of the target object in the batch association deletion. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiArchive $batch_input_public_association_multi_archive (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * @@ -249,14 +296,27 @@ function ($response) { */ public function archiveAsyncWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_archive, string $contentType = self::contentTypes['archive'][0]) { - $returnType = ''; + $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid'; $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) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -278,8 +338,8 @@ function ($exception) { /** * Create request for operation 'archive' * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the batch association deletion. (required) + * @param string $to_object_type Specifies the type of the target object in the batch association deletion. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiArchive $batch_input_public_association_multi_archive (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archive'] to see the possible values for this operation * @@ -339,7 +399,7 @@ public function archiveRequest($from_object_type, $to_object_type, $batch_input_ $headers = $this->headerSelector->selectHeaders( - ['*/*', ], + ['application/json', '*/*', ], $contentType, $multipart ); @@ -407,18 +467,19 @@ public function archiveRequest($from_object_type, $to_object_type, $batch_input_ * * Delete Specific Labels * - * @param string $from_object_type from_object_type (required) - * @param string $to_object_type to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLabels'] to see the possible values for this operation * * @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 void + * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Model\Error */ public function archiveLabels($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['archiveLabels'][0]) { - $this->archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, $contentType); + list($response) = $this->archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, $contentType); + return $response; } /** @@ -426,14 +487,14 @@ public function archiveLabels($from_object_type, $to_object_type, $batch_input_p * * Delete Specific Labels * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLabels'] to see the possible values for this operation * * @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 null, HTTP status code, HTTP response headers (array of strings) + * @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) */ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['archiveLabels'][0]) { @@ -462,10 +523,51 @@ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $b $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + 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, + ); } 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(), @@ -473,8 +575,10 @@ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $b $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -484,8 +588,8 @@ public function archiveLabelsWithHttpInfo($from_object_type, $to_object_type, $b * * Delete Specific Labels * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLabels'] to see the possible values for this operation * @@ -507,8 +611,8 @@ function ($response) { * * Delete Specific Labels * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLabels'] to see the possible values for this operation * @@ -517,14 +621,27 @@ function ($response) { */ public function archiveLabelsAsyncWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_multi_post, string $contentType = self::contentTypes['archiveLabels'][0]) { - $returnType = ''; + $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseVoid'; $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) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -546,8 +663,8 @@ function ($exception) { /** * Create request for operation 'archiveLabels' * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLabels'] to see the possible values for this operation * @@ -607,7 +724,7 @@ public function archiveLabelsRequest($from_object_type, $to_object_type, $batch_ $headers = $this->headerSelector->selectHeaders( - ['*/*', ], + ['application/json', '*/*', ], $contentType, $multipart ); @@ -675,14 +792,14 @@ public function archiveLabelsRequest($from_object_type, $to_object_type, $batch_ * * Create * - * @param string $from_object_type from_object_type (required) - * @param string $to_object_type to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\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\BatchResponseLabelsBetweenObjectPairWithErrors|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair|\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]) { @@ -695,14 +812,14 @@ public function create($from_object_type, $to_object_type, $batch_input_public_a * * Create * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\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\BatchResponseLabelsBetweenObjectPairWithErrors|\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\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]) { @@ -732,89 +849,22 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -828,52 +878,21 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair'; - 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\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPair', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponseLabelsBetweenObjectPairWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -881,8 +900,10 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -892,8 +913,8 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in * * Create * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * @@ -915,8 +936,8 @@ function ($response) { * * Create * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * @@ -967,8 +988,8 @@ function ($exception) { /** * Create request for operation 'create' * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicAssociationMultiPost $batch_input_public_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * @@ -1096,8 +1117,8 @@ public function createRequest($from_object_type, $to_object_type, $batch_input_p * * Create Default Associations * - * @param string $from_object_type from_object_type (required) - * @param string $to_object_type to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the association. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicDefaultAssociationMultiPost $batch_input_public_default_association_multi_post batch_input_public_default_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * @@ -1116,8 +1137,8 @@ public function createDefault($from_object_type, $to_object_type, $batch_input_p * * Create Default Associations * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the association. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicDefaultAssociationMultiPost $batch_input_public_default_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * @@ -1154,61 +1175,21 @@ public function createDefaultWithHttpInfo($from_object_type, $to_object_type, $b switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1222,34 +1203,11 @@ public function createDefaultWithHttpInfo($from_object_type, $to_object_type, $b ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicDefaultAssociation'; - 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\Associations\V4\Model\BatchResponsePublicDefaultAssociation', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1259,7 +1217,7 @@ public function createDefaultWithHttpInfo($from_object_type, $to_object_type, $b $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1267,8 +1225,10 @@ public function createDefaultWithHttpInfo($from_object_type, $to_object_type, $b $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1278,8 +1238,8 @@ public function createDefaultWithHttpInfo($from_object_type, $to_object_type, $b * * Create Default Associations * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the association. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicDefaultAssociationMultiPost $batch_input_public_default_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * @@ -1301,8 +1261,8 @@ function ($response) { * * Create Default Associations * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the association. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicDefaultAssociationMultiPost $batch_input_public_default_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * @@ -1353,8 +1313,8 @@ function ($exception) { /** * Create request for operation 'createDefault' * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type Specifies the type of the source object in the association. (required) + * @param string $to_object_type Specifies the type of the target object in the association. (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicDefaultAssociationMultiPost $batch_input_public_default_association_multi_post (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDefault'] to see the possible values for this operation * @@ -1482,14 +1442,14 @@ public function createDefaultRequest($from_object_type, $to_object_type, $batch_ * * Read * - * @param string $from_object_type from_object_type (required) - * @param string $to_object_type to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicFetchAssociationsBatchRequest $batch_input_public_fetch_associations_batch_request batch_input_public_fetch_associations_batch_request (required) * @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\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\BatchResponsePublicAssociationMultiWithLabelWithErrors|\HubSpot\Client\Crm\Associations\V4\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel|\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]) { @@ -1502,14 +1462,14 @@ public function getPage($from_object_type, $to_object_type, $batch_input_public_ * * Read * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicFetchAssociationsBatchRequest $batch_input_public_fetch_associations_batch_request (required) * @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\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\BatchResponsePublicAssociationMultiWithLabelWithErrors|\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\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]) { @@ -1540,88 +1500,21 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1635,34 +1528,11 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel'; - 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\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabel', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1672,15 +1542,7 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Model\BatchResponsePublicAssociationMultiWithLabelWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1688,8 +1550,10 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1699,8 +1563,8 @@ public function getPageWithHttpInfo($from_object_type, $to_object_type, $batch_i * * Read * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicFetchAssociationsBatchRequest $batch_input_public_fetch_associations_batch_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * @@ -1722,8 +1586,8 @@ function ($response) { * * Read * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicFetchAssociationsBatchRequest $batch_input_public_fetch_associations_batch_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * @@ -1774,8 +1638,8 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param string $from_object_type (required) - * @param string $to_object_type (required) + * @param string $from_object_type The type of the from Object (required) + * @param string $to_object_type The type of the to Object (required) * @param \HubSpot\Client\Crm\Associations\V4\Model\BatchInputPublicFetchAssociationsBatchRequest $batch_input_public_fetch_associations_batch_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * @@ -1914,6 +1778,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/Associations/V4/Api/ReportApi.php b/codegen/Crm/Associations/V4/Api/ReportApi.php index d47c413a..c1bc1f6b 100644 --- a/codegen/Crm/Associations/V4/Api/ReportApi.php +++ b/codegen/Crm/Associations/V4/Api/ReportApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Model\ReportCreationResponse' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Model\ReportCreationResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\ReportCreationResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -249,34 +212,11 @@ public function requestWithHttpInfo($user_id, string $contentType = self::conten ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Model\ReportCreationResponse'; - 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\Associations\V4\Model\ReportCreationResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -286,7 +226,7 @@ public function requestWithHttpInfo($user_id, string $contentType = self::conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -294,8 +234,10 @@ public function requestWithHttpInfo($user_id, string $contentType = self::conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -305,7 +247,7 @@ public function requestWithHttpInfo($user_id, string $contentType = self::conten * * Report * - * @param int $user_id (required) + * @param int $user_id The user for the report (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -326,7 +268,7 @@ function ($response) { * * Report * - * @param int $user_id (required) + * @param int $user_id The user for the report (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -376,7 +318,7 @@ function ($exception) { /** * Create request for operation 'request' * - * @param int $user_id (required) + * @param int $user_id The user for the report (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['request'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -485,6 +427,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/Associations/V4/ApiException.php b/codegen/Crm/Associations/V4/ApiException.php index 6a2a3370..d9c14509 100644 --- a/codegen/Crm/Associations/V4/ApiException.php +++ b/codegen/Crm/Associations/V4/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/Associations/V4/FormDataProcessor.php b/codegen/Crm/Associations/V4/FormDataProcessor.php new file mode 100644 index 00000000..75301fa4 --- /dev/null +++ b/codegen/Crm/Associations/V4/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/Associations/V4/HeaderSelector.php b/codegen/Crm/Associations/V4/HeaderSelector.php index c395f8a6..cbf4d84e 100644 --- a/codegen/Crm/Associations/V4/HeaderSelector.php +++ b/codegen/Crm/Associations/V4/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -406,12 +407,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -436,11 +437,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/AssociationSpecWithLabel.php b/codegen/Crm/Associations/V4/Model/AssociationSpecWithLabel.php index f54d038f..84f36f08 100644 --- a/codegen/Crm/Associations/V4/Model/AssociationSpecWithLabel.php +++ b/codegen/Crm/Associations/V4/Model/AssociationSpecWithLabel.php @@ -2,7 +2,7 @@ /** * AssociationSpecWithLabel * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,9 +57,9 @@ class AssociationSpecWithLabel implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'type_id' => 'int', + 'category' => 'string', 'label' => 'string', - 'category' => 'string' + 'type_id' => 'int' ]; /** @@ -70,9 +70,9 @@ class AssociationSpecWithLabel implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'type_id' => 'int32', + 'category' => null, 'label' => null, - 'category' => null + 'type_id' => 'int32' ]; /** @@ -81,9 +81,9 @@ class AssociationSpecWithLabel implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'type_id' => false, + 'category' => false, 'label' => false, - 'category' => false + 'type_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type_id' => 'typeId', + 'category' => 'category', 'label' => 'label', - 'category' => 'category' + 'type_id' => 'typeId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type_id' => 'setTypeId', + 'category' => 'setCategory', 'label' => 'setLabel', - 'category' => 'setCategory' + 'type_id' => 'setTypeId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type_id' => 'getTypeId', + 'category' => 'getCategory', 'label' => 'getLabel', - 'category' => 'getCategory' + 'type_id' => 'getTypeId' ]; /** @@ -241,8 +241,8 @@ public function getModelName() } public const CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -253,8 +253,8 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_HUBSPOT_DEFINED, - self::CATEGORY_USER_DEFINED, self::CATEGORY_INTEGRATOR_DEFINED, + self::CATEGORY_USER_DEFINED, ]; } @@ -273,9 +273,9 @@ public function getCategoryAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('type_id', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); } /** @@ -305,9 +305,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } @@ -320,6 +317,9 @@ public function listInvalidProperties() ); } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -336,28 +336,38 @@ public function valid() /** - * Gets type_id + * Gets category * - * @return int + * @return string */ - public function getTypeId() + public function getCategory() { - return $this->container['type_id']; + return $this->container['category']; } /** - * Sets type_id + * Sets category * - * @param int $type_id type_id + * @param string $category The category of the association, such as HUBSPOT_DEFINED, USER_DEFINED, or INTEGRATOR_DEFINED. * * @return self */ - public function setTypeId($type_id) + public function setCategory($category) { - if (is_null($type_id)) { - throw new \InvalidArgumentException('non-nullable type_id cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['type_id'] = $type_id; + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; return $this; } @@ -375,7 +385,7 @@ public function getLabel() /** * Sets label * - * @param string|null $label label + * @param string|null $label A label describing the association between two objects. * * @return self */ @@ -390,49 +400,39 @@ public function setLabel($label) } /** - * Gets category + * Gets type_id * - * @return string + * @return int */ - public function getCategory() + public function getTypeId() { - return $this->container['category']; + return $this->container['type_id']; } /** - * Sets category + * Sets type_id * - * @param string $category category + * @param int $type_id The unique identifier for the type of association. * * @return self */ - public function setCategory($category) + public function setTypeId($type_id) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($category, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'category', must be one of '%s'", - $category, - implode("', '", $allowedValues) - ) - ); + if (is_null($type_id)) { + throw new \InvalidArgumentException('non-nullable type_id cannot be null'); } - $this->container['category'] = $category; + $this->container['type_id'] = $type_id; 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]); } @@ -440,12 +440,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -470,11 +470,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiArchive.php b/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiArchive.php index d3e3305a..6266e75e 100644 --- a/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiArchive.php +++ b/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiArchive.php @@ -2,7 +2,7 @@ /** * BatchInputPublicAssociationMultiArchive * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Model/BatchInputPublicAssociationMultiPost.php b/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiPost.php index d74d3f4b..efc71fb0 100644 --- a/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiPost.php +++ b/codegen/Crm/Associations/V4/Model/BatchInputPublicAssociationMultiPost.php @@ -2,7 +2,7 @@ /** * BatchInputPublicAssociationMultiPost * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Model/BatchInputPublicDefaultAssociationMultiPost.php b/codegen/Crm/Associations/V4/Model/BatchInputPublicDefaultAssociationMultiPost.php index 2face534..c6c1e22f 100644 --- a/codegen/Crm/Associations/V4/Model/BatchInputPublicDefaultAssociationMultiPost.php +++ b/codegen/Crm/Associations/V4/Model/BatchInputPublicDefaultAssociationMultiPost.php @@ -2,7 +2,7 @@ /** * BatchInputPublicDefaultAssociationMultiPost * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Model/BatchInputPublicFetchAssociationsBatchRequest.php b/codegen/Crm/Associations/V4/Model/BatchInputPublicFetchAssociationsBatchRequest.php index cb7bdbf0..6a16cb85 100644 --- a/codegen/Crm/Associations/V4/Model/BatchInputPublicFetchAssociationsBatchRequest.php +++ b/codegen/Crm/Associations/V4/Model/BatchInputPublicFetchAssociationsBatchRequest.php @@ -2,7 +2,7 @@ /** * BatchInputPublicFetchAssociationsBatchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php b/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php index 56bdc8bc..6259ac15 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPair.php @@ -2,7 +2,7 @@ /** * BatchResponseLabelsBetweenObjectPair * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -58,10 +58,12 @@ class BatchResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAcces */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_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', 'status' => 'string' ]; @@ -74,10 +76,12 @@ class BatchResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAcces */ 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 +92,12 @@ class BatchResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAcces */ 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 +188,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 +204,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 +220,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 +270,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 +283,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 +306,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 +345,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 +391,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 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Associations\V4\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\Associations\V4\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 number of errors encountered during the batch processing. * * @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 +540,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 +580,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 +606,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 +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; } @@ -580,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/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php index bc8d58ba..50f184e7 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabel.php @@ -2,7 +2,7 @@ /** * BatchResponsePublicAssociationMultiWithLabel * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -58,10 +58,12 @@ class BatchResponsePublicAssociationMultiWithLabel implements ModelInterface, Ar */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_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' ]; @@ -74,10 +76,12 @@ class BatchResponsePublicAssociationMultiWithLabel implements ModelInterface, Ar */ 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 +92,12 @@ class BatchResponsePublicAssociationMultiWithLabel implements ModelInterface, Ar */ 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 +188,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 +204,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 +220,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 +270,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 +283,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 +306,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 +345,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 +391,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 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Associations\V4\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\Associations\V4\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 number of errors encountered during the batch processing. * * @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 +540,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 +580,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELED\", or \"COMPLETE\". * * @return self */ @@ -538,11 +606,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 +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; } @@ -580,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/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php b/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php deleted file mode 100644 index cd59ffd6..00000000 --- a/codegen/Crm/Associations/V4/Model/BatchResponsePublicAssociationMultiWithLabelWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -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', - 'num_errors' => 'int', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicAssociationMultiWithLabel[]', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\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\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 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 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/Associations/V4/Model/BatchResponsePublicDefaultAssociation.php b/codegen/Crm/Associations/V4/Model/BatchResponsePublicDefaultAssociation.php index 0766d5f5..857fe39f 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponsePublicDefaultAssociation.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponsePublicDefaultAssociation.php @@ -2,7 +2,7 @@ /** * BatchResponsePublicDefaultAssociation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -58,12 +58,12 @@ class BatchResponsePublicDefaultAssociation implements ModelInterface, ArrayAcce */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', + 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicDefaultAssociation[]', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -76,12 +76,12 @@ class BatchResponsePublicDefaultAssociation implements ModelInterface, ArrayAcce */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', + 'errors' => null, + 'links' => null, 'num_errors' => 'int32', 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, 'results' => null, - 'errors' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -92,12 +92,12 @@ class BatchResponsePublicDefaultAssociation implements ModelInterface, ArrayAcce */ protected static array $openAPINullables = [ 'completed_at' => false, + 'errors' => false, + 'links' => false, 'num_errors' => false, 'requested_at' => false, - 'started_at' => false, - 'links' => false, 'results' => false, - 'errors' => false, + 'started_at' => false, 'status' => false ]; @@ -188,12 +188,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', + 'errors' => 'errors', + 'links' => 'links', 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', 'results' => 'results', - 'errors' => 'errors', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -204,12 +204,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', 'results' => 'setResults', - 'errors' => 'setErrors', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -220,12 +220,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', 'results' => 'getResults', - 'errors' => 'getErrors', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -270,10 +270,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 @@ -283,10 +283,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, ]; } @@ -306,12 +306,12 @@ 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('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -345,12 +345,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"; } @@ -391,7 +391,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 */ @@ -406,109 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets num_errors + * Gets errors * - * @return int|null + * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null */ - public function getNumErrors() + public function getErrors() { - return $this->container['num_errors']; + return $this->container['errors']; } /** - * Sets num_errors + * Sets errors * - * @param int|null $num_errors num_errors + * @param \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null $errors errors * * @return self */ - public function setNumErrors($num_errors) + public function setErrors($errors) { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['num_errors'] = $num_errors; + $this->container['errors'] = $errors; return $this; } /** - * Gets requested_at + * Gets links * - * @return \DateTime|null + * @return array|null */ - public function getRequestedAt() + public function getLinks() { - return $this->container['requested_at']; + return $this->container['links']; } /** - * Sets requested_at + * Sets links * - * @param \DateTime|null $requested_at requested_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setRequestedAt($requested_at) + public function setLinks($links) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['links'] = $links; return $this; } /** - * Gets started_at + * Gets num_errors * - * @return \DateTime + * @return int|null */ - public function getStartedAt() + public function getNumErrors() { - return $this->container['started_at']; + return $this->container['num_errors']; } /** - * Sets started_at + * Sets num_errors * - * @param \DateTime $started_at started_at + * @param int|null $num_errors The number of errors encountered during the batch processing. * * @return self */ - public function setStartedAt($started_at) + public function setNumErrors($num_errors) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['num_errors'] = $num_errors; return $this; } /** - * Gets links + * Gets requested_at * - * @return array|null + * @return \DateTime|null */ - public function getLinks() + public function getRequestedAt() { - return $this->container['links']; + return $this->container['requested_at']; } /** - * Sets links + * Sets requested_at * - * @param array|null $links links + * @param \DateTime|null $requested_at The timestamp when the batch process was initiated, in ISO 8601 format. * * @return self */ - public function setLinks($links) + public function setRequestedAt($requested_at) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); } - $this->container['links'] = $links; + $this->container['requested_at'] = $requested_at; return $this; } @@ -541,28 +541,28 @@ public function setResults($results) } /** - * Gets errors + * Gets started_at * - * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null + * @return \DateTime */ - public function getErrors() + public function getStartedAt() { - return $this->container['errors']; + return $this->container['started_at']; } /** - * Sets errors + * Sets started_at * - * @param \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null $errors errors + * @param \DateTime $started_at The timestamp when the batch process began execution, in ISO 8601 format. * * @return self */ - public function setErrors($errors) + public function setStartedAt($started_at) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['errors'] = $errors; + $this->container['started_at'] = $started_at; return $this; } @@ -580,7 +580,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 */ @@ -606,11 +606,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]); } @@ -618,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; } @@ -648,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/Associations/V4/Model/BatchResponseLabelsBetweenObjectPairWithErrors.php b/codegen/Crm/Associations/V4/Model/BatchResponseVoid.php similarity index 92% rename from codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPairWithErrors.php rename to codegen/Crm/Associations/V4/Model/BatchResponseVoid.php index 6f4cb139..64b39526 100644 --- a/codegen/Crm/Associations/V4/Model/BatchResponseLabelsBetweenObjectPairWithErrors.php +++ b/codegen/Crm/Associations/V4/Model/BatchResponseVoid.php @@ -1,8 +1,8 @@ */ -class BatchResponseLabelsBetweenObjectPairWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable +class BatchResponseVoid implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class BatchResponseLabelsBetweenObjectPairWithErrors implements ModelInterface, * * @var string */ - protected static $openAPIModelName = 'BatchResponseLabelsBetweenObjectPairWithErrors'; + protected static $openAPIModelName = 'BatchResponseVoid'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,12 +58,12 @@ class BatchResponseLabelsBetweenObjectPairWithErrors implements ModelInterface, */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', + 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', + 'results' => 'mixed[]', 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[]', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Model\StandardError[]', 'status' => 'string' ]; @@ -76,12 +76,12 @@ class BatchResponseLabelsBetweenObjectPairWithErrors implements ModelInterface, */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', + 'errors' => null, + 'links' => null, 'num_errors' => 'int32', 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, 'results' => null, - 'errors' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -92,12 +92,12 @@ class BatchResponseLabelsBetweenObjectPairWithErrors implements ModelInterface, */ protected static array $openAPINullables = [ 'completed_at' => false, + 'errors' => false, + 'links' => false, 'num_errors' => false, 'requested_at' => false, - 'started_at' => false, - 'links' => false, 'results' => false, - 'errors' => false, + 'started_at' => false, 'status' => false ]; @@ -188,12 +188,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', + 'errors' => 'errors', + 'links' => 'links', 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', 'results' => 'results', - 'errors' => 'errors', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -204,12 +204,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', 'results' => 'setResults', - 'errors' => 'setErrors', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -220,12 +220,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', 'results' => 'getResults', - 'errors' => 'getErrors', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -270,10 +270,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 @@ -283,10 +283,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, ]; } @@ -306,12 +306,12 @@ 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('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -345,12 +345,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"; } @@ -391,7 +391,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at Time operation completed * * @return self */ @@ -406,109 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets num_errors + * Gets errors * - * @return int|null + * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null */ - public function getNumErrors() + public function getErrors() { - return $this->container['num_errors']; + return $this->container['errors']; } /** - * Sets num_errors + * Sets errors * - * @param int|null $num_errors num_errors + * @param \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null $errors errors * * @return self */ - public function setNumErrors($num_errors) + public function setErrors($errors) { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['num_errors'] = $num_errors; + $this->container['errors'] = $errors; return $this; } /** - * Gets requested_at + * Gets links * - * @return \DateTime|null + * @return array|null */ - public function getRequestedAt() + public function getLinks() { - return $this->container['requested_at']; + return $this->container['links']; } /** - * Sets requested_at + * Sets links * - * @param \DateTime|null $requested_at requested_at + * @param array|null $links An object containing relevant links related to the batch request. * * @return self */ - public function setRequestedAt($requested_at) + public function setLinks($links) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['links'] = $links; return $this; } /** - * Gets started_at + * Gets num_errors * - * @return \DateTime + * @return int|null */ - public function getStartedAt() + public function getNumErrors() { - return $this->container['started_at']; + return $this->container['num_errors']; } /** - * Sets started_at + * Sets num_errors * - * @param \DateTime $started_at started_at + * @param int|null $num_errors The number of errors encountered during the batch processing. * * @return self */ - public function setStartedAt($started_at) + public function setNumErrors($num_errors) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['num_errors'] = $num_errors; return $this; } /** - * Gets links + * Gets requested_at * - * @return array|null + * @return \DateTime|null */ - public function getLinks() + public function getRequestedAt() { - return $this->container['links']; + return $this->container['requested_at']; } /** - * Sets links + * Sets requested_at * - * @param array|null $links links + * @param \DateTime|null $requested_at The timestamp when the batch request was initially made, in ISO 8601 format. * * @return self */ - public function setLinks($links) + public function setRequestedAt($requested_at) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); } - $this->container['links'] = $links; + $this->container['requested_at'] = $requested_at; return $this; } @@ -516,7 +516,7 @@ public function setLinks($links) /** * Gets results * - * @return \HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[] + * @return mixed[] */ public function getResults() { @@ -526,7 +526,7 @@ public function getResults() /** * Sets results * - * @param \HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair[] $results results + * @param mixed[] $results results * * @return self */ @@ -541,28 +541,28 @@ public function setResults($results) } /** - * Gets errors + * Gets started_at * - * @return \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null + * @return \DateTime */ - public function getErrors() + public function getStartedAt() { - return $this->container['errors']; + return $this->container['started_at']; } /** - * Sets errors + * Sets started_at * - * @param \HubSpot\Client\Crm\Associations\V4\Model\StandardError[]|null $errors errors + * @param \DateTime $started_at The timestamp when the batch processing began, in ISO 8601 format. * * @return self */ - public function setErrors($errors) + public function setStartedAt($started_at) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['errors'] = $errors; + $this->container['started_at'] = $started_at; return $this; } @@ -580,7 +580,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The status of the batch processing request: \"PENDING\", \"PROCESSING\", \"CANCELED\", or \"COMPLETE\". * * @return self */ @@ -606,11 +606,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]); } @@ -618,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; } @@ -648,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/Associations/V4/Model/CollectionResponseMultiAssociatedObjectWithLabelForwardPaging.php b/codegen/Crm/Associations/V4/Model/CollectionResponseMultiAssociatedObjectWithLabel.php similarity index 91% rename from codegen/Crm/Associations/V4/Model/CollectionResponseMultiAssociatedObjectWithLabelForwardPaging.php rename to codegen/Crm/Associations/V4/Model/CollectionResponseMultiAssociatedObjectWithLabel.php index a0a37ce9..3861bdf5 100644 --- a/codegen/Crm/Associations/V4/Model/CollectionResponseMultiAssociatedObjectWithLabelForwardPaging.php +++ b/codegen/Crm/Associations/V4/Model/CollectionResponseMultiAssociatedObjectWithLabel.php @@ -1,8 +1,8 @@ */ -class CollectionResponseMultiAssociatedObjectWithLabelForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseMultiAssociatedObjectWithLabel implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponseMultiAssociatedObjectWithLabelForwardPaging implements M * * @var string */ - protected static $openAPIModelName = 'CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'; + protected static $openAPIModelName = 'CollectionResponseMultiAssociatedObjectWithLabel'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,7 @@ class CollectionResponseMultiAssociatedObjectWithLabelForwardPaging implements M * @var string[] */ protected static $openAPITypes = [ - 'paging' => '\HubSpot\Client\Crm\Associations\V4\Model\ForwardPaging', + 'paging' => '\HubSpot\Client\Crm\Associations\V4\Model\Paging', 'results' => '\HubSpot\Client\Crm\Associations\V4\Model\MultiAssociatedObjectWithLabel[]' ]; @@ -302,7 +302,7 @@ public function valid() /** * Gets paging * - * @return \HubSpot\Client\Crm\Associations\V4\Model\ForwardPaging|null + * @return \HubSpot\Client\Crm\Associations\V4\Model\Paging|null */ public function getPaging() { @@ -312,7 +312,7 @@ public function getPaging() /** * Sets paging * - * @param \HubSpot\Client\Crm\Associations\V4\Model\ForwardPaging|null $paging paging + * @param \HubSpot\Client\Crm\Associations\V4\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/Associations/V4/Model/CreatedResponseLabelsBetweenObjectPair.php b/codegen/Crm/Associations/V4/Model/CreatedResponseLabelsBetweenObjectPair.php new file mode 100644 index 00000000..10f23f3e --- /dev/null +++ b/codegen/Crm/Associations/V4/Model/CreatedResponseLabelsBetweenObjectPair.php @@ -0,0 +1,483 @@ + + */ +class CreatedResponseLabelsBetweenObjectPair implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatedResponseLabelsBetweenObjectPair'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'created_resource_id' => 'string', + 'entity' => '\HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair', + 'location' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'created_resource_id' => null, + 'entity' => null, + 'location' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'created_resource_id' => false, + 'entity' => false, + 'location' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'created_resource_id' => 'createdResourceId', + 'entity' => 'entity', + 'location' => 'location' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_resource_id' => 'setCreatedResourceId', + 'entity' => 'setEntity', + 'location' => 'setLocation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_resource_id' => 'getCreatedResourceId', + 'entity' => 'getEntity', + 'location' => 'getLocation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('created_resource_id', $data ?? [], null); + $this->setIfExists('entity', $data ?? [], null); + $this->setIfExists('location', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['created_resource_id'] === null) { + $invalidProperties[] = "'created_resource_id' can't be null"; + } + if ($this->container['entity'] === null) { + $invalidProperties[] = "'entity' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets created_resource_id + * + * @return string + */ + public function getCreatedResourceId() + { + return $this->container['created_resource_id']; + } + + /** + * Sets created_resource_id + * + * @param string $created_resource_id The unique identifier of the newly created resource. + * + * @return self + */ + public function setCreatedResourceId($created_resource_id) + { + if (is_null($created_resource_id)) { + throw new \InvalidArgumentException('non-nullable created_resource_id cannot be null'); + } + $this->container['created_resource_id'] = $created_resource_id; + + return $this; + } + + /** + * Gets entity + * + * @return \HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param \HubSpot\Client\Crm\Associations\V4\Model\LabelsBetweenObjectPair $entity entity + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $this->container['entity'] = $entity; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location The URL location of the newly created resource. + * + * @return self + */ + public function setLocation($location) + { + if (is_null($location)) { + throw new \InvalidArgumentException('non-nullable location cannot be null'); + } + $this->container['location'] = $location; + + 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/DateTime.php b/codegen/Crm/Associations/V4/Model/DateTime.php index 4d3c0b3f..ca9b8469 100644 --- a/codegen/Crm/Associations/V4/Model/DateTime.php +++ b/codegen/Crm/Associations/V4/Model/DateTime.php @@ -2,7 +2,7 @@ /** * DateTime * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -325,7 +325,7 @@ public function getDateOnly() /** * Sets date_only * - * @param bool $date_only date_only + * @param bool $date_only Indicates whether the DateTime value represents only a date without a time component. * * @return self */ @@ -352,7 +352,7 @@ public function getTimeZoneShift() /** * Sets time_zone_shift * - * @param int $time_zone_shift time_zone_shift + * @param int $time_zone_shift The integer value representing the shift in minutes from UTC for the DateTime value. * * @return self */ @@ -379,7 +379,7 @@ public function getValue() /** * Sets value * - * @param int $value value + * @param int $value The integer value representing a specific point in time. * * @return self */ @@ -395,11 +395,11 @@ public function setValue($value) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -407,12 +407,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -437,11 +437,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/Error.php b/codegen/Crm/Associations/V4/Model/Error.php index 55cdaafc..3297adbd 100644 --- a/codegen/Crm/Associations/V4/Model/Error.php +++ b/codegen/Crm/Associations/V4/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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\Associations\V4\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Associations\V4\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\Associations\V4\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\Associations\V4\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/Associations/V4/Model/ErrorDetail.php b/codegen/Crm/Associations/V4/Model/ErrorDetail.php index af903c66..414fb0cb 100644 --- a/codegen/Crm/Associations/V4/Model/ErrorDetail.php +++ b/codegen/Crm/Associations/V4/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Model/LabelsBetweenObjectPair.php b/codegen/Crm/Associations/V4/Model/LabelsBetweenObjectPair.php index b0284b3f..6a61801a 100644 --- a/codegen/Crm/Associations/V4/Model/LabelsBetweenObjectPair.php +++ b/codegen/Crm/Associations/V4/Model/LabelsBetweenObjectPair.php @@ -2,7 +2,7 @@ /** * LabelsBetweenObjectPair * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,11 +57,11 @@ class LabelsBetweenObjectPair implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ + 'from_object_id' => 'string', 'from_object_type_id' => 'string', + 'labels' => 'string[]', 'to_object_id' => 'string', - 'to_object_type_id' => 'string', - 'from_object_id' => 'string', - 'labels' => 'string[]' + 'to_object_type_id' => 'string' ]; /** @@ -72,11 +72,11 @@ class LabelsBetweenObjectPair implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ + 'from_object_id' => null, 'from_object_type_id' => null, + 'labels' => null, 'to_object_id' => null, - 'to_object_type_id' => null, - 'from_object_id' => null, - 'labels' => null + 'to_object_type_id' => null ]; /** @@ -85,11 +85,11 @@ class LabelsBetweenObjectPair implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ + 'from_object_id' => false, 'from_object_type_id' => false, + 'labels' => false, 'to_object_id' => false, - 'to_object_type_id' => false, - 'from_object_id' => false, - 'labels' => false + 'to_object_type_id' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'from_object_id' => 'fromObjectId', 'from_object_type_id' => 'fromObjectTypeId', + 'labels' => 'labels', 'to_object_id' => 'toObjectId', - 'to_object_type_id' => 'toObjectTypeId', - 'from_object_id' => 'fromObjectId', - 'labels' => 'labels' + 'to_object_type_id' => 'toObjectTypeId' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'from_object_id' => 'setFromObjectId', 'from_object_type_id' => 'setFromObjectTypeId', + 'labels' => 'setLabels', 'to_object_id' => 'setToObjectId', - 'to_object_type_id' => 'setToObjectTypeId', - 'from_object_id' => 'setFromObjectId', - 'labels' => 'setLabels' + 'to_object_type_id' => 'setToObjectTypeId' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'from_object_id' => 'getFromObjectId', 'from_object_type_id' => 'getFromObjectTypeId', + 'labels' => 'getLabels', 'to_object_id' => 'getToObjectId', - 'to_object_type_id' => 'getToObjectTypeId', - 'from_object_id' => 'getFromObjectId', - 'labels' => 'getLabels' + 'to_object_type_id' => 'getToObjectTypeId' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('from_object_id', $data ?? [], null); $this->setIfExists('from_object_type_id', $data ?? [], null); + $this->setIfExists('labels', $data ?? [], null); $this->setIfExists('to_object_id', $data ?? [], null); $this->setIfExists('to_object_type_id', $data ?? [], null); - $this->setIfExists('from_object_id', $data ?? [], null); - $this->setIfExists('labels', $data ?? [], null); } /** @@ -302,21 +302,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['from_object_id'] === null) { + $invalidProperties[] = "'from_object_id' can't be null"; + } if ($this->container['from_object_type_id'] === null) { $invalidProperties[] = "'from_object_type_id' can't be null"; } + if ($this->container['labels'] === null) { + $invalidProperties[] = "'labels' can't be null"; + } if ($this->container['to_object_id'] === null) { $invalidProperties[] = "'to_object_id' can't be null"; } if ($this->container['to_object_type_id'] === null) { $invalidProperties[] = "'to_object_type_id' can't be null"; } - if ($this->container['from_object_id'] === null) { - $invalidProperties[] = "'from_object_id' can't be null"; - } - if ($this->container['labels'] === null) { - $invalidProperties[] = "'labels' can't be null"; - } return $invalidProperties; } @@ -333,147 +333,147 @@ public function valid() /** - * Gets from_object_type_id + * Gets from_object_id * * @return string */ - public function getFromObjectTypeId() + public function getFromObjectId() { - return $this->container['from_object_type_id']; + return $this->container['from_object_id']; } /** - * Sets from_object_type_id + * Sets from_object_id * - * @param string $from_object_type_id from_object_type_id + * @param string $from_object_id The ID of the source object in the association. * * @return self */ - public function setFromObjectTypeId($from_object_type_id) + public function setFromObjectId($from_object_id) { - if (is_null($from_object_type_id)) { - throw new \InvalidArgumentException('non-nullable from_object_type_id cannot be null'); + if (is_null($from_object_id)) { + throw new \InvalidArgumentException('non-nullable from_object_id cannot be null'); } - $this->container['from_object_type_id'] = $from_object_type_id; + $this->container['from_object_id'] = $from_object_id; return $this; } /** - * Gets to_object_id + * Gets from_object_type_id * * @return string */ - public function getToObjectId() + public function getFromObjectTypeId() { - return $this->container['to_object_id']; + return $this->container['from_object_type_id']; } /** - * Sets to_object_id + * Sets from_object_type_id * - * @param string $to_object_id to_object_id + * @param string $from_object_type_id The type ID of the source object in the association. * * @return self */ - public function setToObjectId($to_object_id) + public function setFromObjectTypeId($from_object_type_id) { - if (is_null($to_object_id)) { - throw new \InvalidArgumentException('non-nullable to_object_id cannot be null'); + if (is_null($from_object_type_id)) { + throw new \InvalidArgumentException('non-nullable from_object_type_id cannot be null'); } - $this->container['to_object_id'] = $to_object_id; + $this->container['from_object_type_id'] = $from_object_type_id; return $this; } /** - * Gets to_object_type_id + * Gets labels * - * @return string + * @return string[] */ - public function getToObjectTypeId() + public function getLabels() { - return $this->container['to_object_type_id']; + return $this->container['labels']; } /** - * Sets to_object_type_id + * Sets labels * - * @param string $to_object_type_id to_object_type_id + * @param string[] $labels An array of labels associated with the relationship between the objects. * * @return self */ - public function setToObjectTypeId($to_object_type_id) + public function setLabels($labels) { - if (is_null($to_object_type_id)) { - throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); + if (is_null($labels)) { + throw new \InvalidArgumentException('non-nullable labels cannot be null'); } - $this->container['to_object_type_id'] = $to_object_type_id; + $this->container['labels'] = $labels; return $this; } /** - * Gets from_object_id + * Gets to_object_id * * @return string */ - public function getFromObjectId() + public function getToObjectId() { - return $this->container['from_object_id']; + return $this->container['to_object_id']; } /** - * Sets from_object_id + * Sets to_object_id * - * @param string $from_object_id from_object_id + * @param string $to_object_id The ID of the target object in the association. * * @return self */ - public function setFromObjectId($from_object_id) + public function setToObjectId($to_object_id) { - if (is_null($from_object_id)) { - throw new \InvalidArgumentException('non-nullable from_object_id cannot be null'); + if (is_null($to_object_id)) { + throw new \InvalidArgumentException('non-nullable to_object_id cannot be null'); } - $this->container['from_object_id'] = $from_object_id; + $this->container['to_object_id'] = $to_object_id; return $this; } /** - * Gets labels + * Gets to_object_type_id * - * @return string[] + * @return string */ - public function getLabels() + public function getToObjectTypeId() { - return $this->container['labels']; + return $this->container['to_object_type_id']; } /** - * Sets labels + * Sets to_object_type_id * - * @param string[] $labels labels + * @param string $to_object_type_id The type ID of the target object in the association. * * @return self */ - public function setLabels($labels) + public function setToObjectTypeId($to_object_type_id) { - if (is_null($labels)) { - throw new \InvalidArgumentException('non-nullable labels cannot be null'); + if (is_null($to_object_type_id)) { + throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); } - $this->container['labels'] = $labels; + $this->container['to_object_type_id'] = $to_object_type_id; 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]); } @@ -481,12 +481,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -511,11 +511,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/ModelInterface.php b/codegen/Crm/Associations/V4/Model/ModelInterface.php index 9c85d8e8..eda39e6e 100644 --- a/codegen/Crm/Associations/V4/Model/ModelInterface.php +++ b/codegen/Crm/Associations/V4/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Model @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** diff --git a/codegen/Crm/Associations/V4/Model/MultiAssociatedObjectWithLabel.php b/codegen/Crm/Associations/V4/Model/MultiAssociatedObjectWithLabel.php index be55c415..e4c15aba 100644 --- a/codegen/Crm/Associations/V4/Model/MultiAssociatedObjectWithLabel.php +++ b/codegen/Crm/Associations/V4/Model/MultiAssociatedObjectWithLabel.php @@ -2,7 +2,7 @@ /** * MultiAssociatedObjectWithLabel * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -342,7 +342,7 @@ public function getToObjectId() /** * Sets to_object_id * - * @param string $to_object_id to_object_id + * @param string $to_object_id The unique identifier for the target object in the association. * * @return self */ @@ -358,11 +358,11 @@ public function setToObjectId($to_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 +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/Associations/V4/Model/NextPage.php b/codegen/Crm/Associations/V4/Model/NextPage.php index 218828ca..b3707325 100644 --- a/codegen/Crm/Associations/V4/Model/NextPage.php +++ b/codegen/Crm/Associations/V4/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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\Associations\V4 * @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/Associations/V4/Model/Paging.php b/codegen/Crm/Associations/V4/Model/Paging.php index 5011eaca..5084631f 100644 --- a/codegen/Crm/Associations/V4/Model/Paging.php +++ b/codegen/Crm/Associations/V4/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Model/PreviousPage.php b/codegen/Crm/Associations/V4/Model/PreviousPage.php index a03500d2..1c6a73e1 100644 --- a/codegen/Crm/Associations/V4/Model/PreviousPage.php +++ b/codegen/Crm/Associations/V4/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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\Associations\V4 * @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/Associations/V4/Model/PublicAssociationMultiArchive.php b/codegen/Crm/Associations/V4/Model/PublicAssociationMultiArchive.php index 74cfc8f1..31926c19 100644 --- a/codegen/Crm/Associations/V4/Model/PublicAssociationMultiArchive.php +++ b/codegen/Crm/Associations/V4/Model/PublicAssociationMultiArchive.php @@ -2,7 +2,7 @@ /** * PublicAssociationMultiArchive * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -358,11 +358,11 @@ public function setTo($to) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset 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/Associations/V4/Model/PublicAssociationMultiPost.php b/codegen/Crm/Associations/V4/Model/PublicAssociationMultiPost.php index 2219b165..81ea3213 100644 --- a/codegen/Crm/Associations/V4/Model/PublicAssociationMultiPost.php +++ b/codegen/Crm/Associations/V4/Model/PublicAssociationMultiPost.php @@ -2,7 +2,7 @@ /** * PublicAssociationMultiPost * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,9 +57,9 @@ class PublicAssociationMultiPost implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ - 'types' => '\HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[]', 'from' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicObjectId', - 'to' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicObjectId' + 'to' => '\HubSpot\Client\Crm\Associations\V4\Model\PublicObjectId', + 'types' => '\HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[]' ]; /** @@ -70,9 +70,9 @@ class PublicAssociationMultiPost implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'types' => null, 'from' => null, - 'to' => null + 'to' => null, + 'types' => null ]; /** @@ -81,9 +81,9 @@ class PublicAssociationMultiPost implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'types' => false, 'from' => false, - 'to' => false + 'to' => false, + 'types' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'types' => 'types', 'from' => 'from', - 'to' => 'to' + 'to' => 'to', + 'types' => 'types' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'types' => 'setTypes', 'from' => 'setFrom', - 'to' => 'setTo' + 'to' => 'setTo', + 'types' => 'setTypes' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'types' => 'getTypes', 'from' => 'getFrom', - 'to' => 'getTo' + 'to' => 'getTo', + 'types' => 'getTypes' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('types', $data ?? [], null); $this->setIfExists('from', $data ?? [], null); $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('types', $data ?? [], null); } /** @@ -288,15 +288,15 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['types'] === null) { - $invalidProperties[] = "'types' can't be null"; - } if ($this->container['from'] === null) { $invalidProperties[] = "'from' 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; } @@ -312,33 +312,6 @@ public function valid() } - /** - * Gets types - * - * @return \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] - */ - public function getTypes() - { - return $this->container['types']; - } - - /** - * Sets types - * - * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $types types - * - * @return self - */ - public function setTypes($types) - { - if (is_null($types)) { - throw new \InvalidArgumentException('non-nullable types cannot be null'); - } - $this->container['types'] = $types; - - return $this; - } - /** * Gets from * @@ -392,14 +365,41 @@ public function setTo($to) return $this; } + + /** + * Gets types + * + * @return \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] + */ + public function getTypes() + { + return $this->container['types']; + } + + /** + * Sets types + * + * @param \HubSpot\Client\Crm\Associations\V4\Model\AssociationSpec[] $types types + * + * @return self + */ + public function setTypes($types) + { + if (is_null($types)) { + throw new \InvalidArgumentException('non-nullable types cannot be null'); + } + $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]); } @@ -407,12 +407,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -437,11 +437,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/PublicAssociationMultiWithLabel.php b/codegen/Crm/Associations/V4/Model/PublicAssociationMultiWithLabel.php index 16466d4b..df50a722 100644 --- a/codegen/Crm/Associations/V4/Model/PublicAssociationMultiWithLabel.php +++ b/codegen/Crm/Associations/V4/Model/PublicAssociationMultiWithLabel.php @@ -2,7 +2,7 @@ /** * PublicAssociationMultiWithLabel * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -392,11 +392,11 @@ public function setTo($to) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset 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 +404,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset 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 +434,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/PublicDefaultAssociation.php b/codegen/Crm/Associations/V4/Model/PublicDefaultAssociation.php index 1383e9de..547bd638 100644 --- a/codegen/Crm/Associations/V4/Model/PublicDefaultAssociation.php +++ b/codegen/Crm/Associations/V4/Model/PublicDefaultAssociation.php @@ -2,7 +2,7 @@ /** * PublicDefaultAssociation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -395,11 +395,11 @@ public function setTo($to) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -407,12 +407,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -437,11 +437,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/PublicDefaultAssociationMultiPost.php b/codegen/Crm/Associations/V4/Model/PublicDefaultAssociationMultiPost.php index ba3e92d8..06fefbfa 100644 --- a/codegen/Crm/Associations/V4/Model/PublicDefaultAssociationMultiPost.php +++ b/codegen/Crm/Associations/V4/Model/PublicDefaultAssociationMultiPost.php @@ -2,7 +2,7 @@ /** * PublicDefaultAssociationMultiPost * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -358,11 +358,11 @@ public function setTo($to) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset 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/Associations/V4/Model/PublicFetchAssociationsBatchRequest.php b/codegen/Crm/Associations/V4/Model/PublicFetchAssociationsBatchRequest.php index 0dedbc73..8001bdc8 100644 --- a/codegen/Crm/Associations/V4/Model/PublicFetchAssociationsBatchRequest.php +++ b/codegen/Crm/Associations/V4/Model/PublicFetchAssociationsBatchRequest.php @@ -2,7 +2,7 @@ /** * PublicFetchAssociationsBatchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,8 +57,8 @@ class PublicFetchAssociationsBatchRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', - 'after' => 'string' + 'after' => 'string', + 'id' => 'string' ]; /** @@ -69,8 +69,8 @@ class PublicFetchAssociationsBatchRequest implements ModelInterface, ArrayAccess * @psalm-var array */ protected static $openAPIFormats = [ - 'id' => null, - 'after' => null + 'after' => null, + 'id' => null ]; /** @@ -79,8 +79,8 @@ class PublicFetchAssociationsBatchRequest implements ModelInterface, ArrayAccess * @var boolean[] */ protected static array $openAPINullables = [ - 'id' => false, - 'after' => false + 'after' => false, + 'id' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'id' => 'id', - 'after' => 'after' + 'after' => 'after', + 'id' => 'id' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'id' => 'setId', - 'after' => 'setAfter' + 'after' => 'setAfter', + 'id' => 'setId' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'id' => 'getId', - 'after' => 'getAfter' + 'after' => 'getAfter', + 'id' => 'getId' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); } /** @@ -300,66 +300,66 @@ public function valid() /** - * Gets id + * Gets after * - * @return string + * @return string|null */ - public function getId() + public function getAfter() { - return $this->container['id']; + return $this->container['after']; } /** - * Sets id + * Sets after * - * @param string $id id + * @param string|null $after A paging cursor token used to retrieve the next set of results in a paginated response. * * @return self */ - public function setId($id) + public function setAfter($after) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['id'] = $id; + $this->container['after'] = $after; return $this; } /** - * Gets after + * Gets id * - * @return string|null + * @return string */ - public function getAfter() + public function getId() { - return $this->container['after']; + return $this->container['id']; } /** - * Sets after + * Sets id * - * @param string|null $after after + * @param string $id The unique identifier for the object whose associations are being fetched. * * @return self */ - public function setAfter($after) + public function setId($id) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['after'] = $after; + $this->container['id'] = $id; 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 +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/Associations/V4/Model/PublicObjectId.php b/codegen/Crm/Associations/V4/Model/PublicObjectId.php index 8a693909..dc194def 100644 --- a/codegen/Crm/Associations/V4/Model/PublicObjectId.php +++ b/codegen/Crm/Associations/V4/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -305,7 +305,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id ID of the object * * @return self */ @@ -321,11 +321,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 +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/Associations/V4/Model/ReportCreationResponse.php b/codegen/Crm/Associations/V4/Model/ReportCreationResponse.php index 6282fa20..682b243a 100644 --- a/codegen/Crm/Associations/V4/Model/ReportCreationResponse.php +++ b/codegen/Crm/Associations/V4/Model/ReportCreationResponse.php @@ -2,7 +2,7 @@ /** * ReportCreationResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,9 +57,9 @@ class ReportCreationResponse implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ + 'enqueue_time' => '\DateTime', 'user_email' => 'string', - 'user_id' => 'int', - 'enqueue_time' => '\DateTime' + 'user_id' => 'int' ]; /** @@ -70,9 +70,9 @@ class ReportCreationResponse implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ + 'enqueue_time' => null, 'user_email' => null, - 'user_id' => 'int32', - 'enqueue_time' => null + 'user_id' => 'int32' ]; /** @@ -81,9 +81,9 @@ class ReportCreationResponse implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ + 'enqueue_time' => false, 'user_email' => false, - 'user_id' => false, - 'enqueue_time' => false + 'user_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'enqueue_time' => 'enqueueTime', 'user_email' => 'userEmail', - 'user_id' => 'userId', - 'enqueue_time' => 'enqueueTime' + 'user_id' => 'userId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'enqueue_time' => 'setEnqueueTime', 'user_email' => 'setUserEmail', - 'user_id' => 'setUserId', - 'enqueue_time' => 'setEnqueueTime' + 'user_id' => 'setUserId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'enqueue_time' => 'getEnqueueTime', 'user_email' => 'getUserEmail', - 'user_id' => 'getUserId', - 'enqueue_time' => 'getEnqueueTime' + 'user_id' => 'getUserId' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('enqueue_time', $data ?? [], null); $this->setIfExists('user_email', $data ?? [], null); $this->setIfExists('user_id', $data ?? [], null); - $this->setIfExists('enqueue_time', $data ?? [], null); } /** @@ -288,15 +288,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['enqueue_time'] === null) { + $invalidProperties[] = "'enqueue_time' can't be null"; + } if ($this->container['user_email'] === null) { $invalidProperties[] = "'user_email' can't be null"; } if ($this->container['user_id'] === null) { $invalidProperties[] = "'user_id' can't be null"; } - if ($this->container['enqueue_time'] === null) { - $invalidProperties[] = "'enqueue_time' can't be null"; - } return $invalidProperties; } @@ -312,6 +312,33 @@ public function valid() } + /** + * Gets enqueue_time + * + * @return \DateTime + */ + public function getEnqueueTime() + { + return $this->container['enqueue_time']; + } + + /** + * Sets enqueue_time + * + * @param \DateTime $enqueue_time enqueue_time + * + * @return self + */ + public function setEnqueueTime($enqueue_time) + { + if (is_null($enqueue_time)) { + throw new \InvalidArgumentException('non-nullable enqueue_time cannot be null'); + } + $this->container['enqueue_time'] = $enqueue_time; + + return $this; + } + /** * Gets user_email * @@ -325,7 +352,7 @@ public function getUserEmail() /** * Sets user_email * - * @param string $user_email user_email + * @param string $user_email Email of the user * * @return self */ @@ -352,7 +379,7 @@ public function getUserId() /** * Sets user_id * - * @param int $user_id user_id + * @param int $user_id ID of the user * * @return self */ @@ -365,41 +392,14 @@ public function setUserId($user_id) return $this; } - - /** - * Gets enqueue_time - * - * @return \DateTime - */ - public function getEnqueueTime() - { - return $this->container['enqueue_time']; - } - - /** - * Sets enqueue_time - * - * @param \DateTime $enqueue_time enqueue_time - * - * @return self - */ - public function setEnqueueTime($enqueue_time) - { - if (is_null($enqueue_time)) { - throw new \InvalidArgumentException('non-nullable enqueue_time cannot be null'); - } - $this->container['enqueue_time'] = $enqueue_time; - - 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]); } @@ -407,12 +407,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -437,11 +437,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Model/StandardError.php b/codegen/Crm/Associations/V4/Model/StandardError.php index 31f06469..4a4c3ba3 100644 --- a/codegen/Crm/Associations/V4/Model/StandardError.php +++ b/codegen/Crm/Associations/V4/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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\Associations\V4 * @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\Associations\V4\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\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\Associations\V4\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\Associations\V4\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\Associations\V4\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\Associations\V4\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/Associations/V4/ObjectSerializer.php b/codegen/Crm/Associations/V4/ObjectSerializer.php index af79a140..44fe7921 100644 --- a/codegen/Crm/Associations/V4/ObjectSerializer.php +++ b/codegen/Crm/Associations/V4/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4 @@ -13,11 +13,11 @@ /** * Associations * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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) : ''; } } diff --git a/codegen/Crm/Associations/V4/Schema/Api/DefinitionConfigurationsApi.php b/codegen/Crm/Associations/V4/Schema/Api/DefinitionConfigurationsApi.php index 5a912d0a..46892085 100644 --- a/codegen/Crm/Associations/V4/Schema/Api/DefinitionConfigurationsApi.php +++ b/codegen/Crm/Associations/V4/Schema/Api/DefinitionConfigurationsApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], - 'getAll' => [ + 'getPage' => [ 'application/json', ], - 'getAllBetweenTwoObjectTypes' => [ + 'getPageBetweenTwoObjectTypes' => [ 'application/json', ], ]; @@ -137,7 +140,7 @@ public function getConfig() /** * Operation batchCreate * - * Create + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) @@ -146,7 +149,7 @@ public function getConfig() * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ public function batchCreate($from_object_type, $to_object_type, $batch_input_public_association_definition_configuration_create_request, string $contentType = self::contentTypes['batchCreate'][0]) { @@ -157,7 +160,7 @@ public function batchCreate($from_object_type, $to_object_type, $batch_input_pub /** * Operation batchCreateWithHttpInfo * - * Create + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -166,7 +169,7 @@ public function batchCreate($from_object_type, $to_object_type, $batch_input_pub * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\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\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function batchCreateWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_definition_configuration_create_request, string $contentType = self::contentTypes['batchCreate'][0]) { @@ -196,89 +199,22 @@ public function batchCreateWithHttpInfo($from_object_type, $to_object_type, $bat switch($statusCode) { - case 201: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -292,52 +228,21 @@ public function batchCreateWithHttpInfo($from_object_type, $to_object_type, $bat ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration'; - 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\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfiguration', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -345,8 +250,10 @@ public function batchCreateWithHttpInfo($from_object_type, $to_object_type, $bat $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -354,7 +261,7 @@ public function batchCreateWithHttpInfo($from_object_type, $to_object_type, $bat /** * Operation batchCreateAsync * - * Create + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -377,7 +284,7 @@ function ($response) { /** * Operation batchCreateAsyncWithHttpInfo * - * Create + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -464,7 +371,7 @@ public function batchCreateRequest($from_object_type, $to_object_type, $batch_in } - $resourcePath = '/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/create'; + $resourcePath = '/crm/associations/v4/definitions/configurations/{fromObjectType}/{toObjectType}/batch/create'; $formParams = []; $queryParams = []; $headerParams = []; @@ -558,7 +465,7 @@ public function batchCreateRequest($from_object_type, $to_object_type, $batch_in /** * Operation batchRemove * - * Delete + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) @@ -567,17 +474,18 @@ public function batchCreateRequest($from_object_type, $to_object_type, $batch_in * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ public function batchRemove($from_object_type, $to_object_type, $batch_input_public_association_spec, string $contentType = self::contentTypes['batchRemove'][0]) { - $this->batchRemoveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_spec, $contentType); + list($response) = $this->batchRemoveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_spec, $contentType); + return $response; } /** * Operation batchRemoveWithHttpInfo * - * Delete + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -586,7 +494,7 @@ public function batchRemove($from_object_type, $to_object_type, $batch_input_pub * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponseVoid|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function batchRemoveWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_spec, string $contentType = self::contentTypes['batchRemove'][0]) { @@ -615,10 +523,51 @@ public function batchRemoveWithHttpInfo($from_object_type, $to_object_type, $bat $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponseVoid', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\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\Schema\Model\BatchResponseVoid', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponseVoid', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -626,8 +575,10 @@ public function batchRemoveWithHttpInfo($from_object_type, $to_object_type, $bat $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -635,7 +586,7 @@ public function batchRemoveWithHttpInfo($from_object_type, $to_object_type, $bat /** * Operation batchRemoveAsync * - * Delete + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -658,7 +609,7 @@ function ($response) { /** * Operation batchRemoveAsyncWithHttpInfo * - * Delete + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -670,14 +621,27 @@ function ($response) { */ public function batchRemoveAsyncWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_spec, string $contentType = self::contentTypes['batchRemove'][0]) { - $returnType = ''; + $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponseVoid'; $request = $this->batchRemoveRequest($from_object_type, $to_object_type, $batch_input_public_association_spec, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -732,7 +696,7 @@ public function batchRemoveRequest($from_object_type, $to_object_type, $batch_in } - $resourcePath = '/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/purge'; + $resourcePath = '/crm/associations/v4/definitions/configurations/{fromObjectType}/{toObjectType}/batch/purge'; $formParams = []; $queryParams = []; $headerParams = []; @@ -760,7 +724,7 @@ public function batchRemoveRequest($from_object_type, $to_object_type, $batch_in $headers = $this->headerSelector->selectHeaders( - ['*/*', ], + ['application/json', '*/*', ], $contentType, $multipart ); @@ -826,7 +790,7 @@ public function batchRemoveRequest($from_object_type, $to_object_type, $batch_in /** * Operation batchUpdate * - * Update + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) @@ -835,7 +799,7 @@ public function batchRemoveRequest($from_object_type, $to_object_type, $batch_in * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult|\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ public function batchUpdate($from_object_type, $to_object_type, $batch_input_public_association_definition_configuration_update_request, string $contentType = self::contentTypes['batchUpdate'][0]) { @@ -846,7 +810,7 @@ public function batchUpdate($from_object_type, $to_object_type, $batch_input_pub /** * Operation batchUpdateWithHttpInfo * - * Update + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -855,7 +819,7 @@ public function batchUpdate($from_object_type, $to_object_type, $batch_input_pub * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\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\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult|\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function batchUpdateWithHttpInfo($from_object_type, $to_object_type, $batch_input_public_association_definition_configuration_update_request, string $contentType = self::contentTypes['batchUpdate'][0]) { @@ -886,88 +850,21 @@ public function batchUpdateWithHttpInfo($from_object_type, $to_object_type, $bat switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 207: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -981,34 +878,11 @@ public function batchUpdateWithHttpInfo($from_object_type, $to_object_type, $bat ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult'; - 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\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResult', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1018,15 +892,7 @@ public function batchUpdateWithHttpInfo($from_object_type, $to_object_type, $bat $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - case 207: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Schema\Model\BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1034,8 +900,10 @@ public function batchUpdateWithHttpInfo($from_object_type, $to_object_type, $bat $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1043,7 +911,7 @@ public function batchUpdateWithHttpInfo($from_object_type, $to_object_type, $bat /** * Operation batchUpdateAsync * - * Update + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1066,7 +934,7 @@ function ($response) { /** * Operation batchUpdateAsyncWithHttpInfo * - * Update + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1153,7 +1021,7 @@ public function batchUpdateRequest($from_object_type, $to_object_type, $batch_in } - $resourcePath = '/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}/batch/update'; + $resourcePath = '/crm/associations/v4/definitions/configurations/{fromObjectType}/{toObjectType}/batch/update'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1245,36 +1113,36 @@ public function batchUpdateRequest($from_object_type, $to_object_type, $batch_in } /** - * Operation getAll + * Operation getPage * - * Read All + * * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @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\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ - public function getAll(string $contentType = self::contentTypes['getAll'][0]) + public function getPage(string $contentType = self::contentTypes['getPage'][0]) { - list($response) = $this->getAllWithHttpInfo($contentType); + list($response) = $this->getPageWithHttpInfo($contentType); return $response; } /** - * Operation getAllWithHttpInfo + * Operation getPageWithHttpInfo * - * Read All + * * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @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\Associations\V4\Schema\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\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAllWithHttpInfo(string $contentType = self::contentTypes['getAll'][0]) + public function getPageWithHttpInfo(string $contentType = self::contentTypes['getPage'][0]) { - $request = $this->getAllRequest($contentType); + $request = $this->getPageRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1301,61 +1169,21 @@ public function getAllWithHttpInfo(string $contentType = self::contentTypes['get switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1369,44 +1197,21 @@ public function getAllWithHttpInfo(string $contentType = self::contentTypes['get ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging'; - 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\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging', + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1414,25 +1219,27 @@ public function getAllWithHttpInfo(string $contentType = self::contentTypes['get $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllAsync + * Operation getPageAsync * - * Read All + * * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAsync(string $contentType = self::contentTypes['getAll'][0]) + public function getPageAsync(string $contentType = self::contentTypes['getPage'][0]) { - return $this->getAllAsyncWithHttpInfo($contentType) + return $this->getPageAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1441,19 +1248,19 @@ function ($response) { } /** - * Operation getAllAsyncWithHttpInfo + * Operation getPageAsyncWithHttpInfo * - * Read All + * * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAsyncWithHttpInfo(string $contentType = self::contentTypes['getAll'][0]) + public function getPageAsyncWithHttpInfo(string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging'; - $request = $this->getAllRequest($contentType); + $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration'; + $request = $this->getPageRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1492,18 +1299,18 @@ function ($exception) { } /** - * Create request for operation 'getAll' + * Create request for operation 'getPage' * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAllRequest(string $contentType = self::contentTypes['getAll'][0]) + public function getPageRequest(string $contentType = self::contentTypes['getPage'][0]) { - $resourcePath = '/crm/v4/associations/definitions/configurations/all'; + $resourcePath = '/crm/associations/v4/definitions/configurations/all'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1572,40 +1379,40 @@ public function getAllRequest(string $contentType = self::contentTypes['getAll'] } /** - * Operation getAllBetweenTwoObjectTypes + * Operation getPageBetweenTwoObjectTypes * - * Read + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllBetweenTwoObjectTypes'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageBetweenTwoObjectTypes'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ - public function getAllBetweenTwoObjectTypes($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAllBetweenTwoObjectTypes'][0]) + public function getPageBetweenTwoObjectTypes($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPageBetweenTwoObjectTypes'][0]) { - list($response) = $this->getAllBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_object_type, $contentType); + list($response) = $this->getPageBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_object_type, $contentType); return $response; } /** - * Operation getAllBetweenTwoObjectTypesWithHttpInfo + * Operation getPageBetweenTwoObjectTypesWithHttpInfo * - * Read + * * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllBetweenTwoObjectTypes'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageBetweenTwoObjectTypes'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\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\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAllBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAllBetweenTwoObjectTypes'][0]) + public function getPageBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPageBetweenTwoObjectTypes'][0]) { - $request = $this->getAllBetweenTwoObjectTypesRequest($from_object_type, $to_object_type, $contentType); + $request = $this->getPageBetweenTwoObjectTypesRequest($from_object_type, $to_object_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -1632,61 +1439,21 @@ public function getAllBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_o switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1700,44 +1467,21 @@ public function getAllBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_o ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging'; - 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\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging', + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1745,27 +1489,29 @@ public function getAllBetweenTwoObjectTypesWithHttpInfo($from_object_type, $to_o $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllBetweenTwoObjectTypesAsync + * Operation getPageBetweenTwoObjectTypesAsync * - * Read + * * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllBetweenTwoObjectTypes'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageBetweenTwoObjectTypes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllBetweenTwoObjectTypesAsync($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAllBetweenTwoObjectTypes'][0]) + public function getPageBetweenTwoObjectTypesAsync($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPageBetweenTwoObjectTypes'][0]) { - return $this->getAllBetweenTwoObjectTypesAsyncWithHttpInfo($from_object_type, $to_object_type, $contentType) + return $this->getPageBetweenTwoObjectTypesAsyncWithHttpInfo($from_object_type, $to_object_type, $contentType) ->then( function ($response) { return $response[0]; @@ -1774,21 +1520,21 @@ function ($response) { } /** - * Operation getAllBetweenTwoObjectTypesAsyncWithHttpInfo + * Operation getPageBetweenTwoObjectTypesAsyncWithHttpInfo * - * Read + * * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllBetweenTwoObjectTypes'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageBetweenTwoObjectTypes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllBetweenTwoObjectTypesAsyncWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAllBetweenTwoObjectTypes'][0]) + public function getPageBetweenTwoObjectTypesAsyncWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPageBetweenTwoObjectTypes'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging'; - $request = $this->getAllBetweenTwoObjectTypesRequest($from_object_type, $to_object_type, $contentType); + $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponsePublicAssociationDefinitionUserConfiguration'; + $request = $this->getPageBetweenTwoObjectTypesRequest($from_object_type, $to_object_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1827,34 +1573,34 @@ function ($exception) { } /** - * Create request for operation 'getAllBetweenTwoObjectTypes' + * Create request for operation 'getPageBetweenTwoObjectTypes' * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllBetweenTwoObjectTypes'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageBetweenTwoObjectTypes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAllBetweenTwoObjectTypesRequest($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAllBetweenTwoObjectTypes'][0]) + public function getPageBetweenTwoObjectTypesRequest($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPageBetweenTwoObjectTypes'][0]) { // verify the required parameter 'from_object_type' is set if ($from_object_type === null || (is_array($from_object_type) && count($from_object_type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from_object_type when calling getAllBetweenTwoObjectTypes' + 'Missing the required parameter $from_object_type when calling getPageBetweenTwoObjectTypes' ); } // verify the required parameter 'to_object_type' is set if ($to_object_type === null || (is_array($to_object_type) && count($to_object_type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to_object_type when calling getAllBetweenTwoObjectTypes' + 'Missing the required parameter $to_object_type when calling getPageBetweenTwoObjectTypes' ); } - $resourcePath = '/crm/v4/associations/definitions/configurations/{fromObjectType}/{toObjectType}'; + $resourcePath = '/crm/associations/v4/definitions/configurations/{fromObjectType}/{toObjectType}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1954,6 +1700,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/Associations/V4/Schema/Api/DefinitionsApi.php b/codegen/Crm/Associations/V4/Schema/Api/DefinitionsApi.php index f94bce01..5a0f5fe5 100644 --- a/codegen/Crm/Associations/V4/Schema/Api/DefinitionsApi.php +++ b/codegen/Crm/Associations/V4/Schema/Api/DefinitionsApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], - 'getAll' => [ + 'getPage' => [ 'application/json', ], 'remove' => [ @@ -134,7 +137,7 @@ public function getConfig() /** * Operation create * - * Create + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) @@ -143,7 +146,7 @@ public function getConfig() * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ public function create($from_object_type, $to_object_type, $public_association_definition_create_request, string $contentType = self::contentTypes['create'][0]) { @@ -154,7 +157,7 @@ public function create($from_object_type, $to_object_type, $public_association_d /** * Operation createWithHttpInfo * - * Create + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -163,7 +166,7 @@ public function create($from_object_type, $to_object_type, $public_association_d * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\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\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($from_object_type, $to_object_type, $public_association_definition_create_request, string $contentType = self::contentTypes['create'][0]) { @@ -194,61 +197,21 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $public_a switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -262,44 +225,21 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $public_a ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging'; - 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\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging', + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -307,8 +247,10 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $public_a $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -316,7 +258,7 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $public_a /** * Operation createAsync * - * Create + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -339,7 +281,7 @@ function ($response) { /** * Operation createAsyncWithHttpInfo * - * Create + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -351,7 +293,7 @@ function ($response) { */ public function createAsyncWithHttpInfo($from_object_type, $to_object_type, $public_association_definition_create_request, string $contentType = self::contentTypes['create'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging'; + $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel'; $request = $this->createRequest($from_object_type, $to_object_type, $public_association_definition_create_request, $contentType); return $this->client @@ -426,7 +368,7 @@ public function createRequest($from_object_type, $to_object_type, $public_associ } - $resourcePath = '/crm/v4/associations/{fromObjectType}/{toObjectType}/labels'; + $resourcePath = '/crm/associations/v4/{fromObjectType}/{toObjectType}/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -518,40 +460,40 @@ public function createRequest($from_object_type, $to_object_type, $public_associ } /** - * Operation getAll + * Operation getPage * - * Read + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @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\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error */ - public function getAll($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAll'][0]) + public function getPage($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPage'][0]) { - list($response) = $this->getAllWithHttpInfo($from_object_type, $to_object_type, $contentType); + list($response) = $this->getPageWithHttpInfo($from_object_type, $to_object_type, $contentType); return $response; } /** - * Operation getAllWithHttpInfo + * Operation getPageWithHttpInfo * - * Read + * * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @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\Associations\V4\Schema\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\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel|\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAllWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAll'][0]) + public function getPageWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPage'][0]) { - $request = $this->getAllRequest($from_object_type, $to_object_type, $contentType); + $request = $this->getPageRequest($from_object_type, $to_object_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -578,61 +520,21 @@ public function getAllWithHttpInfo($from_object_type, $to_object_type, string $c switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -646,44 +548,21 @@ public function getAllWithHttpInfo($from_object_type, $to_object_type, string $c ); } - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging'; - 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\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging', + '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -691,27 +570,29 @@ public function getAllWithHttpInfo($from_object_type, $to_object_type, string $c $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllAsync + * Operation getPageAsync * - * Read + * * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAsync($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAll'][0]) + public function getPageAsync($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPage'][0]) { - return $this->getAllAsyncWithHttpInfo($from_object_type, $to_object_type, $contentType) + return $this->getPageAsyncWithHttpInfo($from_object_type, $to_object_type, $contentType) ->then( function ($response) { return $response[0]; @@ -720,21 +601,21 @@ function ($response) { } /** - * Operation getAllAsyncWithHttpInfo + * Operation getPageAsyncWithHttpInfo * - * Read + * * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAsyncWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAll'][0]) + public function getPageAsyncWithHttpInfo($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPage'][0]) { - $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabelNoPaging'; - $request = $this->getAllRequest($from_object_type, $to_object_type, $contentType); + $returnType = '\HubSpot\Client\Crm\Associations\V4\Schema\Model\CollectionResponseAssociationSpecWithLabel'; + $request = $this->getPageRequest($from_object_type, $to_object_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -773,34 +654,34 @@ function ($exception) { } /** - * Create request for operation 'getAll' + * Create request for operation 'getPage' * * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAllRequest($from_object_type, $to_object_type, string $contentType = self::contentTypes['getAll'][0]) + public function getPageRequest($from_object_type, $to_object_type, string $contentType = self::contentTypes['getPage'][0]) { // verify the required parameter 'from_object_type' is set if ($from_object_type === null || (is_array($from_object_type) && count($from_object_type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from_object_type when calling getAll' + 'Missing the required parameter $from_object_type when calling getPage' ); } // verify the required parameter 'to_object_type' is set if ($to_object_type === null || (is_array($to_object_type) && count($to_object_type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to_object_type when calling getAll' + 'Missing the required parameter $to_object_type when calling getPage' ); } - $resourcePath = '/crm/v4/associations/{fromObjectType}/{toObjectType}/labels'; + $resourcePath = '/crm/associations/v4/{fromObjectType}/{toObjectType}/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -887,39 +768,39 @@ public function getAllRequest($from_object_type, $to_object_type, string $conten /** * Operation remove * - * Delete + * * + * @param int $association_type_id association_type_id (required) * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) - * @param int $association_type_id association_type_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ - public function remove($from_object_type, $to_object_type, $association_type_id, string $contentType = self::contentTypes['remove'][0]) + public function remove($association_type_id, $from_object_type, $to_object_type, string $contentType = self::contentTypes['remove'][0]) { - $this->removeWithHttpInfo($from_object_type, $to_object_type, $association_type_id, $contentType); + $this->removeWithHttpInfo($association_type_id, $from_object_type, $to_object_type, $contentType); } /** * Operation removeWithHttpInfo * - * Delete + * * + * @param int $association_type_id (required) * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param int $association_type_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Associations\V4\Schema\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function removeWithHttpInfo($from_object_type, $to_object_type, $association_type_id, string $contentType = self::contentTypes['remove'][0]) + public function removeWithHttpInfo($association_type_id, $from_object_type, $to_object_type, string $contentType = self::contentTypes['remove'][0]) { - $request = $this->removeRequest($from_object_type, $to_object_type, $association_type_id, $contentType); + $request = $this->removeRequest($association_type_id, $from_object_type, $to_object_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -945,7 +826,6 @@ public function removeWithHttpInfo($from_object_type, $to_object_type, $associat return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -955,8 +835,10 @@ public function removeWithHttpInfo($from_object_type, $to_object_type, $associat $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -964,19 +846,19 @@ public function removeWithHttpInfo($from_object_type, $to_object_type, $associat /** * Operation removeAsync * - * Delete + * * + * @param int $association_type_id (required) * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param int $association_type_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeAsync($from_object_type, $to_object_type, $association_type_id, string $contentType = self::contentTypes['remove'][0]) + public function removeAsync($association_type_id, $from_object_type, $to_object_type, string $contentType = self::contentTypes['remove'][0]) { - return $this->removeAsyncWithHttpInfo($from_object_type, $to_object_type, $association_type_id, $contentType) + return $this->removeAsyncWithHttpInfo($association_type_id, $from_object_type, $to_object_type, $contentType) ->then( function ($response) { return $response[0]; @@ -987,20 +869,20 @@ function ($response) { /** * Operation removeAsyncWithHttpInfo * - * Delete + * * + * @param int $association_type_id (required) * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param int $association_type_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeAsyncWithHttpInfo($from_object_type, $to_object_type, $association_type_id, string $contentType = self::contentTypes['remove'][0]) + public function removeAsyncWithHttpInfo($association_type_id, $from_object_type, $to_object_type, string $contentType = self::contentTypes['remove'][0]) { $returnType = ''; - $request = $this->removeRequest($from_object_type, $to_object_type, $association_type_id, $contentType); + $request = $this->removeRequest($association_type_id, $from_object_type, $to_object_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1028,17 +910,24 @@ function ($exception) { /** * Create request for operation 'remove' * + * @param int $association_type_id (required) * @param string $from_object_type (required) * @param string $to_object_type (required) - * @param int $association_type_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function removeRequest($from_object_type, $to_object_type, $association_type_id, string $contentType = self::contentTypes['remove'][0]) + public function removeRequest($association_type_id, $from_object_type, $to_object_type, string $contentType = self::contentTypes['remove'][0]) { + // verify the required parameter 'association_type_id' is set + if ($association_type_id === null || (is_array($association_type_id) && count($association_type_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $association_type_id when calling remove' + ); + } + // verify the required parameter 'from_object_type' is set if ($from_object_type === null || (is_array($from_object_type) && count($from_object_type) === 0)) { throw new \InvalidArgumentException( @@ -1053,15 +942,8 @@ public function removeRequest($from_object_type, $to_object_type, $association_t ); } - // verify the required parameter 'association_type_id' is set - if ($association_type_id === null || (is_array($association_type_id) && count($association_type_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $association_type_id when calling remove' - ); - } - - $resourcePath = '/crm/v4/associations/{fromObjectType}/{toObjectType}/labels/{associationTypeId}'; + $resourcePath = '/crm/associations/v4/{fromObjectType}/{toObjectType}/labels/{associationTypeId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1070,6 +952,14 @@ public function removeRequest($from_object_type, $to_object_type, $association_t + // path params + if ($association_type_id !== null) { + $resourcePath = str_replace( + '{' . 'associationTypeId' . '}', + ObjectSerializer::toPathValue($association_type_id), + $resourcePath + ); + } // path params if ($from_object_type !== null) { $resourcePath = str_replace( @@ -1086,14 +976,6 @@ public function removeRequest($from_object_type, $to_object_type, $association_t $resourcePath ); } - // path params - if ($association_type_id !== null) { - $resourcePath = str_replace( - '{' . 'associationTypeId' . '}', - ObjectSerializer::toPathValue($association_type_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( @@ -1156,7 +1038,7 @@ public function removeRequest($from_object_type, $to_object_type, $association_t /** * Operation update * - * Update + * * * @param string $from_object_type from_object_type (required) * @param string $to_object_type to_object_type (required) @@ -1175,7 +1057,7 @@ public function update($from_object_type, $to_object_type, $public_association_d /** * Operation updateWithHttpInfo * - * Update + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1214,7 +1096,6 @@ public function updateWithHttpInfo($from_object_type, $to_object_type, $public_a return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -1224,8 +1105,10 @@ public function updateWithHttpInfo($from_object_type, $to_object_type, $public_a $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1233,7 +1116,7 @@ public function updateWithHttpInfo($from_object_type, $to_object_type, $public_a /** * Operation updateAsync * - * Update + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1256,7 +1139,7 @@ function ($response) { /** * Operation updateAsyncWithHttpInfo * - * Update + * * * @param string $from_object_type (required) * @param string $to_object_type (required) @@ -1330,7 +1213,7 @@ public function updateRequest($from_object_type, $to_object_type, $public_associ } - $resourcePath = '/crm/v4/associations/{fromObjectType}/{toObjectType}/labels'; + $resourcePath = '/crm/associations/v4/{fromObjectType}/{toObjectType}/labels'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1437,6 +1320,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/Associations/V4/Schema/ApiException.php b/codegen/Crm/Associations/V4/Schema/ApiException.php index 9478127b..da9a8c17 100644 --- a/codegen/Crm/Associations/V4/Schema/ApiException.php +++ b/codegen/Crm/Associations/V4/Schema/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/Associations/V4/Schema/FormDataProcessor.php b/codegen/Crm/Associations/V4/Schema/FormDataProcessor.php new file mode 100644 index 00000000..02eb6d51 --- /dev/null +++ b/codegen/Crm/Associations/V4/Schema/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/Associations/V4/Schema/HeaderSelector.php b/codegen/Crm/Associations/V4/Schema/HeaderSelector.php index 433c70b9..f8c6f8bc 100644 --- a/codegen/Crm/Associations/V4/Schema/HeaderSelector.php +++ b/codegen/Crm/Associations/V4/Schema/HeaderSelector.php @@ -1,7 +1,7 @@ 'int', + 'category' => 'string', 'label' => 'string', - 'category' => 'string' + 'type_id' => 'int' ]; /** @@ -70,9 +70,9 @@ class AssociationSpecWithLabel implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'type_id' => 'int32', + 'category' => null, 'label' => null, - 'category' => null + 'type_id' => 'int32' ]; /** @@ -81,9 +81,9 @@ class AssociationSpecWithLabel implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'type_id' => false, + 'category' => false, 'label' => false, - 'category' => false + 'type_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type_id' => 'typeId', + 'category' => 'category', 'label' => 'label', - 'category' => 'category' + 'type_id' => 'typeId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type_id' => 'setTypeId', + 'category' => 'setCategory', 'label' => 'setLabel', - 'category' => 'setCategory' + 'type_id' => 'setTypeId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type_id' => 'getTypeId', + 'category' => 'getCategory', 'label' => 'getLabel', - 'category' => 'getCategory' + 'type_id' => 'getTypeId' ]; /** @@ -241,8 +241,8 @@ public function getModelName() } public const CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -253,8 +253,8 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_HUBSPOT_DEFINED, - self::CATEGORY_USER_DEFINED, self::CATEGORY_INTEGRATOR_DEFINED, + self::CATEGORY_USER_DEFINED, ]; } @@ -273,9 +273,9 @@ public function getCategoryAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('type_id', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); } /** @@ -305,9 +305,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } @@ -320,6 +317,9 @@ public function listInvalidProperties() ); } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -336,28 +336,38 @@ public function valid() /** - * Gets type_id + * Gets category * - * @return int + * @return string */ - public function getTypeId() + public function getCategory() { - return $this->container['type_id']; + return $this->container['category']; } /** - * Sets type_id + * Sets category * - * @param int $type_id type_id + * @param string $category category * * @return self */ - public function setTypeId($type_id) + public function setCategory($category) { - if (is_null($type_id)) { - throw new \InvalidArgumentException('non-nullable type_id cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['type_id'] = $type_id; + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; return $this; } @@ -390,49 +400,39 @@ public function setLabel($label) } /** - * Gets category + * Gets type_id * - * @return string + * @return int */ - public function getCategory() + public function getTypeId() { - return $this->container['category']; + return $this->container['type_id']; } /** - * Sets category + * Sets type_id * - * @param string $category category + * @param int $type_id type_id * * @return self */ - public function setCategory($category) + public function setTypeId($type_id) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($category, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'category', must be one of '%s'", - $category, - implode("', '", $allowedValues) - ) - ); + if (is_null($type_id)) { + throw new \InvalidArgumentException('non-nullable type_id cannot be null'); } - $this->container['category'] = $category; + $this->container['type_id'] = $type_id; 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]); } @@ -440,12 +440,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -470,11 +470,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationCreateRequest.php b/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationCreateRequest.php index c5d8cf4f..a9da87ba 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationCreateRequest.php +++ b/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationCreateRequest.php @@ -2,7 +2,7 @@ /** * BatchInputPublicAssociationDefinitionConfigurationCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationUpdateRequest.php b/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationUpdateRequest.php index 3710d042..a2b5a6de 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationUpdateRequest.php +++ b/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationDefinitionConfigurationUpdateRequest.php @@ -2,7 +2,7 @@ /** * BatchInputPublicAssociationDefinitionConfigurationUpdateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Schema/Model/BatchInputPublicAssociationSpec.php b/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationSpec.php index 7562adee..92e96596 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationSpec.php +++ b/codegen/Crm/Associations/V4/Schema/Model/BatchInputPublicAssociationSpec.php @@ -2,7 +2,7 @@ /** * BatchInputPublicAssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResult.php b/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResult.php index 7f01f8bc..b05eca23 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResult.php +++ b/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResult.php @@ -2,7 +2,7 @@ /** * BatchResponsePublicAssociationDefinitionConfigurationUpdateResult * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -58,10 +58,12 @@ class BatchResponsePublicAssociationDefinitionConfigurationUpdateResult implemen */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionConfigurationUpdateResult[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +76,12 @@ class BatchResponsePublicAssociationDefinitionConfigurationUpdateResult implemen */ 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 +92,12 @@ class BatchResponsePublicAssociationDefinitionConfigurationUpdateResult implemen */ 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 +188,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 +204,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 +220,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 +270,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 +283,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 +306,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 +345,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"; } @@ -392,82 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\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 links * * @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 num_errors * * @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 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; } @@ -499,6 +540,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 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 * @@ -538,11 +606,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 +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; } @@ -580,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/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors.php b/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors.php deleted file mode 100644 index 4f286317..00000000 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors.php +++ /dev/null @@ -1,697 +0,0 @@ - - */ -class BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'BatchResponsePublicAssociationDefinitionConfigurationUpdateResultWithErrors'; - - /** - * 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\Associations\V4\Schema\Model\PublicAssociationDefinitionConfigurationUpdateResult[]', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\PublicAssociationDefinitionConfigurationUpdateResult[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionConfigurationUpdateResult[] $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\Associations\V4\Schema\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Associations\V4\Schema\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/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfiguration.php b/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfiguration.php index 164c855d..38c16920 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfiguration.php +++ b/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfiguration.php @@ -2,7 +2,7 @@ /** * BatchResponsePublicAssociationDefinitionUserConfiguration * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -58,10 +58,12 @@ class BatchResponsePublicAssociationDefinitionUserConfiguration implements Model */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]', 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionUserConfiguration[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +76,12 @@ class BatchResponsePublicAssociationDefinitionUserConfiguration implements Model */ 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 +92,12 @@ class BatchResponsePublicAssociationDefinitionUserConfiguration implements Model */ 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 +188,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 +204,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 +220,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 +270,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 +283,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 +306,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 +345,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"; } @@ -392,82 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets errors * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\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 links * * @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 num_errors * * @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 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; } @@ -499,6 +540,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 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 * @@ -538,11 +606,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 +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; } @@ -580,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/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors.php b/codegen/Crm/Associations/V4/Schema/Model/BatchResponseVoid.php similarity index 93% rename from codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors.php rename to codegen/Crm/Associations/V4/Schema/Model/BatchResponseVoid.php index c5e39c3d..4170bdae 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors.php +++ b/codegen/Crm/Associations/V4/Schema/Model/BatchResponseVoid.php @@ -1,8 +1,8 @@ */ -class BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable +class BatchResponseVoid implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors implem * * @var string */ - protected static $openAPIModelName = 'BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors'; + protected static $openAPIModelName = 'BatchResponseVoid'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,12 +58,12 @@ class BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors implem */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]', + 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', + 'results' => 'mixed[]', 'started_at' => '\DateTime', - 'links' => 'array', - 'results' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionUserConfiguration[]', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]', 'status' => 'string' ]; @@ -76,12 +76,12 @@ class BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors implem */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', + 'errors' => null, + 'links' => null, 'num_errors' => 'int32', 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, 'results' => null, - 'errors' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -92,12 +92,12 @@ class BatchResponsePublicAssociationDefinitionUserConfigurationWithErrors implem */ protected static array $openAPINullables = [ 'completed_at' => false, + 'errors' => false, + 'links' => false, 'num_errors' => false, 'requested_at' => false, - 'started_at' => false, - 'links' => false, 'results' => false, - 'errors' => false, + 'started_at' => false, 'status' => false ]; @@ -188,12 +188,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', + 'errors' => 'errors', + 'links' => 'links', 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', 'results' => 'results', - 'errors' => 'errors', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -204,12 +204,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', 'results' => 'setResults', - 'errors' => 'setErrors', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -220,12 +220,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', 'results' => 'getResults', - 'errors' => 'getErrors', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -270,10 +270,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 @@ -283,10 +283,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, ]; } @@ -306,12 +306,12 @@ 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('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -345,12 +345,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"; } @@ -406,109 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets num_errors + * Gets errors * - * @return int|null + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]|null */ - public function getNumErrors() + public function getErrors() { - return $this->container['num_errors']; + return $this->container['errors']; } /** - * Sets num_errors + * Sets errors * - * @param int|null $num_errors num_errors + * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]|null $errors errors * * @return self */ - public function setNumErrors($num_errors) + public function setErrors($errors) { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['num_errors'] = $num_errors; + $this->container['errors'] = $errors; return $this; } /** - * Gets requested_at + * Gets links * - * @return \DateTime|null + * @return array|null */ - public function getRequestedAt() + public function getLinks() { - return $this->container['requested_at']; + return $this->container['links']; } /** - * Sets requested_at + * Sets links * - * @param \DateTime|null $requested_at requested_at + * @param array|null $links links * * @return self */ - public function setRequestedAt($requested_at) + public function setLinks($links) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['links'] = $links; return $this; } /** - * Gets started_at + * Gets num_errors * - * @return \DateTime + * @return int|null */ - public function getStartedAt() + public function getNumErrors() { - return $this->container['started_at']; + return $this->container['num_errors']; } /** - * Sets started_at + * Sets num_errors * - * @param \DateTime $started_at started_at + * @param int|null $num_errors num_errors * * @return self */ - public function setStartedAt($started_at) + public function setNumErrors($num_errors) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['num_errors'] = $num_errors; return $this; } /** - * Gets links + * Gets requested_at * - * @return array|null + * @return \DateTime|null */ - public function getLinks() + public function getRequestedAt() { - return $this->container['links']; + return $this->container['requested_at']; } /** - * Sets links + * Sets requested_at * - * @param array|null $links links + * @param \DateTime|null $requested_at requested_at * * @return self */ - public function setLinks($links) + public function setRequestedAt($requested_at) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); } - $this->container['links'] = $links; + $this->container['requested_at'] = $requested_at; return $this; } @@ -516,7 +516,7 @@ public function setLinks($links) /** * Gets results * - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionUserConfiguration[] + * @return mixed[] */ public function getResults() { @@ -526,7 +526,7 @@ public function getResults() /** * Sets results * - * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionUserConfiguration[] $results results + * @param mixed[] $results results * * @return self */ @@ -541,28 +541,28 @@ public function setResults($results) } /** - * Gets errors + * Gets started_at * - * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]|null + * @return \DateTime */ - public function getErrors() + public function getStartedAt() { - return $this->container['errors']; + return $this->container['started_at']; } /** - * Sets errors + * Sets started_at * - * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\StandardError[]|null $errors errors + * @param \DateTime $started_at started_at * * @return self */ - public function setErrors($errors) + public function setStartedAt($started_at) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['errors'] = $errors; + $this->container['started_at'] = $started_at; return $this; } @@ -606,11 +606,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]); } @@ -618,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; } @@ -648,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/Associations/V4/Schema/Model/CollectionResponseAssociationSpecWithLabelNoPaging.php b/codegen/Crm/Associations/V4/Schema/Model/CollectionResponseAssociationSpecWithLabel.php similarity index 86% rename from codegen/Crm/Associations/V4/Schema/Model/CollectionResponseAssociationSpecWithLabelNoPaging.php rename to codegen/Crm/Associations/V4/Schema/Model/CollectionResponseAssociationSpecWithLabel.php index 6dc5173b..057354b5 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/CollectionResponseAssociationSpecWithLabelNoPaging.php +++ b/codegen/Crm/Associations/V4/Schema/Model/CollectionResponseAssociationSpecWithLabel.php @@ -1,8 +1,8 @@ */ -class CollectionResponseAssociationSpecWithLabelNoPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponseAssociationSpecWithLabel implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponseAssociationSpecWithLabelNoPaging implements ModelInterfa * * @var string */ - protected static $openAPIModelName = 'CollectionResponseAssociationSpecWithLabelNoPaging'; + protected static $openAPIModelName = 'CollectionResponseAssociationSpecWithLabel'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,6 +57,7 @@ class CollectionResponseAssociationSpecWithLabelNoPaging implements ModelInterfa * @var string[] */ protected static $openAPITypes = [ + 'paging' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Paging', 'results' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\AssociationSpecWithLabel[]' ]; @@ -68,6 +69,7 @@ class CollectionResponseAssociationSpecWithLabelNoPaging implements ModelInterfa * @psalm-var array */ protected static $openAPIFormats = [ + 'paging' => null, 'results' => null ]; @@ -77,6 +79,7 @@ class CollectionResponseAssociationSpecWithLabelNoPaging implements ModelInterfa * @var boolean[] */ protected static array $openAPINullables = [ + 'paging' => false, 'results' => false ]; @@ -166,6 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'paging' => 'paging', 'results' => 'results' ]; @@ -175,6 +179,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'paging' => 'setPaging', 'results' => 'setResults' ]; @@ -184,6 +189,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'paging' => 'getPaging', 'results' => 'getResults' ]; @@ -244,6 +250,7 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); } @@ -292,6 +299,33 @@ public function valid() } + /** + * Gets paging + * + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\Paging|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\Paging|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** * Gets results * @@ -321,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]); } @@ -333,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; } @@ -363,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/Associations/V4/Schema/Model/CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging.php b/codegen/Crm/Associations/V4/Schema/Model/CollectionResponsePublicAssociationDefinitionUserConfiguration.php similarity index 87% rename from codegen/Crm/Associations/V4/Schema/Model/CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging.php rename to codegen/Crm/Associations/V4/Schema/Model/CollectionResponsePublicAssociationDefinitionUserConfiguration.php index bf052031..779b0593 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging.php +++ b/codegen/Crm/Associations/V4/Schema/Model/CollectionResponsePublicAssociationDefinitionUserConfiguration.php @@ -1,8 +1,8 @@ */ -class CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class CollectionResponsePublicAssociationDefinitionUserConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging imp * * @var string */ - protected static $openAPIModelName = 'CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging'; + protected static $openAPIModelName = 'CollectionResponsePublicAssociationDefinitionUserConfiguration'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,6 +57,7 @@ class CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging imp * @var string[] */ protected static $openAPITypes = [ + 'paging' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\Paging', 'results' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\PublicAssociationDefinitionUserConfiguration[]' ]; @@ -68,6 +69,7 @@ class CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging imp * @psalm-var array */ protected static $openAPIFormats = [ + 'paging' => null, 'results' => null ]; @@ -77,6 +79,7 @@ class CollectionResponsePublicAssociationDefinitionUserConfigurationNoPaging imp * @var boolean[] */ protected static array $openAPINullables = [ + 'paging' => false, 'results' => false ]; @@ -166,6 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'paging' => 'paging', 'results' => 'results' ]; @@ -175,6 +179,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'paging' => 'setPaging', 'results' => 'setResults' ]; @@ -184,6 +189,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'paging' => 'getPaging', 'results' => 'getResults' ]; @@ -244,6 +250,7 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); } @@ -292,6 +299,33 @@ public function valid() } + /** + * Gets paging + * + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\Paging|null + */ + public function getPaging() + { + return $this->container['paging']; + } + + /** + * Sets paging + * + * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\Paging|null $paging paging + * + * @return self + */ + public function setPaging($paging) + { + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); + } + $this->container['paging'] = $paging; + + return $this; + } + /** * Gets results * @@ -321,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]); } @@ -333,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; } @@ -363,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/Associations/V4/Schema/Model/Error.php b/codegen/Crm/Associations/V4/Schema/Model/Error.php index 7febde38..22693634 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/Error.php +++ b/codegen/Crm/Associations/V4/Schema/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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\Associations\V4\Schema\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\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\Associations\V4\Schema\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/Associations/V4/Schema/Model/ErrorDetail.php b/codegen/Crm/Associations/V4/Schema/Model/ErrorDetail.php index 369123ed..1c3eda43 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/ErrorDetail.php +++ b/codegen/Crm/Associations/V4/Schema/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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/Associations/V4/Schema/Model/ModelInterface.php b/codegen/Crm/Associations/V4/Schema/Model/ModelInterface.php index 42b7ace9..0914812a 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/ModelInterface.php +++ b/codegen/Crm/Associations/V4/Schema/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema\Model @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** diff --git a/codegen/Crm/Associations/V4/Schema/Model/NextPage.php b/codegen/Crm/Associations/V4/Schema/Model/NextPage.php new file mode 100644 index 00000000..a3d5d1a1 --- /dev/null +++ b/codegen/Crm/Associations/V4/Schema/Model/NextPage.php @@ -0,0 +1,447 @@ + + */ +class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NextPage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'after' => 'string', + 'link' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'after' => null, + 'link' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'after' => false, + 'link' => 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 = [ + 'after' => 'after', + 'link' => 'link' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'after' => 'setAfter', + 'link' => 'setLink' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'after' => 'getAfter', + 'link' => 'getLink' + ]; + + /** + * 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('after', $data ?? [], null); + $this->setIfExists('link', $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['after'] === null) { + $invalidProperties[] = "'after' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets after + * + * @return string + */ + public function getAfter() + { + return $this->container['after']; + } + + /** + * Sets after + * + * @param string $after A paging cursor token for retrieving subsequent pages. + * + * @return self + */ + public function setAfter($after) + { + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); + } + $this->container['after'] = $after; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link A URL that can be used to retrieve the next page results. + * + * @return self + */ + public function setLink($link) + { + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); + } + $this->container['link'] = $link; + + 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/ForwardPaging.php b/codegen/Crm/Associations/V4/Schema/Model/Paging.php similarity index 80% rename from codegen/Crm/Associations/V4/Model/ForwardPaging.php rename to codegen/Crm/Associations/V4/Schema/Model/Paging.php index fded0c7b..ed1893c2 100644 --- a/codegen/Crm/Associations/V4/Model/ForwardPaging.php +++ b/codegen/Crm/Associations/V4/Schema/Model/Paging.php @@ -1,23 +1,23 @@ */ -class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable +class Paging implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'ForwardPaging'; + protected static $openAPIModelName = 'Paging'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,8 @@ class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'next' => '\HubSpot\Client\Crm\Associations\V4\Model\NextPage' + 'next' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\NextPage', + 'prev' => '\HubSpot\Client\Crm\Associations\V4\Schema\Model\PreviousPage' ]; /** @@ -68,7 +69,8 @@ class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'next' => null + 'next' => null, + 'prev' => null ]; /** @@ -77,7 +79,8 @@ class ForwardPaging implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'next' => false + 'next' => false, + 'prev' => false ]; /** @@ -166,7 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'next' => 'next' + 'next' => 'next', + 'prev' => 'prev' ]; /** @@ -175,7 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'next' => 'setNext' + 'next' => 'setNext', + 'prev' => 'setPrev' ]; /** @@ -184,7 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'next' => 'getNext' + 'next' => 'getNext', + 'prev' => 'getPrev' ]; /** @@ -245,6 +251,7 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('next', $data ?? [], null); + $this->setIfExists('prev', $data ?? [], null); } /** @@ -292,7 +299,7 @@ public function valid() /** * Gets next * - * @return \HubSpot\Client\Crm\Associations\V4\Model\NextPage|null + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\NextPage|null */ public function getNext() { @@ -302,7 +309,7 @@ public function getNext() /** * Sets next * - * @param \HubSpot\Client\Crm\Associations\V4\Model\NextPage|null $next next + * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\NextPage|null $next next * * @return self */ @@ -315,14 +322,41 @@ public function setNext($next) return $this; } + + /** + * Gets prev + * + * @return \HubSpot\Client\Crm\Associations\V4\Schema\Model\PreviousPage|null + */ + public function getPrev() + { + return $this->container['prev']; + } + + /** + * Sets prev + * + * @param \HubSpot\Client\Crm\Associations\V4\Schema\Model\PreviousPage|null $prev prev + * + * @return self + */ + public function setPrev($prev) + { + if (is_null($prev)) { + throw new \InvalidArgumentException('non-nullable prev cannot be null'); + } + $this->container['prev'] = $prev; + + 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]); } @@ -330,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; } @@ -360,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/Associations/V4/Schema/Model/PreviousPage.php b/codegen/Crm/Associations/V4/Schema/Model/PreviousPage.php new file mode 100644 index 00000000..6310d881 --- /dev/null +++ b/codegen/Crm/Associations/V4/Schema/Model/PreviousPage.php @@ -0,0 +1,447 @@ + + */ +class PreviousPage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PreviousPage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'before' => 'string', + 'link' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'before' => null, + 'link' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'before' => false, + 'link' => 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 = [ + 'before' => 'before', + 'link' => 'link' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'before' => 'setBefore', + 'link' => 'setLink' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'before' => 'getBefore', + 'link' => 'getLink' + ]; + + /** + * 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('before', $data ?? [], null); + $this->setIfExists('link', $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['before'] === null) { + $invalidProperties[] = "'before' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets before + * + * @return string + */ + public function getBefore() + { + return $this->container['before']; + } + + /** + * Sets before + * + * @param string $before A paging cursor token for retrieving previous pages. + * + * @return self + */ + public function setBefore($before) + { + if (is_null($before)) { + throw new \InvalidArgumentException('non-nullable before cannot be null'); + } + $this->container['before'] = $before; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link A URL that can be used to retrieve the previous pages' results. + * + * @return self + */ + public function setLink($link) + { + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); + } + $this->container['link'] = $link; + + 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/Schema/Model/PublicAssociationDefinitionConfigurationCreateRequest.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationCreateRequest.php index a4ed5cef..3edee261 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationCreateRequest.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationCreateRequest.php @@ -2,7 +2,7 @@ /** * PublicAssociationDefinitionConfigurationCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,9 +57,9 @@ class PublicAssociationDefinitionConfigurationCreateRequest implements ModelInte * @var string[] */ protected static $openAPITypes = [ - 'type_id' => 'int', 'category' => 'string', - 'max_to_object_ids' => 'int' + 'max_to_object_ids' => 'int', + 'type_id' => 'int' ]; /** @@ -70,9 +70,9 @@ class PublicAssociationDefinitionConfigurationCreateRequest implements ModelInte * @psalm-var array */ protected static $openAPIFormats = [ - 'type_id' => 'int32', 'category' => null, - 'max_to_object_ids' => 'int32' + 'max_to_object_ids' => 'int32', + 'type_id' => 'int32' ]; /** @@ -81,9 +81,9 @@ class PublicAssociationDefinitionConfigurationCreateRequest implements ModelInte * @var boolean[] */ protected static array $openAPINullables = [ - 'type_id' => false, 'category' => false, - 'max_to_object_ids' => false + 'max_to_object_ids' => false, + 'type_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type_id' => 'typeId', 'category' => 'category', - 'max_to_object_ids' => 'maxToObjectIds' + 'max_to_object_ids' => 'maxToObjectIds', + 'type_id' => 'typeId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type_id' => 'setTypeId', 'category' => 'setCategory', - 'max_to_object_ids' => 'setMaxToObjectIds' + 'max_to_object_ids' => 'setMaxToObjectIds', + 'type_id' => 'setTypeId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type_id' => 'getTypeId', 'category' => 'getCategory', - 'max_to_object_ids' => 'getMaxToObjectIds' + 'max_to_object_ids' => 'getMaxToObjectIds', + 'type_id' => 'getTypeId' ]; /** @@ -241,8 +241,8 @@ public function getModelName() } public const CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -253,8 +253,8 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_HUBSPOT_DEFINED, - self::CATEGORY_USER_DEFINED, self::CATEGORY_INTEGRATOR_DEFINED, + self::CATEGORY_USER_DEFINED, ]; } @@ -273,9 +273,9 @@ public function getCategoryAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('type_id', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); $this->setIfExists('max_to_object_ids', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); } /** @@ -305,9 +305,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } @@ -323,6 +320,9 @@ public function listInvalidProperties() if ($this->container['max_to_object_ids'] === null) { $invalidProperties[] = "'max_to_object_ids' can't be null"; } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -338,33 +338,6 @@ public function valid() } - /** - * Gets type_id - * - * @return int - */ - public function getTypeId() - { - return $this->container['type_id']; - } - - /** - * Sets type_id - * - * @param int $type_id type_id - * - * @return self - */ - public function setTypeId($type_id) - { - if (is_null($type_id)) { - throw new \InvalidArgumentException('non-nullable type_id cannot be null'); - } - $this->container['type_id'] = $type_id; - - return $this; - } - /** * Gets category * @@ -428,14 +401,41 @@ public function setMaxToObjectIds($max_to_object_ids) return $this; } + + /** + * Gets type_id + * + * @return int + */ + public function getTypeId() + { + return $this->container['type_id']; + } + + /** + * Sets type_id + * + * @param int $type_id type_id + * + * @return self + */ + public function setTypeId($type_id) + { + if (is_null($type_id)) { + throw new \InvalidArgumentException('non-nullable type_id cannot be null'); + } + $this->container['type_id'] = $type_id; + + 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]); } @@ -443,12 +443,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -473,11 +473,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateRequest.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateRequest.php index eae4d110..6156b8a2 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateRequest.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateRequest.php @@ -2,7 +2,7 @@ /** * PublicAssociationDefinitionConfigurationUpdateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,9 +57,9 @@ class PublicAssociationDefinitionConfigurationUpdateRequest implements ModelInte * @var string[] */ protected static $openAPITypes = [ - 'type_id' => 'int', 'category' => 'string', - 'max_to_object_ids' => 'int' + 'max_to_object_ids' => 'int', + 'type_id' => 'int' ]; /** @@ -70,9 +70,9 @@ class PublicAssociationDefinitionConfigurationUpdateRequest implements ModelInte * @psalm-var array */ protected static $openAPIFormats = [ - 'type_id' => 'int32', 'category' => null, - 'max_to_object_ids' => 'int32' + 'max_to_object_ids' => 'int32', + 'type_id' => 'int32' ]; /** @@ -81,9 +81,9 @@ class PublicAssociationDefinitionConfigurationUpdateRequest implements ModelInte * @var boolean[] */ protected static array $openAPINullables = [ - 'type_id' => false, 'category' => false, - 'max_to_object_ids' => false + 'max_to_object_ids' => false, + 'type_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type_id' => 'typeId', 'category' => 'category', - 'max_to_object_ids' => 'maxToObjectIds' + 'max_to_object_ids' => 'maxToObjectIds', + 'type_id' => 'typeId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type_id' => 'setTypeId', 'category' => 'setCategory', - 'max_to_object_ids' => 'setMaxToObjectIds' + 'max_to_object_ids' => 'setMaxToObjectIds', + 'type_id' => 'setTypeId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type_id' => 'getTypeId', 'category' => 'getCategory', - 'max_to_object_ids' => 'getMaxToObjectIds' + 'max_to_object_ids' => 'getMaxToObjectIds', + 'type_id' => 'getTypeId' ]; /** @@ -241,8 +241,8 @@ public function getModelName() } public const CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -253,8 +253,8 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_HUBSPOT_DEFINED, - self::CATEGORY_USER_DEFINED, self::CATEGORY_INTEGRATOR_DEFINED, + self::CATEGORY_USER_DEFINED, ]; } @@ -273,9 +273,9 @@ public function getCategoryAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('type_id', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); $this->setIfExists('max_to_object_ids', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); } /** @@ -305,9 +305,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } @@ -323,6 +320,9 @@ public function listInvalidProperties() if ($this->container['max_to_object_ids'] === null) { $invalidProperties[] = "'max_to_object_ids' can't be null"; } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -338,33 +338,6 @@ public function valid() } - /** - * Gets type_id - * - * @return int - */ - public function getTypeId() - { - return $this->container['type_id']; - } - - /** - * Sets type_id - * - * @param int $type_id type_id - * - * @return self - */ - public function setTypeId($type_id) - { - if (is_null($type_id)) { - throw new \InvalidArgumentException('non-nullable type_id cannot be null'); - } - $this->container['type_id'] = $type_id; - - return $this; - } - /** * Gets category * @@ -428,14 +401,41 @@ public function setMaxToObjectIds($max_to_object_ids) return $this; } + + /** + * Gets type_id + * + * @return int + */ + public function getTypeId() + { + return $this->container['type_id']; + } + + /** + * Sets type_id + * + * @param int $type_id type_id + * + * @return self + */ + public function setTypeId($type_id) + { + if (is_null($type_id)) { + throw new \InvalidArgumentException('non-nullable type_id cannot be null'); + } + $this->container['type_id'] = $type_id; + + 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]); } @@ -443,12 +443,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -473,11 +473,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateResult.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateResult.php index f0914fac..6a5bb166 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateResult.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionConfigurationUpdateResult.php @@ -2,7 +2,7 @@ /** * PublicAssociationDefinitionConfigurationUpdateResult * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,9 +57,9 @@ class PublicAssociationDefinitionConfigurationUpdateResult implements ModelInter * @var string[] */ protected static $openAPITypes = [ - 'user_enforced_max_to_object_ids' => 'int', + 'category' => 'string', 'type_id' => 'int', - 'category' => 'string' + 'user_enforced_max_to_object_ids' => 'int' ]; /** @@ -70,9 +70,9 @@ class PublicAssociationDefinitionConfigurationUpdateResult implements ModelInter * @psalm-var array */ protected static $openAPIFormats = [ - 'user_enforced_max_to_object_ids' => 'int32', + 'category' => null, 'type_id' => 'int32', - 'category' => null + 'user_enforced_max_to_object_ids' => 'int32' ]; /** @@ -81,9 +81,9 @@ class PublicAssociationDefinitionConfigurationUpdateResult implements ModelInter * @var boolean[] */ protected static array $openAPINullables = [ - 'user_enforced_max_to_object_ids' => false, + 'category' => false, 'type_id' => false, - 'category' => false + 'user_enforced_max_to_object_ids' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'user_enforced_max_to_object_ids' => 'userEnforcedMaxToObjectIds', + 'category' => 'category', 'type_id' => 'typeId', - 'category' => 'category' + 'user_enforced_max_to_object_ids' => 'userEnforcedMaxToObjectIds' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'user_enforced_max_to_object_ids' => 'setUserEnforcedMaxToObjectIds', + 'category' => 'setCategory', 'type_id' => 'setTypeId', - 'category' => 'setCategory' + 'user_enforced_max_to_object_ids' => 'setUserEnforcedMaxToObjectIds' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'user_enforced_max_to_object_ids' => 'getUserEnforcedMaxToObjectIds', + 'category' => 'getCategory', 'type_id' => 'getTypeId', - 'category' => 'getCategory' + 'user_enforced_max_to_object_ids' => 'getUserEnforcedMaxToObjectIds' ]; /** @@ -241,8 +241,8 @@ public function getModelName() } public const CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -253,8 +253,8 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_HUBSPOT_DEFINED, - self::CATEGORY_USER_DEFINED, self::CATEGORY_INTEGRATOR_DEFINED, + self::CATEGORY_USER_DEFINED, ]; } @@ -273,9 +273,9 @@ public function getCategoryAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('user_enforced_max_to_object_ids', $data ?? [], null); - $this->setIfExists('type_id', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); + $this->setIfExists('user_enforced_max_to_object_ids', $data ?? [], null); } /** @@ -305,9 +305,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } @@ -320,6 +317,9 @@ public function listInvalidProperties() ); } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -336,28 +336,38 @@ public function valid() /** - * Gets user_enforced_max_to_object_ids + * Gets category * - * @return int|null + * @return string */ - public function getUserEnforcedMaxToObjectIds() + public function getCategory() { - return $this->container['user_enforced_max_to_object_ids']; + return $this->container['category']; } /** - * Sets user_enforced_max_to_object_ids + * Sets category * - * @param int|null $user_enforced_max_to_object_ids user_enforced_max_to_object_ids + * @param string $category category * * @return self */ - public function setUserEnforcedMaxToObjectIds($user_enforced_max_to_object_ids) + public function setCategory($category) { - if (is_null($user_enforced_max_to_object_ids)) { - throw new \InvalidArgumentException('non-nullable user_enforced_max_to_object_ids cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['user_enforced_max_to_object_ids'] = $user_enforced_max_to_object_ids; + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; return $this; } @@ -390,49 +400,39 @@ public function setTypeId($type_id) } /** - * Gets category + * Gets user_enforced_max_to_object_ids * - * @return string + * @return int|null */ - public function getCategory() + public function getUserEnforcedMaxToObjectIds() { - return $this->container['category']; + return $this->container['user_enforced_max_to_object_ids']; } /** - * Sets category + * Sets user_enforced_max_to_object_ids * - * @param string $category category + * @param int|null $user_enforced_max_to_object_ids user_enforced_max_to_object_ids * * @return self */ - public function setCategory($category) + public function setUserEnforcedMaxToObjectIds($user_enforced_max_to_object_ids) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($category, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'category', must be one of '%s'", - $category, - implode("', '", $allowedValues) - ) - ); + if (is_null($user_enforced_max_to_object_ids)) { + throw new \InvalidArgumentException('non-nullable user_enforced_max_to_object_ids cannot be null'); } - $this->container['category'] = $category; + $this->container['user_enforced_max_to_object_ids'] = $user_enforced_max_to_object_ids; 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]); } @@ -440,12 +440,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -470,11 +470,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionCreateRequest.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionCreateRequest.php index 104adafe..24c1e1b6 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionCreateRequest.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionCreateRequest.php @@ -2,7 +2,7 @@ /** * PublicAssociationDefinitionCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -58,8 +58,8 @@ class PublicAssociationDefinitionCreateRequest implements ModelInterface, ArrayA */ protected static $openAPITypes = [ 'inverse_label' => 'string', - 'name' => 'string', - 'label' => 'string' + 'label' => 'string', + 'name' => 'string' ]; /** @@ -71,8 +71,8 @@ class PublicAssociationDefinitionCreateRequest implements ModelInterface, ArrayA */ protected static $openAPIFormats = [ 'inverse_label' => null, - 'name' => null, - 'label' => null + 'label' => null, + 'name' => null ]; /** @@ -82,8 +82,8 @@ class PublicAssociationDefinitionCreateRequest implements ModelInterface, ArrayA */ protected static array $openAPINullables = [ 'inverse_label' => false, - 'name' => false, - 'label' => false + 'label' => false, + 'name' => false ]; /** @@ -173,8 +173,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'inverse_label' => 'inverseLabel', - 'name' => 'name', - 'label' => 'label' + 'label' => 'label', + 'name' => 'name' ]; /** @@ -184,8 +184,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'inverse_label' => 'setInverseLabel', - 'name' => 'setName', - 'label' => 'setLabel' + 'label' => 'setLabel', + 'name' => 'setName' ]; /** @@ -195,8 +195,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'inverse_label' => 'getInverseLabel', - 'name' => 'getName', - 'label' => 'getLabel' + 'label' => 'getLabel', + 'name' => 'getName' ]; /** @@ -257,8 +257,8 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('inverse_label', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); } /** @@ -288,12 +288,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } return $invalidProperties; } @@ -337,66 +337,66 @@ public function setInverseLabel($inverse_label) } /** - * Gets name + * Gets label * * @return string */ - public function getName() + public function getLabel() { - return $this->container['name']; + return $this->container['label']; } /** - * Sets name + * Sets label * - * @param string $name name + * @param string $label label * * @return self */ - public function setName($name) + public function setLabel($label) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['name'] = $name; + $this->container['label'] = $label; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label label + * @param string $name name * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; 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 +404,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset 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 +434,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUpdateRequest.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUpdateRequest.php index 9c5cb0ba..b3f4051f 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUpdateRequest.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUpdateRequest.php @@ -2,7 +2,7 @@ /** * PublicAssociationDefinitionUpdateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,8 +57,8 @@ class PublicAssociationDefinitionUpdateRequest implements ModelInterface, ArrayA * @var string[] */ protected static $openAPITypes = [ - 'inverse_label' => 'string', 'association_type_id' => 'int', + 'inverse_label' => 'string', 'label' => 'string' ]; @@ -70,8 +70,8 @@ class PublicAssociationDefinitionUpdateRequest implements ModelInterface, ArrayA * @psalm-var array */ protected static $openAPIFormats = [ - 'inverse_label' => null, 'association_type_id' => 'int32', + 'inverse_label' => null, 'label' => null ]; @@ -81,8 +81,8 @@ class PublicAssociationDefinitionUpdateRequest implements ModelInterface, ArrayA * @var boolean[] */ protected static array $openAPINullables = [ - 'inverse_label' => false, 'association_type_id' => false, + 'inverse_label' => false, 'label' => false ]; @@ -172,8 +172,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'inverse_label' => 'inverseLabel', 'association_type_id' => 'associationTypeId', + 'inverse_label' => 'inverseLabel', 'label' => 'label' ]; @@ -183,8 +183,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'inverse_label' => 'setInverseLabel', 'association_type_id' => 'setAssociationTypeId', + 'inverse_label' => 'setInverseLabel', 'label' => 'setLabel' ]; @@ -194,8 +194,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'inverse_label' => 'getInverseLabel', 'association_type_id' => 'getAssociationTypeId', + 'inverse_label' => 'getInverseLabel', 'label' => 'getLabel' ]; @@ -256,8 +256,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('inverse_label', $data ?? [], null); $this->setIfExists('association_type_id', $data ?? [], null); + $this->setIfExists('inverse_label', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); } @@ -310,55 +310,55 @@ public function valid() /** - * Gets inverse_label + * Gets association_type_id * - * @return string|null + * @return int */ - public function getInverseLabel() + public function getAssociationTypeId() { - return $this->container['inverse_label']; + return $this->container['association_type_id']; } /** - * Sets inverse_label + * Sets association_type_id * - * @param string|null $inverse_label inverse_label + * @param int $association_type_id association_type_id * * @return self */ - public function setInverseLabel($inverse_label) + public function setAssociationTypeId($association_type_id) { - if (is_null($inverse_label)) { - throw new \InvalidArgumentException('non-nullable inverse_label cannot be null'); + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); } - $this->container['inverse_label'] = $inverse_label; + $this->container['association_type_id'] = $association_type_id; return $this; } /** - * Gets association_type_id + * Gets inverse_label * - * @return int + * @return string|null */ - public function getAssociationTypeId() + public function getInverseLabel() { - return $this->container['association_type_id']; + return $this->container['inverse_label']; } /** - * Sets association_type_id + * Sets inverse_label * - * @param int $association_type_id association_type_id + * @param string|null $inverse_label inverse_label * * @return self */ - public function setAssociationTypeId($association_type_id) + public function setInverseLabel($inverse_label) { - if (is_null($association_type_id)) { - throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + if (is_null($inverse_label)) { + throw new \InvalidArgumentException('non-nullable inverse_label cannot be null'); } - $this->container['association_type_id'] = $association_type_id; + $this->container['inverse_label'] = $inverse_label; return $this; } @@ -392,11 +392,11 @@ public function setLabel($label) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -404,12 +404,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset 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 +434,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUserConfiguration.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUserConfiguration.php index 317314c5..04cbc2c1 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUserConfiguration.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationDefinitionUserConfiguration.php @@ -2,7 +2,7 @@ /** * PublicAssociationDefinitionUserConfiguration * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,10 +57,10 @@ class PublicAssociationDefinitionUserConfiguration implements ModelInterface, Ar * @var string[] */ protected static $openAPITypes = [ - 'user_enforced_max_to_object_ids' => 'int', - 'type_id' => 'int', + 'category' => 'string', 'label' => 'string', - 'category' => 'string' + 'type_id' => 'int', + 'user_enforced_max_to_object_ids' => 'int' ]; /** @@ -71,10 +71,10 @@ class PublicAssociationDefinitionUserConfiguration implements ModelInterface, Ar * @psalm-var array */ protected static $openAPIFormats = [ - 'user_enforced_max_to_object_ids' => 'int32', - 'type_id' => 'int32', + 'category' => null, 'label' => null, - 'category' => null + 'type_id' => 'int32', + 'user_enforced_max_to_object_ids' => 'int32' ]; /** @@ -83,10 +83,10 @@ class PublicAssociationDefinitionUserConfiguration implements ModelInterface, Ar * @var boolean[] */ protected static array $openAPINullables = [ - 'user_enforced_max_to_object_ids' => false, - 'type_id' => false, + 'category' => false, 'label' => false, - 'category' => false + 'type_id' => false, + 'user_enforced_max_to_object_ids' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'user_enforced_max_to_object_ids' => 'userEnforcedMaxToObjectIds', - 'type_id' => 'typeId', + 'category' => 'category', 'label' => 'label', - 'category' => 'category' + 'type_id' => 'typeId', + 'user_enforced_max_to_object_ids' => 'userEnforcedMaxToObjectIds' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'user_enforced_max_to_object_ids' => 'setUserEnforcedMaxToObjectIds', - 'type_id' => 'setTypeId', + 'category' => 'setCategory', 'label' => 'setLabel', - 'category' => 'setCategory' + 'type_id' => 'setTypeId', + 'user_enforced_max_to_object_ids' => 'setUserEnforcedMaxToObjectIds' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'user_enforced_max_to_object_ids' => 'getUserEnforcedMaxToObjectIds', - 'type_id' => 'getTypeId', + 'category' => 'getCategory', 'label' => 'getLabel', - 'category' => 'getCategory' + 'type_id' => 'getTypeId', + 'user_enforced_max_to_object_ids' => 'getUserEnforcedMaxToObjectIds' ]; /** @@ -247,8 +247,8 @@ public function getModelName() } public const CATEGORY_HUBSPOT_DEFINED = 'HUBSPOT_DEFINED'; - public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; public const CATEGORY_INTEGRATOR_DEFINED = 'INTEGRATOR_DEFINED'; + public const CATEGORY_USER_DEFINED = 'USER_DEFINED'; /** * Gets allowable values of the enum @@ -259,8 +259,8 @@ public function getCategoryAllowableValues() { return [ self::CATEGORY_HUBSPOT_DEFINED, - self::CATEGORY_USER_DEFINED, self::CATEGORY_INTEGRATOR_DEFINED, + self::CATEGORY_USER_DEFINED, ]; } @@ -279,10 +279,10 @@ public function getCategoryAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('user_enforced_max_to_object_ids', $data ?? [], null); - $this->setIfExists('type_id', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); + $this->setIfExists('user_enforced_max_to_object_ids', $data ?? [], null); } /** @@ -312,9 +312,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } @@ -327,6 +324,9 @@ public function listInvalidProperties() ); } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -343,130 +343,130 @@ public function valid() /** - * Gets user_enforced_max_to_object_ids + * Gets category * - * @return int|null + * @return string */ - public function getUserEnforcedMaxToObjectIds() + public function getCategory() { - return $this->container['user_enforced_max_to_object_ids']; + return $this->container['category']; } /** - * Sets user_enforced_max_to_object_ids + * Sets category * - * @param int|null $user_enforced_max_to_object_ids user_enforced_max_to_object_ids + * @param string $category category * * @return self */ - public function setUserEnforcedMaxToObjectIds($user_enforced_max_to_object_ids) + public function setCategory($category) { - if (is_null($user_enforced_max_to_object_ids)) { - throw new \InvalidArgumentException('non-nullable user_enforced_max_to_object_ids cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['user_enforced_max_to_object_ids'] = $user_enforced_max_to_object_ids; + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; return $this; } /** - * Gets type_id + * Gets label * - * @return int + * @return string|null */ - public function getTypeId() + public function getLabel() { - return $this->container['type_id']; + return $this->container['label']; } /** - * Sets type_id + * Sets label * - * @param int $type_id type_id + * @param string|null $label label * * @return self */ - public function setTypeId($type_id) + public function setLabel($label) { - if (is_null($type_id)) { - throw new \InvalidArgumentException('non-nullable type_id cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['type_id'] = $type_id; + $this->container['label'] = $label; return $this; } /** - * Gets label + * Gets type_id * - * @return string|null + * @return int */ - public function getLabel() + public function getTypeId() { - return $this->container['label']; + return $this->container['type_id']; } /** - * Sets label + * Sets type_id * - * @param string|null $label label + * @param int $type_id type_id * * @return self */ - public function setLabel($label) + public function setTypeId($type_id) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($type_id)) { + throw new \InvalidArgumentException('non-nullable type_id cannot be null'); } - $this->container['label'] = $label; + $this->container['type_id'] = $type_id; return $this; } /** - * Gets category + * Gets user_enforced_max_to_object_ids * - * @return string + * @return int|null */ - public function getCategory() + public function getUserEnforcedMaxToObjectIds() { - return $this->container['category']; + return $this->container['user_enforced_max_to_object_ids']; } /** - * Sets category + * Sets user_enforced_max_to_object_ids * - * @param string $category category + * @param int|null $user_enforced_max_to_object_ids user_enforced_max_to_object_ids * * @return self */ - public function setCategory($category) + public function setUserEnforcedMaxToObjectIds($user_enforced_max_to_object_ids) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($category, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'category', must be one of '%s'", - $category, - implode("', '", $allowedValues) - ) - ); + if (is_null($user_enforced_max_to_object_ids)) { + throw new \InvalidArgumentException('non-nullable user_enforced_max_to_object_ids cannot be null'); } - $this->container['category'] = $category; + $this->container['user_enforced_max_to_object_ids'] = $user_enforced_max_to_object_ids; 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]); } @@ -474,12 +474,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -504,11 +504,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationSpec.php b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationSpec.php index 4a61cf54..30730b7a 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationSpec.php +++ b/codegen/Crm/Associations/V4/Schema/Model/PublicAssociationSpec.php @@ -2,7 +2,7 @@ /** * PublicAssociationSpec * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.18.0 */ /** @@ -57,8 +57,8 @@ class PublicAssociationSpec implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'type_id' => 'int', - 'category' => 'string' + 'category' => 'string', + 'type_id' => 'int' ]; /** @@ -69,8 +69,8 @@ class PublicAssociationSpec implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'type_id' => 'int32', - 'category' => null + 'category' => null, + 'type_id' => 'int32' ]; /** @@ -79,8 +79,8 @@ class PublicAssociationSpec implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static array $openAPINullables = [ - 'type_id' => false, - 'category' => false + 'category' => false, + 'type_id' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type_id' => 'typeId', - 'category' => 'category' + 'category' => 'category', + 'type_id' => 'typeId' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type_id' => 'setTypeId', - 'category' => 'setCategory' + 'category' => 'setCategory', + 'type_id' => 'setTypeId' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type_id' => 'getTypeId', - 'category' => 'getCategory' + 'category' => 'getCategory', + 'type_id' => 'getTypeId' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('type_id', $data ?? [], null); $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('type_id', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type_id'] === null) { - $invalidProperties[] = "'type_id' can't be null"; - } if ($this->container['category'] === null) { $invalidProperties[] = "'category' can't be null"; } + if ($this->container['type_id'] === null) { + $invalidProperties[] = "'type_id' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets type_id + * Gets category * - * @return int + * @return string */ - public function getTypeId() + public function getCategory() { - return $this->container['type_id']; + return $this->container['category']; } /** - * Sets type_id + * Sets category * - * @param int $type_id type_id + * @param string $category category * * @return self */ - public function setTypeId($type_id) + public function setCategory($category) { - if (is_null($type_id)) { - throw new \InvalidArgumentException('non-nullable type_id cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['type_id'] = $type_id; + $this->container['category'] = $category; return $this; } /** - * Gets category + * Gets type_id * - * @return string + * @return int */ - public function getCategory() + public function getTypeId() { - return $this->container['category']; + return $this->container['type_id']; } /** - * Sets category + * Sets type_id * - * @param string $category category + * @param int $type_id type_id * * @return self */ - public function setCategory($category) + public function setTypeId($type_id) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($type_id)) { + throw new \InvalidArgumentException('non-nullable type_id cannot be null'); } - $this->container['category'] = $category; + $this->container['type_id'] = $type_id; 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/Associations/V4/Schema/Model/StandardError.php b/codegen/Crm/Associations/V4/Schema/Model/StandardError.php index 95d89181..b13640ba 100644 --- a/codegen/Crm/Associations/V4/Schema/Model/StandardError.php +++ b/codegen/Crm/Associations/V4/Schema/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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\Associations\V4\Schema * @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\Associations\V4\Schema\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Associations\V4\Schema\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\Associations\V4\Schema\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\Associations\V4\Schema\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\Associations\V4\Schema\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\Associations\V4\Schema\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/Associations/V4/Schema/ObjectSerializer.php b/codegen/Crm/Associations/V4/Schema/ObjectSerializer.php index 7a140f89..e1f3071f 100644 --- a/codegen/Crm/Associations/V4/Schema/ObjectSerializer.php +++ b/codegen/Crm/Associations/V4/Schema/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Associations\V4\Schema @@ -13,11 +13,11 @@ /** * CRM Associations Schema * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v4 * 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) : ''; } }