diff --git a/codegen/Crm/Objects/DealSplits/Api/BatchApi.php b/codegen/Crm/Objects/DealSplits/Api/BatchApi.php index 1bc7a755..3e369ed0 100644 --- a/codegen/Crm/Objects/DealSplits/Api/BatchApi.php +++ b/codegen/Crm/Objects/DealSplits/Api/BatchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Objects\DealSplits\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -279,34 +221,11 @@ public function readWithHttpInfo($batch_input_public_object_id, string $contentT ); } - $returnType = '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -316,7 +235,7 @@ public function readWithHttpInfo($batch_input_public_object_id, string $contentT $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -324,7 +243,7 @@ public function readWithHttpInfo($batch_input_public_object_id, string $contentT $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -332,8 +251,10 @@ public function readWithHttpInfo($batch_input_public_object_id, string $contentT $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -565,88 +486,27 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplitsWithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Objects\DealSplits\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Objects\DealSplits\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -660,34 +520,11 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str ); } - $returnType = '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Objects\DealSplits\Model\BatchResponseDealToDealSplits', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -697,7 +534,7 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -705,7 +542,7 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -713,8 +550,10 @@ public function upsertWithHttpInfo($public_deal_splits_batch_create_request, str $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -903,6 +742,57 @@ protected function createHttpClientOption() } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/codegen/Crm/Objects/DealSplits/ApiException.php b/codegen/Crm/Objects/DealSplits/ApiException.php index 4f24fb6d..fb9503bd 100644 --- a/codegen/Crm/Objects/DealSplits/ApiException.php +++ b/codegen/Crm/Objects/DealSplits/ApiException.php @@ -1,7 +1,7 @@ tempFolderPath; } + /** + * Sets the certificate file path, for mTLS + * + * @return $this + */ + public function setCertFile($certFile) + { + $this->certFile = $certFile; + return $this; + } + + /** + * Gets the certificate file path, for mTLS + * + * @return string Certificate file path + */ + public function getCertFile() + { + return $this->certFile; + } + + /** + * Sets the certificate key path, for mTLS + * + * @return $this + */ + public function setKeyFile($keyFile) + { + $this->keyFile = $keyFile; + return $this; + } + + /** + * Gets the certificate key path, for mTLS + * + * @return string Certificate key path + */ + public function getKeyFile() + { + return $this->keyFile; + } + + /** * Gets the default configuration instance * diff --git a/codegen/Crm/Objects/DealSplits/FormDataProcessor.php b/codegen/Crm/Objects/DealSplits/FormDataProcessor.php new file mode 100644 index 00000000..601ecbd2 --- /dev/null +++ b/codegen/Crm/Objects/DealSplits/FormDataProcessor.php @@ -0,0 +1,246 @@ + $values the value of the form parameter + * + * @return array [key => value] of formdata + */ + public function prepare(array $values): array + { + $this->has_file = false; + $result = []; + + foreach ($values as $k => $v) { + if ($v === null) { + continue; + } + + $result[$k] = $this->makeFormSafe($v); + } + + return $result; + } + + /** + * Flattens a multi-level array of data and generates a single-level array + * compatible with formdata - a single-level array where the keys use bracket + * notation to signify nested data. + * + * credit: https://github.com/FranBar1966/FlatPHP + */ + public static function flatten(array $source, string $start = ''): array + { + $opt = [ + 'prefix' => '[', + 'suffix' => ']', + 'suffix-end' => true, + 'prefix-list' => '[', + 'suffix-list' => ']', + 'suffix-list-end' => true, + ]; + + if ($start === '') { + $currentPrefix = ''; + $currentSuffix = ''; + $currentSuffixEnd = false; + } elseif (array_is_list($source)) { + $currentPrefix = $opt['prefix-list']; + $currentSuffix = $opt['suffix-list']; + $currentSuffixEnd = $opt['suffix-list-end']; + } else { + $currentPrefix = $opt['prefix']; + $currentSuffix = $opt['suffix']; + $currentSuffixEnd = $opt['suffix-end']; + } + + $currentName = $start; + $result = []; + + foreach ($source as $key => $val) { + $currentName .= $currentPrefix.$key; + + if (is_array($val) && !empty($val)) { + $currentName .= $currentSuffix; + $result += self::flatten($val, $currentName); + } else { + if ($currentSuffixEnd) { + $currentName .= $currentSuffix; + } + + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } + } + + $currentName = $start; + } + + return $result; + } + + /** + * formdata must be limited to scalars or arrays of scalar values, + * or a resource for a file upload. Here we iterate through all available + * data and identify how to handle each scenario + */ + protected function makeFormSafe($value) + { + if ($value instanceof SplFileObject) { + return $this->processFiles([$value])[0]; + } + + if (is_resource($value)) { + $this->has_file = true; + + return $value; + } + + if ($value instanceof ModelInterface) { + return $this->processModel($value); + } + + if (is_array($value) || (is_object($value) && !$value instanceof \DateTimeInterface)) { + $data = []; + + foreach ($value as $k => $v) { + $data[$k] = $this->makeFormSafe($v); + } + + return $data; + } + + return ObjectSerializer::toString($value); + } + + /** + * We are able to handle nested ModelInterface. We do not simply call + * json_decode(json_encode()) because any given model may have binary data + * or other data that cannot be serialized to a JSON string + */ + protected function processModel(ModelInterface $model): array + { + $result = []; + + foreach ($model::openAPITypes() as $name => $type) { + $value = $model->offsetGet($name); + + if ($value === null) { + continue; + } + + if (strpos($type, '\SplFileObject') !== false) { + $file = is_array($value) ? $value : [$value]; + $result[$name] = $this->processFiles($file); + + continue; + } + + if ($value instanceof ModelInterface) { + $result[$name] = $this->processModel($value); + + continue; + } + + if (is_array($value) || is_object($value)) { + $result[$name] = $this->makeFormSafe($value); + + continue; + } + + $result[$name] = ObjectSerializer::toString($value); + } + + return $result; + } + + /** + * Handle file data + */ + protected function processFiles(array $files): array + { + $this->has_file = true; + + $result = []; + + foreach ($files as $i => $file) { + if (is_array($file)) { + $result[$i] = $this->processFiles($file); + + continue; + } + + if ($file instanceof StreamInterface) { + $result[$i] = $file; + + continue; + } + + if ($file instanceof SplFileObject) { + $result[$i] = $this->tryFopen($file); + } + } + + return $result; + } + + private function tryFopen(SplFileObject $file) + { + return Utils::tryFopen($file->getRealPath(), 'rb'); + } +} diff --git a/codegen/Crm/Objects/DealSplits/HeaderSelector.php b/codegen/Crm/Objects/DealSplits/HeaderSelector.php index 76773f28..f2a70b48 100644 --- a/codegen/Crm/Objects/DealSplits/HeaderSelector.php +++ b/codegen/Crm/Objects/DealSplits/HeaderSelector.php @@ -1,7 +1,7 @@ container[$offset]); } @@ -333,12 +333,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -363,11 +363,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php index ddcbae54..12ed672d 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplits.php @@ -2,7 +2,7 @@ /** * BatchResponseDealToDealSplits * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -58,10 +58,10 @@ class BatchResponseDealToDealSplits implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', 'links' => 'array', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +74,10 @@ class BatchResponseDealToDealSplits implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', 'links' => null, + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +88,10 @@ class BatchResponseDealToDealSplits implements ModelInterface, ArrayAccess, \Jso */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, 'links' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +182,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', 'links' => 'links', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +196,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', 'links' => 'setLinks', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +210,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', 'links' => 'getLinks', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +258,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 +271,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 +294,10 @@ 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('links', $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 +331,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 +377,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at completed_at + * @param \DateTime $completed_at The timestamp indicating when the batch operation was completed, in date-time format. * * @return self */ @@ -392,109 +392,109 @@ public function setCompletedAt($completed_at) } /** - * 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 A map of link names to associated URIs for additional resources or documentation. * * @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 requested_at * - * @return \DateTime + * @return \DateTime|null */ - public function getStartedAt() + public function getRequestedAt() { - return $this->container['started_at']; + return $this->container['requested_at']; } /** - * Sets started_at + * Sets requested_at * - * @param \DateTime $started_at started_at + * @param \DateTime|null $requested_at The timestamp indicating when the batch operation was requested, in date-time format. * * @return self */ - public function setStartedAt($started_at) + public function setRequestedAt($requested_at) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['requested_at'] = $requested_at; return $this; } /** - * Gets links + * Gets results * - * @return array|null + * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[] */ - public function getLinks() + public function getResults() { - return $this->container['links']; + return $this->container['results']; } /** - * Sets links + * Sets results * - * @param array|null $links links + * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[] $results An array of deal-to-deal split objects representing the results of the batch operation. * * @return self */ - public function setLinks($links) + public function setResults($results) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); } - $this->container['links'] = $links; + $this->container['results'] = $results; return $this; } /** - * Gets results + * Gets started_at * - * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[] + * @return \DateTime */ - public function getResults() + public function getStartedAt() { - return $this->container['results']; + return $this->container['started_at']; } /** - * Sets results + * Sets started_at * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[] $results results + * @param \DateTime $started_at The timestamp indicating when the batch operation started, in date-time format. * * @return self */ - public function setResults($results) + public function setStartedAt($started_at) { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['results'] = $results; + $this->container['started_at'] = $started_at; return $this; } @@ -512,7 +512,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The current status of the batch operation, with possible values: CANCELED, COMPLETE, PENDING, PROCESSING. * * @return self */ @@ -538,11 +538,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 +550,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset 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 +580,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php index 6dddfdd8..47e77681 100644 --- a/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php +++ b/codegen/Crm/Objects/DealSplits/Model/BatchResponseDealToDealSplitsWithErrors.php @@ -2,7 +2,7 @@ /** * BatchResponseDealToDealSplitsWithErrors * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -58,12 +58,12 @@ class BatchResponseDealToDealSplitsWithErrors implements ModelInterface, ArrayAc */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\StandardError[]', + 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', 'results' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[]', - 'errors' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\StandardError[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -76,12 +76,12 @@ class BatchResponseDealToDealSplitsWithErrors implements ModelInterface, ArrayAc */ 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 BatchResponseDealToDealSplitsWithErrors implements ModelInterface, ArrayAc */ 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 indicating when the batch operation was completed, in date-time format. * * @return self */ @@ -406,109 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets num_errors + * Gets errors * - * @return int|null + * @return \HubSpot\Client\Crm\Objects\DealSplits\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\Objects\DealSplits\Model\StandardError[]|null $errors An array of error objects detailing the errors that occurred during the batch operation. * * @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 A map of link names to associated URIs for additional resources or documentation. * * @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 total number of errors encountered during the batch operation. * * @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 indicating when the batch operation was requested, in date-time 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; } @@ -526,7 +526,7 @@ public function getResults() /** * Sets results * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[] $results results + * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\DealToDealSplits[] $results An array of deal-to-deal split objects representing the results of the batch operation. * * @return self */ @@ -541,28 +541,28 @@ public function setResults($results) } /** - * Gets errors + * Gets started_at * - * @return \HubSpot\Client\Crm\Objects\DealSplits\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\Objects\DealSplits\Model\StandardError[]|null $errors errors + * @param \DateTime $started_at The timestamp indicating when the batch operation started, in date-time 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 current status of the batch operation, with possible values: CANCELED, COMPLETE, PENDING, PROCESSING. * * @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/Objects/DealSplits/Model/DealToDealSplits.php b/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php index 64b72ae4..ae7c5b5f 100644 --- a/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php +++ b/codegen/Crm/Objects/DealSplits/Model/DealToDealSplits.php @@ -2,7 +2,7 @@ /** * DealToDealSplits * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class DealToDealSplits implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'splits' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\SimplePublicObject[]', - 'id' => 'string' + 'id' => 'string', + 'splits' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\SimplePublicObject[]' ]; /** @@ -69,8 +69,8 @@ class DealToDealSplits implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'splits' => null, - 'id' => null + 'id' => null, + 'splits' => null ]; /** @@ -79,8 +79,8 @@ class DealToDealSplits implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'splits' => false, - 'id' => false + 'id' => false, + 'splits' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'splits' => 'splits', - 'id' => 'id' + 'id' => 'id', + 'splits' => 'splits' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'splits' => 'setSplits', - 'id' => 'setId' + 'id' => 'setId', + 'splits' => 'setSplits' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'splits' => 'getSplits', - 'id' => 'getId' + 'id' => 'getId', + 'splits' => 'getSplits' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('splits', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['splits'] === null) { - $invalidProperties[] = "'splits' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + if ($this->container['splits'] === null) { + $invalidProperties[] = "'splits' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets splits + * Gets id * - * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\SimplePublicObject[] + * @return string */ - public function getSplits() + public function getId() { - return $this->container['splits']; + return $this->container['id']; } /** - * Sets splits + * Sets id * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\SimplePublicObject[] $splits splits + * @param string $id The unique identifier for the deal associated with the deal splits. * * @return self */ - public function setSplits($splits) + public function setId($id) { - if (is_null($splits)) { - throw new \InvalidArgumentException('non-nullable splits cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['splits'] = $splits; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets splits * - * @return string + * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\SimplePublicObject[] */ - public function getId() + public function getSplits() { - return $this->container['id']; + return $this->container['splits']; } /** - * Sets id + * Sets splits * - * @param string $id id + * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\SimplePublicObject[] $splits An array of deal split objects, each representing a portion of the deal assigned to an owner. * * @return self */ - public function setId($id) + public function setSplits($splits) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); } - $this->container['id'] = $id; + $this->container['splits'] = $splits; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/Error.php b/codegen/Crm/Objects/DealSplits/Model/Error.php index c0a97e7a..e0c065c3 100644 --- a/codegen/Crm/Objects/DealSplits/Model/Error.php +++ b/codegen/Crm/Objects/DealSplits/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]' + 'sub_category' => 'string' ]; /** @@ -74,13 +74,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, 'correlation_id' => 'uuid', + 'errors' => null, 'links' => null, 'message' => null, - 'category' => null, - 'errors' => null + 'sub_category' => null ]; /** @@ -89,13 +89,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, 'correlation_id' => false, + 'errors' => false, 'links' => false, 'message' => false, - 'category' => false, - 'errors' => false + 'sub_category' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', 'correlation_id' => 'correlationId', + 'errors' => 'errors', 'links' => 'links', 'message' => 'message', - 'category' => 'category', - 'errors' => 'errors' + 'sub_category' => 'subCategory' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', 'correlation_id' => 'setCorrelationId', + 'errors' => 'setErrors', 'links' => 'setLinks', 'message' => 'setMessage', - 'category' => 'setCategory', - 'errors' => 'setErrors' + 'sub_category' => 'setSubCategory' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', 'correlation_id' => 'getCorrelationId', + 'errors' => 'getErrors', 'links' => 'getLinks', 'message' => 'getMessage', - 'category' => 'getCategory', - 'errors' => 'getErrors' + 'sub_category' => 'getSubCategory' ]; /** @@ -280,13 +280,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); $this->setIfExists('correlation_id', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -316,15 +316,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['correlation_id'] === null) { $invalidProperties[] = "'correlation_id' can't be null"; } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } return $invalidProperties; } @@ -341,28 +341,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return string|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string $category The error category * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -421,6 +421,33 @@ public function setCorrelationId($correlation_id) return $this; } + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]|null $errors further information about the error + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** * Gets links * @@ -476,66 +503,39 @@ public function setMessage($message) } /** - * Gets category - * - * @return string - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param string $category The error category - * - * @return self - */ - public function setCategory($category) - { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets errors + * Gets sub_category * - * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]|null + * @return string|null */ - public function getErrors() + public function getSubCategory() { - return $this->container['errors']; + return $this->container['sub_category']; } /** - * Sets errors + * Sets sub_category * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]|null $errors further information about the error + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setErrors($errors) + public function setSubCategory($sub_category) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['errors'] = $errors; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -543,12 +543,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -573,11 +573,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php b/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php index 02f01795..be708a65 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php +++ b/codegen/Crm/Objects/DealSplits/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -469,12 +469,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -499,11 +499,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php b/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php index 960047d8..102d3961 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php +++ b/codegen/Crm/Objects/DealSplits/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits\Model @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php index dc3e4040..a35df6db 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitInput.php @@ -2,7 +2,7 @@ /** * PublicDealSplitInput * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class PublicDealSplitInput implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'percentage' => 'float', - 'owner_id' => 'int' + 'owner_id' => 'int', + 'percentage' => 'float' ]; /** @@ -69,8 +69,8 @@ class PublicDealSplitInput implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'percentage' => null, - 'owner_id' => 'int32' + 'owner_id' => 'int32', + 'percentage' => null ]; /** @@ -79,8 +79,8 @@ class PublicDealSplitInput implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'percentage' => false, - 'owner_id' => false + 'owner_id' => false, + 'percentage' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'percentage' => 'percentage', - 'owner_id' => 'ownerId' + 'owner_id' => 'ownerId', + 'percentage' => 'percentage' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'percentage' => 'setPercentage', - 'owner_id' => 'setOwnerId' + 'owner_id' => 'setOwnerId', + 'percentage' => 'setPercentage' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'percentage' => 'getPercentage', - 'owner_id' => 'getOwnerId' + 'owner_id' => 'getOwnerId', + 'percentage' => 'getPercentage' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('percentage', $data ?? [], null); $this->setIfExists('owner_id', $data ?? [], null); + $this->setIfExists('percentage', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['percentage'] === null) { - $invalidProperties[] = "'percentage' can't be null"; - } if ($this->container['owner_id'] === null) { $invalidProperties[] = "'owner_id' can't be null"; } + if ($this->container['percentage'] === null) { + $invalidProperties[] = "'percentage' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets percentage + * Gets owner_id * - * @return float + * @return int */ - public function getPercentage() + public function getOwnerId() { - return $this->container['percentage']; + return $this->container['owner_id']; } /** - * Sets percentage + * Sets owner_id * - * @param float $percentage percentage + * @param int $owner_id The unique identifier of the owner receiving the deal split. * * @return self */ - public function setPercentage($percentage) + public function setOwnerId($owner_id) { - if (is_null($percentage)) { - throw new \InvalidArgumentException('non-nullable percentage cannot be null'); + if (is_null($owner_id)) { + throw new \InvalidArgumentException('non-nullable owner_id cannot be null'); } - $this->container['percentage'] = $percentage; + $this->container['owner_id'] = $owner_id; return $this; } /** - * Gets owner_id + * Gets percentage * - * @return int + * @return float */ - public function getOwnerId() + public function getPercentage() { - return $this->container['owner_id']; + return $this->container['percentage']; } /** - * Sets owner_id + * Sets percentage * - * @param int $owner_id owner_id + * @param float $percentage The portion of the deal assigned to the owner, expressed as a percentage. The total percentage for all splits in a deal must sum up to 1.0 (100%) and can have up to 8 decimal places. * * @return self */ - public function setOwnerId($owner_id) + public function setPercentage($percentage) { - if (is_null($owner_id)) { - throw new \InvalidArgumentException('non-nullable owner_id cannot be null'); + if (is_null($percentage)) { + throw new \InvalidArgumentException('non-nullable percentage cannot be null'); } - $this->container['owner_id'] = $owner_id; + $this->container['percentage'] = $percentage; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php index a7796ccf..913b328b 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsBatchCreateRequest.php @@ -2,7 +2,7 @@ /** * PublicDealSplitsBatchCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -305,7 +305,7 @@ public function getInputs() /** * Sets inputs * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitsCreateRequest[] $inputs inputs + * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitsCreateRequest[] $inputs An array of deal split inputs * * @return self */ @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -333,12 +333,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -363,11 +363,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php index 01b3123e..14583f6c 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicDealSplitsCreateRequest.php @@ -2,7 +2,7 @@ /** * PublicDealSplitsCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class PublicDealSplitsCreateRequest implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'splits' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitInput[]', - 'id' => 'int' + 'id' => 'int', + 'splits' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitInput[]' ]; /** @@ -69,8 +69,8 @@ class PublicDealSplitsCreateRequest implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'splits' => null, - 'id' => 'int32' + 'id' => 'int32', + 'splits' => null ]; /** @@ -79,8 +79,8 @@ class PublicDealSplitsCreateRequest implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'splits' => false, - 'id' => false + 'id' => false, + 'splits' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'splits' => 'splits', - 'id' => 'id' + 'id' => 'id', + 'splits' => 'splits' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'splits' => 'setSplits', - 'id' => 'setId' + 'id' => 'setId', + 'splits' => 'setSplits' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'splits' => 'getSplits', - 'id' => 'getId' + 'id' => 'getId', + 'splits' => 'getSplits' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('splits', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('splits', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['splits'] === null) { - $invalidProperties[] = "'splits' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + if ($this->container['splits'] === null) { + $invalidProperties[] = "'splits' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets splits + * Gets id * - * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitInput[] + * @return int */ - public function getSplits() + public function getId() { - return $this->container['splits']; + return $this->container['id']; } /** - * Sets splits + * Sets id * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitInput[] $splits splits + * @param int $id The unique identifier for the deal. * * @return self */ - public function setSplits($splits) + public function setId($id) { - if (is_null($splits)) { - throw new \InvalidArgumentException('non-nullable splits cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['splits'] = $splits; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets splits * - * @return int + * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitInput[] */ - public function getId() + public function getSplits() { - return $this->container['id']; + return $this->container['splits']; } /** - * Sets id + * Sets splits * - * @param int $id id + * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\PublicDealSplitInput[] $splits An array of deal split inputs, each containing an owner ID and a percentage of the deal split. * * @return self */ - public function setId($id) + public function setSplits($splits) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($splits)) { + throw new \InvalidArgumentException('non-nullable splits cannot be null'); } - $this->container['id'] = $id; + $this->container['splits'] = $splits; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -370,12 +370,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -400,11 +400,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php b/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php index e682009f..2a7f0bc6 100644 --- a/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php +++ b/codegen/Crm/Objects/DealSplits/Model/PublicObjectId.php @@ -2,7 +2,7 @@ /** * PublicObjectId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -305,7 +305,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique identifier for the public 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/Objects/DealSplits/Model/SimplePublicObject.php b/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php index 12579b10..f4cae445 100644 --- a/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php +++ b/codegen/Crm/Objects/DealSplits/Model/SimplePublicObject.php @@ -2,7 +2,7 @@ /** * SimplePublicObject * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * SimplePublicObject Class Doc Comment * * @category Class + * @description A simple public object. * @package HubSpot\Client\Crm\Objects\DealSplits * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,12 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', 'archived' => 'bool', 'archived_at' => '\DateTime', - 'properties_with_history' => 'array', + 'created_at' => '\DateTime', 'id' => 'string', 'properties' => 'array', + 'properties_with_history' => 'array', 'updated_at' => '\DateTime' ]; @@ -74,12 +75,12 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', 'archived' => null, 'archived_at' => 'date-time', - 'properties_with_history' => null, + 'created_at' => 'date-time', 'id' => null, 'properties' => null, + 'properties_with_history' => null, 'updated_at' => 'date-time' ]; @@ -89,12 +90,12 @@ class SimplePublicObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, 'archived' => false, 'archived_at' => false, - 'properties_with_history' => false, + 'created_at' => false, 'id' => false, 'properties' => false, + 'properties_with_history' => false, 'updated_at' => false ]; @@ -184,12 +185,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', 'archived' => 'archived', 'archived_at' => 'archivedAt', - 'properties_with_history' => 'propertiesWithHistory', + 'created_at' => 'createdAt', 'id' => 'id', 'properties' => 'properties', + 'properties_with_history' => 'propertiesWithHistory', 'updated_at' => 'updatedAt' ]; @@ -199,12 +200,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', 'archived' => 'setArchived', 'archived_at' => 'setArchivedAt', - 'properties_with_history' => 'setPropertiesWithHistory', + 'created_at' => 'setCreatedAt', 'id' => 'setId', 'properties' => 'setProperties', + 'properties_with_history' => 'setPropertiesWithHistory', 'updated_at' => 'setUpdatedAt' ]; @@ -214,12 +215,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', 'archived' => 'getArchived', 'archived_at' => 'getArchivedAt', - 'properties_with_history' => 'getPropertiesWithHistory', + 'created_at' => 'getCreatedAt', 'id' => 'getId', 'properties' => 'getProperties', + 'properties_with_history' => 'getPropertiesWithHistory', 'updated_at' => 'getUpdatedAt' ]; @@ -280,12 +281,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('archived', $data ?? [], null); $this->setIfExists('archived_at', $data ?? [], null); - $this->setIfExists('properties_with_history', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('properties', $data ?? [], null); + $this->setIfExists('properties_with_history', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -343,33 +344,6 @@ public function valid() } - /** - * Gets created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->container['created_at']; - } - - /** - * Sets created_at - * - * @param \DateTime $created_at created_at - * - * @return self - */ - public function setCreatedAt($created_at) - { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); - } - $this->container['created_at'] = $created_at; - - return $this; - } - /** * Gets archived * @@ -383,7 +357,7 @@ public function getArchived() /** * Sets archived * - * @param bool|null $archived archived + * @param bool|null $archived Whether the object is archived. * * @return self */ @@ -410,7 +384,7 @@ public function getArchivedAt() /** * Sets archived_at * - * @param \DateTime|null $archived_at archived_at + * @param \DateTime|null $archived_at The timestamp when the object was archived, in ISO 8601 format. * * @return self */ @@ -425,28 +399,28 @@ public function setArchivedAt($archived_at) } /** - * Gets properties_with_history + * Gets created_at * - * @return array|null + * @return \DateTime */ - public function getPropertiesWithHistory() + public function getCreatedAt() { - return $this->container['properties_with_history']; + return $this->container['created_at']; } /** - * Sets properties_with_history + * Sets created_at * - * @param array|null $properties_with_history properties_with_history + * @param \DateTime $created_at The timestamp when the object was created, in ISO 8601 format. * * @return self */ - public function setPropertiesWithHistory($properties_with_history) + public function setCreatedAt($created_at) { - if (is_null($properties_with_history)) { - throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['properties_with_history'] = $properties_with_history; + $this->container['created_at'] = $created_at; return $this; } @@ -464,7 +438,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The unique ID of the object. * * @return self */ @@ -491,7 +465,7 @@ public function getProperties() /** * Sets properties * - * @param array $properties properties + * @param array $properties Key-value pairs representing the properties of the object. * * @return self */ @@ -505,6 +479,33 @@ public function setProperties($properties) return $this; } + /** + * Gets properties_with_history + * + * @return array|null + */ + public function getPropertiesWithHistory() + { + return $this->container['properties_with_history']; + } + + /** + * Sets properties_with_history + * + * @param array|null $properties_with_history Key-value pairs representing the properties of the object along with their history. + * + * @return self + */ + public function setPropertiesWithHistory($properties_with_history) + { + if (is_null($properties_with_history)) { + throw new \InvalidArgumentException('non-nullable properties_with_history cannot be null'); + } + $this->container['properties_with_history'] = $properties_with_history; + + return $this; + } + /** * Gets updated_at * @@ -518,7 +519,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the object was last updated, in ISO 8601 format. * * @return self */ @@ -534,11 +535,11 @@ public function setUpdatedAt($updated_at) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -546,12 +547,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -576,11 +577,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/StandardError.php b/codegen/Crm/Objects/DealSplits/Model/StandardError.php index cf5e8f5d..01facd24 100644 --- a/codegen/Crm/Objects/DealSplits/Model/StandardError.php +++ b/codegen/Crm/Objects/DealSplits/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Objects\DealSplits * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Objects\DealSplits\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 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; } @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links A map of link names to associated URIs containing documentation about the error or recommended remediation steps + * @param \HubSpot\Client\Crm\Objects\DealSplits\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; } @@ -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 The error category + * @param array $links A map of link names to associated URIs containing documentation about the error or recommended remediation steps * * @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; } @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Crm\Objects\DealSplits\Model\ErrorDetail[] $errors errors + * @param string $status A human readable message describing the error along with remediation steps where appropriate * * @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 A human readable message describing the error along with remediation steps where appropriate + * @param object|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -586,12 +587,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -616,11 +617,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php b/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php index 2fd86831..aac2ad52 100644 --- a/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php +++ b/codegen/Crm/Objects/DealSplits/Model/ValueWithTimestamp.php @@ -2,7 +2,7 @@ /** * ValueWithTimestamp * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * ValueWithTimestamp Class Doc Comment * * @category Class + * @description Property model that includes timestamp. * @package HubSpot\Client\Crm\Objects\DealSplits * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,11 +59,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'source_id' => 'string', - 'source_type' => 'string', 'source_label' => 'string', + 'source_type' => 'string', + 'timestamp' => '\DateTime', 'updated_by_user_id' => 'int', - 'value' => 'string', - 'timestamp' => '\DateTime' + 'value' => 'string' ]; /** @@ -74,11 +75,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'source_id' => null, - 'source_type' => null, 'source_label' => null, + 'source_type' => null, + 'timestamp' => 'date-time', 'updated_by_user_id' => 'int32', - 'value' => null, - 'timestamp' => 'date-time' + 'value' => null ]; /** @@ -88,11 +89,11 @@ class ValueWithTimestamp implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'source_id' => false, - 'source_type' => false, 'source_label' => false, + 'source_type' => false, + 'timestamp' => false, 'updated_by_user_id' => false, - 'value' => false, - 'timestamp' => false + 'value' => false ]; /** @@ -182,11 +183,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'source_id' => 'sourceId', - 'source_type' => 'sourceType', 'source_label' => 'sourceLabel', + 'source_type' => 'sourceType', + 'timestamp' => 'timestamp', 'updated_by_user_id' => 'updatedByUserId', - 'value' => 'value', - 'timestamp' => 'timestamp' + 'value' => 'value' ]; /** @@ -196,11 +197,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'source_id' => 'setSourceId', - 'source_type' => 'setSourceType', 'source_label' => 'setSourceLabel', + 'source_type' => 'setSourceType', + 'timestamp' => 'setTimestamp', 'updated_by_user_id' => 'setUpdatedByUserId', - 'value' => 'setValue', - 'timestamp' => 'setTimestamp' + 'value' => 'setValue' ]; /** @@ -210,11 +211,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'source_id' => 'getSourceId', - 'source_type' => 'getSourceType', 'source_label' => 'getSourceLabel', + 'source_type' => 'getSourceType', + 'timestamp' => 'getTimestamp', 'updated_by_user_id' => 'getUpdatedByUserId', - 'value' => 'getValue', - 'timestamp' => 'getTimestamp' + 'value' => 'getValue' ]; /** @@ -275,11 +276,11 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('source_id', $data ?? [], null); - $this->setIfExists('source_type', $data ?? [], null); $this->setIfExists('source_label', $data ?? [], null); + $this->setIfExists('source_type', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); $this->setIfExists('updated_by_user_id', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('timestamp', $data ?? [], null); } /** @@ -312,12 +313,12 @@ public function listInvalidProperties() if ($this->container['source_type'] === null) { $invalidProperties[] = "'source_type' can't be null"; } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -346,7 +347,7 @@ public function getSourceId() /** * Sets source_id * - * @param string|null $source_id source_id + * @param string|null $source_id The unique ID of the property. * * @return self */ @@ -360,6 +361,33 @@ public function setSourceId($source_id) return $this; } + /** + * Gets source_label + * + * @return string|null + */ + public function getSourceLabel() + { + return $this->container['source_label']; + } + + /** + * Sets source_label + * + * @param string|null $source_label A human-readable label. + * + * @return self + */ + public function setSourceLabel($source_label) + { + if (is_null($source_label)) { + throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + } + $this->container['source_label'] = $source_label; + + return $this; + } + /** * Gets source_type * @@ -373,7 +401,7 @@ public function getSourceType() /** * Sets source_type * - * @param string $source_type source_type + * @param string $source_type The property type. * * @return self */ @@ -388,28 +416,28 @@ public function setSourceType($source_type) } /** - * Gets source_label + * Gets timestamp * - * @return string|null + * @return \DateTime */ - public function getSourceLabel() + public function getTimestamp() { - return $this->container['source_label']; + return $this->container['timestamp']; } /** - * Sets source_label + * Sets timestamp * - * @param string|null $source_label source_label + * @param \DateTime $timestamp The timestamp when the property was updated, in ISO 8601 format. * * @return self */ - public function setSourceLabel($source_label) + public function setTimestamp($timestamp) { - if (is_null($source_label)) { - throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); } - $this->container['source_label'] = $source_label; + $this->container['timestamp'] = $timestamp; return $this; } @@ -427,7 +455,7 @@ public function getUpdatedByUserId() /** * Sets updated_by_user_id * - * @param int|null $updated_by_user_id updated_by_user_id + * @param int|null $updated_by_user_id The ID of the user who last updated the property. * * @return self */ @@ -454,7 +482,7 @@ public function getValue() /** * Sets value * - * @param string $value value + * @param string $value The property value. * * @return self */ @@ -467,41 +495,14 @@ public function setValue($value) return $this; } - - /** - * Gets timestamp - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param \DateTime $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -509,12 +510,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -539,11 +540,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Objects/DealSplits/ObjectSerializer.php b/codegen/Crm/Objects/DealSplits/ObjectSerializer.php index e1341578..e1bfbbb2 100644 --- a/codegen/Crm/Objects/DealSplits/ObjectSerializer.php +++ b/codegen/Crm/Objects/DealSplits/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Objects\DealSplits @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.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) : ''; } }