diff --git a/codegen/Crm/Properties/Api/BatchApi.php b/codegen/Crm/Properties/Api/BatchApi.php index a5d3f3e4..02d74d2f 100644 --- a/codegen/Crm/Properties/Api/BatchApi.php +++ b/codegen/Crm/Properties/Api/BatchApi.php @@ -391,7 +391,7 @@ public function archiveRequest($object_type, $batch_input_property_name, string * * @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error + * @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error */ public function create($object_type, $batch_input_property_create, string $contentType = self::contentTypes['create'][0]) { @@ -410,7 +410,7 @@ public function create($object_type, $batch_input_property_create, string $conte * * @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function createWithHttpInfo($object_type, $batch_input_property_create, string $contentType = self::contentTypes['create'][0]) { @@ -440,12 +440,18 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s switch($statusCode) { - case 200: + case 201: return $this->handleResponseWithDataType( '\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty', $request, $response, ); + case 207: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', + $request, + $response, + ); default: return $this->handleResponseWithDataType( '\HubSpot\Client\Crm\Properties\Model\Error', @@ -476,7 +482,7 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s ); } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty', @@ -484,6 +490,14 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s ); $e->setResponseObject($data); throw $e; + case 207: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -697,7 +711,7 @@ public function createRequest($object_type, $batch_input_property_create, string * * @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error + * @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error */ public function read($object_type, $batch_read_input_property_name, $locale = null, string $contentType = self::contentTypes['read'][0]) { @@ -717,7 +731,7 @@ public function read($object_type, $batch_read_input_property_name, $locale = nu * * @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings) */ public function readWithHttpInfo($object_type, $batch_read_input_property_name, $locale = null, string $contentType = self::contentTypes['read'][0]) { @@ -753,6 +767,12 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name, $request, $response, ); + case 207: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', + $request, + $response, + ); default: return $this->handleResponseWithDataType( '\HubSpot\Client\Crm\Properties\Model\Error', @@ -791,6 +811,14 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name, ); $e->setResponseObject($data); throw $e; + case 207: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), diff --git a/codegen/Crm/Properties/Api/GroupsApi.php b/codegen/Crm/Properties/Api/GroupsApi.php index 0e3ac0dd..8e4b2552 100644 --- a/codegen/Crm/Properties/Api/GroupsApi.php +++ b/codegen/Crm/Properties/Api/GroupsApi.php @@ -207,7 +207,7 @@ public function archiveWithHttpInfo($object_type, $group_name, string $contentTy $e->setResponseObject($data); throw $e; } - + throw $e; } @@ -461,7 +461,7 @@ public function createWithHttpInfo($object_type, $property_group_create, string ); } - + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( @@ -500,7 +500,7 @@ public function createWithHttpInfo($object_type, $property_group_create, string $e->setResponseObject($data); throw $e; } - + throw $e; } @@ -766,7 +766,7 @@ public function getAllWithHttpInfo($object_type, $locale = null, string $content ); } - + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( @@ -805,7 +805,7 @@ public function getAllWithHttpInfo($object_type, $locale = null, string $content $e->setResponseObject($data); throw $e; } - + throw $e; } @@ -1069,7 +1069,7 @@ public function getByNameWithHttpInfo($object_type, $group_name, $locale = null, ); } - + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( @@ -1108,7 +1108,7 @@ public function getByNameWithHttpInfo($object_type, $group_name, $locale = null, $e->setResponseObject($data); throw $e; } - + throw $e; } @@ -1390,7 +1390,7 @@ public function updateWithHttpInfo($object_type, $group_name, $property_group_up ); } - + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( @@ -1429,7 +1429,7 @@ public function updateWithHttpInfo($object_type, $group_name, $property_group_up $e->setResponseObject($data); throw $e; } - + throw $e; } diff --git a/codegen/Crm/Properties/Model/BatchReadInputPropertyName.php b/codegen/Crm/Properties/Model/BatchReadInputPropertyName.php index 610a1cc1..e5bc65f0 100644 --- a/codegen/Crm/Properties/Model/BatchReadInputPropertyName.php +++ b/codegen/Crm/Properties/Model/BatchReadInputPropertyName.php @@ -351,7 +351,7 @@ public function getArchived() /** * Sets archived * - * @param bool $archived archived + * @param bool $archived Specifies whether the property is archived. * * @return self */ @@ -378,7 +378,7 @@ public function getDataSensitivity() /** * Sets data_sensitivity * - * @param string $data_sensitivity data_sensitivity + * @param string $data_sensitivity Indicates the sensitivity level of the data, such as 'non_sensitive', 'sensitive', or 'highly_sensitive'. * * @return self */ diff --git a/codegen/Crm/Properties/Model/BatchResponseProperty.php b/codegen/Crm/Properties/Model/BatchResponseProperty.php index 2fa021c8..b6b61195 100644 --- a/codegen/Crm/Properties/Model/BatchResponseProperty.php +++ b/codegen/Crm/Properties/Model/BatchResponseProperty.php @@ -58,9 +58,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'errors' => '\HubSpot\Client\Crm\Properties\Model\StandardError[]', 'links' => 'array', - 'num_errors' => 'int', 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Crm\Properties\Model\Property[]', 'started_at' => '\DateTime', @@ -76,9 +74,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'errors' => null, 'links' => null, - 'num_errors' => 'int32', 'requested_at' => 'date-time', 'results' => null, 'started_at' => 'date-time', @@ -92,9 +88,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static array $openAPINullables = [ 'completed_at' => false, - 'errors' => false, 'links' => false, - 'num_errors' => false, 'requested_at' => false, 'results' => false, 'started_at' => false, @@ -188,9 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'errors' => 'errors', 'links' => 'links', - 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', 'results' => 'results', 'started_at' => 'startedAt', @@ -204,9 +196,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'errors' => 'setErrors', 'links' => 'setLinks', - 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', 'results' => 'setResults', 'started_at' => 'setStartedAt', @@ -220,9 +210,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'errors' => 'getErrors', 'links' => 'getLinks', - 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', 'results' => 'getResults', 'started_at' => 'getStartedAt', @@ -306,9 +294,7 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('num_errors', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); $this->setIfExists('started_at', $data ?? [], null); @@ -391,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. * * @return self */ @@ -405,33 +391,6 @@ public function setCompletedAt($completed_at) return $this; } - /** - * Gets errors - * - * @return \HubSpot\Client\Crm\Properties\Model\StandardError[]|null - */ - public function getErrors() - { - return $this->container['errors']; - } - - /** - * Sets errors - * - * @param \HubSpot\Client\Crm\Properties\Model\StandardError[]|null $errors errors - * - * @return self - */ - public function setErrors($errors) - { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); - } - $this->container['errors'] = $errors; - - return $this; - } - /** * Gets links * @@ -445,7 +404,7 @@ public function getLinks() /** * Sets links * - * @param array|null $links links + * @param array|null $links A collection of URLs linking to documentation or resources related to the batch operation. * * @return self */ @@ -459,33 +418,6 @@ public function setLinks($links) return $this; } - /** - * Gets num_errors - * - * @return int|null - */ - public function getNumErrors() - { - return $this->container['num_errors']; - } - - /** - * Sets num_errors - * - * @param int|null $num_errors num_errors - * - * @return self - */ - public function setNumErrors($num_errors) - { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); - } - $this->container['num_errors'] = $num_errors; - - return $this; - } - /** * Gets requested_at * @@ -499,7 +431,7 @@ public function getRequestedAt() /** * Sets requested_at * - * @param \DateTime|null $requested_at requested_at + * @param \DateTime|null $requested_at The timestamp indicating when the batch operation was requested. * * @return self */ @@ -553,7 +485,7 @@ public function getStartedAt() /** * Sets started_at * - * @param \DateTime $started_at started_at + * @param \DateTime $started_at The timestamp indicating when the batch operation began processing. * * @return self */ @@ -580,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 being CANCELED, COMPLETE, PENDING, or PROCESSING. * * @return self */ diff --git a/codegen/Crm/Properties/Model/BatchResponsePropertyWithErrors.php b/codegen/Crm/Properties/Model/BatchResponsePropertyWithErrors.php new file mode 100644 index 00000000..75833d1a --- /dev/null +++ b/codegen/Crm/Properties/Model/BatchResponsePropertyWithErrors.php @@ -0,0 +1,697 @@ + + */ +class BatchResponsePropertyWithErrors implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BatchResponsePropertyWithErrors'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Properties\Model\StandardError[]', + 'links' => 'array', + 'num_errors' => 'int', + 'requested_at' => '\DateTime', + 'results' => '\HubSpot\Client\Crm\Properties\Model\Property[]', + 'started_at' => '\DateTime', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'completed_at' => 'date-time', + 'errors' => null, + 'links' => null, + 'num_errors' => 'int32', + 'requested_at' => 'date-time', + 'results' => null, + 'started_at' => 'date-time', + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'completed_at' => false, + 'errors' => false, + 'links' => false, + 'num_errors' => false, + 'requested_at' => false, + 'results' => false, + 'started_at' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'completed_at' => 'completedAt', + 'errors' => 'errors', + 'links' => 'links', + 'num_errors' => 'numErrors', + 'requested_at' => 'requestedAt', + 'results' => 'results', + 'started_at' => 'startedAt', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', + 'num_errors' => 'setNumErrors', + 'requested_at' => 'setRequestedAt', + 'results' => 'setResults', + 'started_at' => 'setStartedAt', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', + 'num_errors' => 'getNumErrors', + 'requested_at' => 'getRequestedAt', + 'results' => 'getResults', + 'started_at' => 'getStartedAt', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_CANCELED = 'CANCELED'; + public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_CANCELED, + self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('num_errors', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['completed_at'] === null) { + $invalidProperties[] = "'completed_at' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets completed_at + * + * @return \DateTime + */ + public function getCompletedAt() + { + return $this->container['completed_at']; + } + + /** + * Sets completed_at + * + * @param \DateTime $completed_at completed_at + * + * @return self + */ + public function setCompletedAt($completed_at) + { + if (is_null($completed_at)) { + throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); + } + $this->container['completed_at'] = $completed_at; + + return $this; + } + + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Properties\Model\StandardError[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Properties\Model\StandardError[]|null $errors errors + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + + /** + * Gets links + * + * @return array|null + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param array|null $links links + * + * @return self + */ + public function setLinks($links) + { + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); + } + $this->container['links'] = $links; + + return $this; + } + + /** + * Gets num_errors + * + * @return int|null + */ + public function getNumErrors() + { + return $this->container['num_errors']; + } + + /** + * Sets num_errors + * + * @param int|null $num_errors num_errors + * + * @return self + */ + public function setNumErrors($num_errors) + { + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); + } + $this->container['num_errors'] = $num_errors; + + return $this; + } + + /** + * Gets requested_at + * + * @return \DateTime|null + */ + public function getRequestedAt() + { + return $this->container['requested_at']; + } + + /** + * Sets requested_at + * + * @param \DateTime|null $requested_at requested_at + * + * @return self + */ + public function setRequestedAt($requested_at) + { + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + } + $this->container['requested_at'] = $requested_at; + + return $this; + } + + /** + * Gets results + * + * @return \HubSpot\Client\Crm\Properties\Model\Property[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \HubSpot\Client\Crm\Properties\Model\Property[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets started_at + * + * @return \DateTime + */ + public function getStartedAt() + { + return $this->container['started_at']; + } + + /** + * Sets started_at + * + * @param \DateTime $started_at started_at + * + * @return self + */ + public function setStartedAt($started_at) + { + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + } + $this->container['started_at'] = $started_at; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/codegen/Crm/Properties/Model/Option.php b/codegen/Crm/Properties/Model/Option.php index a2a651e1..d7e1b463 100644 --- a/codegen/Crm/Properties/Model/Option.php +++ b/codegen/Crm/Properties/Model/Option.php @@ -340,7 +340,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description A description of the property that will be shown as help text in HubSpot. + * @param string|null $description A description of the option. * * @return self */ @@ -367,7 +367,7 @@ public function getDisplayOrder() /** * Sets display_order * - * @param int|null $display_order Property groups are displayed in order starting with the lowest positive integer value. Values of -1 will cause the property group to be displayed after any positive values. + * @param int|null $display_order Options are displayed in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values. * * @return self */ @@ -394,7 +394,7 @@ public function getHidden() /** * Sets hidden * - * @param bool $hidden If true, the property won't be visible and can't be used in HubSpot. + * @param bool $hidden Hidden options will not be displayed in HubSpot. * * @return self */ @@ -421,7 +421,7 @@ public function getLabel() /** * Sets label * - * @param string $label A human-readable label that will be shown in HubSpot. + * @param string $label A human-readable option label that will be shown in HubSpot. * * @return self */ diff --git a/codegen/Crm/Properties/Model/OptionInput.php b/codegen/Crm/Properties/Model/OptionInput.php index 3ed39c58..c3d07a29 100644 --- a/codegen/Crm/Properties/Model/OptionInput.php +++ b/codegen/Crm/Properties/Model/OptionInput.php @@ -339,7 +339,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description A description of the property that will be shown as help text in HubSpot. + * @param string|null $description A description of the option. * * @return self */ @@ -366,7 +366,7 @@ public function getDisplayOrder() /** * Sets display_order * - * @param int|null $display_order Property groups are displayed in order starting with the lowest positive integer value. Values of -1 will cause the property group to be displayed after any positive values. + * @param int|null $display_order Options are shown in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values. * * @return self */ @@ -393,7 +393,7 @@ public function getHidden() /** * Sets hidden * - * @param bool $hidden If true, the property won't be visible and can't be used in HubSpot. + * @param bool $hidden Hidden options won't be shown in HubSpot. * * @return self */ @@ -420,7 +420,7 @@ public function getLabel() /** * Sets label * - * @param string $label A human-readable label that will be shown in HubSpot. + * @param string $label A human-readable option label that will be shown in HubSpot. * * @return self */ diff --git a/codegen/Crm/Properties/Model/Property.php b/codegen/Crm/Properties/Model/Property.php index 103f343f..a77230e2 100644 --- a/codegen/Crm/Properties/Model/Property.php +++ b/codegen/Crm/Properties/Model/Property.php @@ -64,6 +64,7 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable 'calculation_formula' => 'string', 'created_at' => '\DateTime', 'created_user_id' => 'string', + 'currency_property_name' => 'string', 'data_sensitivity' => 'string', 'date_display_hint' => 'string', 'description' => 'string', @@ -78,6 +79,7 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable 'label' => 'string', 'modification_metadata' => '\HubSpot\Client\Crm\Properties\Model\PropertyModificationMetadata', 'name' => 'string', + 'number_display_hint' => 'string', 'options' => '\HubSpot\Client\Crm\Properties\Model\Option[]', 'referenced_object_type' => 'string', 'sensitive_data_categories' => 'string[]', @@ -101,6 +103,7 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable 'calculation_formula' => null, 'created_at' => 'date-time', 'created_user_id' => null, + 'currency_property_name' => null, 'data_sensitivity' => null, 'date_display_hint' => null, 'description' => null, @@ -115,6 +118,7 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable 'label' => null, 'modification_metadata' => null, 'name' => null, + 'number_display_hint' => null, 'options' => null, 'referenced_object_type' => null, 'sensitive_data_categories' => null, @@ -136,6 +140,7 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable 'calculation_formula' => false, 'created_at' => false, 'created_user_id' => false, + 'currency_property_name' => false, 'data_sensitivity' => false, 'date_display_hint' => false, 'description' => false, @@ -150,6 +155,7 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable 'label' => false, 'modification_metadata' => false, 'name' => false, + 'number_display_hint' => false, 'options' => false, 'referenced_object_type' => false, 'sensitive_data_categories' => false, @@ -251,6 +257,7 @@ public function isNullableSetToNull(string $property): bool 'calculation_formula' => 'calculationFormula', 'created_at' => 'createdAt', 'created_user_id' => 'createdUserId', + 'currency_property_name' => 'currencyPropertyName', 'data_sensitivity' => 'dataSensitivity', 'date_display_hint' => 'dateDisplayHint', 'description' => 'description', @@ -265,6 +272,7 @@ public function isNullableSetToNull(string $property): bool 'label' => 'label', 'modification_metadata' => 'modificationMetadata', 'name' => 'name', + 'number_display_hint' => 'numberDisplayHint', 'options' => 'options', 'referenced_object_type' => 'referencedObjectType', 'sensitive_data_categories' => 'sensitiveDataCategories', @@ -286,6 +294,7 @@ public function isNullableSetToNull(string $property): bool 'calculation_formula' => 'setCalculationFormula', 'created_at' => 'setCreatedAt', 'created_user_id' => 'setCreatedUserId', + 'currency_property_name' => 'setCurrencyPropertyName', 'data_sensitivity' => 'setDataSensitivity', 'date_display_hint' => 'setDateDisplayHint', 'description' => 'setDescription', @@ -300,6 +309,7 @@ public function isNullableSetToNull(string $property): bool 'label' => 'setLabel', 'modification_metadata' => 'setModificationMetadata', 'name' => 'setName', + 'number_display_hint' => 'setNumberDisplayHint', 'options' => 'setOptions', 'referenced_object_type' => 'setReferencedObjectType', 'sensitive_data_categories' => 'setSensitiveDataCategories', @@ -321,6 +331,7 @@ public function isNullableSetToNull(string $property): bool 'calculation_formula' => 'getCalculationFormula', 'created_at' => 'getCreatedAt', 'created_user_id' => 'getCreatedUserId', + 'currency_property_name' => 'getCurrencyPropertyName', 'data_sensitivity' => 'getDataSensitivity', 'date_display_hint' => 'getDateDisplayHint', 'description' => 'getDescription', @@ -335,6 +346,7 @@ public function isNullableSetToNull(string $property): bool 'label' => 'getLabel', 'modification_metadata' => 'getModificationMetadata', 'name' => 'getName', + 'number_display_hint' => 'getNumberDisplayHint', 'options' => 'getOptions', 'referenced_object_type' => 'getReferencedObjectType', 'sensitive_data_categories' => 'getSensitiveDataCategories', @@ -392,6 +404,12 @@ public function getModelName() public const DATE_DISPLAY_HINT_ABSOLUTE_WITH_RELATIVE = 'absolute_with_relative'; public const DATE_DISPLAY_HINT_TIME_SINCE = 'time_since'; public const DATE_DISPLAY_HINT_TIME_UNTIL = 'time_until'; + public const NUMBER_DISPLAY_HINT_CURRENCY = 'currency'; + public const NUMBER_DISPLAY_HINT_DURATION = 'duration'; + public const NUMBER_DISPLAY_HINT_FORMATTED = 'formatted'; + public const NUMBER_DISPLAY_HINT_PERCENTAGE = 'percentage'; + public const NUMBER_DISPLAY_HINT_PROBABILITY = 'probability'; + public const NUMBER_DISPLAY_HINT_UNFORMATTED = 'unformatted'; /** * Gets allowable values of the enum @@ -422,6 +440,23 @@ public function getDateDisplayHintAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNumberDisplayHintAllowableValues() + { + return [ + self::NUMBER_DISPLAY_HINT_CURRENCY, + self::NUMBER_DISPLAY_HINT_DURATION, + self::NUMBER_DISPLAY_HINT_FORMATTED, + self::NUMBER_DISPLAY_HINT_PERCENTAGE, + self::NUMBER_DISPLAY_HINT_PROBABILITY, + self::NUMBER_DISPLAY_HINT_UNFORMATTED, + ]; + } + /** * Associative array for storing property values * @@ -443,6 +478,7 @@ public function __construct(?array $data = null) $this->setIfExists('calculation_formula', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('created_user_id', $data ?? [], null); + $this->setIfExists('currency_property_name', $data ?? [], null); $this->setIfExists('data_sensitivity', $data ?? [], null); $this->setIfExists('date_display_hint', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); @@ -457,6 +493,7 @@ public function __construct(?array $data = null) $this->setIfExists('label', $data ?? [], null); $this->setIfExists('modification_metadata', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('number_display_hint', $data ?? [], null); $this->setIfExists('options', $data ?? [], null); $this->setIfExists('referenced_object_type', $data ?? [], null); $this->setIfExists('sensitive_data_categories', $data ?? [], null); @@ -526,6 +563,15 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + $allowedValues = $this->getNumberDisplayHintAllowableValues(); + if (!is_null($this->container['number_display_hint']) && !in_array($this->container['number_display_hint'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'number_display_hint', must be one of '%s'", + $this->container['number_display_hint'], + implode("', '", $allowedValues) + ); + } + if ($this->container['options'] === null) { $invalidProperties[] = "'options' can't be null"; } @@ -709,6 +755,33 @@ public function setCreatedUserId($created_user_id) return $this; } + /** + * Gets currency_property_name + * + * @return string|null + */ + public function getCurrencyPropertyName() + { + return $this->container['currency_property_name']; + } + + /** + * Sets currency_property_name + * + * @param string|null $currency_property_name The name of the related currency property. + * + * @return self + */ + public function setCurrencyPropertyName($currency_property_name) + { + if (is_null($currency_property_name)) { + throw new \InvalidArgumentException('non-nullable currency_property_name cannot be null'); + } + $this->container['currency_property_name'] = $currency_property_name; + + return $this; + } + /** * Gets data_sensitivity * @@ -759,7 +832,7 @@ public function getDateDisplayHint() /** * Sets date_display_hint * - * @param string|null $date_display_hint date_display_hint + * @param string|null $date_display_hint Indicates how date values should be displayed, with options such as 'absolute', 'absolute_with_relative', 'time_since', or 'time_until'. * * @return self */ @@ -823,7 +896,7 @@ public function getDisplayOrder() /** * Sets display_order * - * @param int|null $display_order Property groups are displayed in order starting with the lowest positive integer value. Values of -1 will cause the property group to be displayed after any positive values. + * @param int|null $display_order Properties are shown in order, starting with the lowest positive integer value. * * @return self */ @@ -850,7 +923,7 @@ public function getExternalOptions() /** * Sets external_options * - * @param bool|null $external_options Applicable only for 'enumeration' type properties. Should be set to true in conjunction with a 'referencedObjectType' of 'OWNER'. Otherwise false. + * @param bool|null $external_options For default properties, true indicates that the options are stored externally to the property settings. * * @return self */ @@ -985,7 +1058,7 @@ public function getHidden() /** * Sets hidden * - * @param bool|null $hidden If true, the property won't be visible and can't be used in HubSpot. + * @param bool|null $hidden Whether or not the property will be hidden from the HubSpot UI. It's recommended this be set to false for custom properties. * * @return self */ @@ -1039,7 +1112,7 @@ public function getLabel() /** * Sets label * - * @param string $label A human-readable label that will be shown in HubSpot. + * @param string $label A human-readable property label that will be shown in HubSpot. * * @return self */ @@ -1093,7 +1166,7 @@ public function getName() /** * Sets name * - * @param string $name The name of the property to read or modify. + * @param string $name The internal property name, which must be used when referencing the property via the API. * * @return self */ @@ -1107,6 +1180,43 @@ public function setName($name) return $this; } + /** + * Gets number_display_hint + * + * @return string|null + */ + public function getNumberDisplayHint() + { + return $this->container['number_display_hint']; + } + + /** + * Sets number_display_hint + * + * @param string|null $number_display_hint Hint for how a number property is displayed and validated in HubSpot's UI. Can be: \"unformatted\", \"formatted\", \"currency\", \"percentage\", \"duration\", or \"probability\". + * + * @return self + */ + public function setNumberDisplayHint($number_display_hint) + { + if (is_null($number_display_hint)) { + throw new \InvalidArgumentException('non-nullable number_display_hint cannot be null'); + } + $allowedValues = $this->getNumberDisplayHintAllowableValues(); + if (!in_array($number_display_hint, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'number_display_hint', must be one of '%s'", + $number_display_hint, + implode("', '", $allowedValues) + ) + ); + } + $this->container['number_display_hint'] = $number_display_hint; + + return $this; + } + /** * Gets options * @@ -1120,7 +1230,7 @@ public function getOptions() /** * Sets options * - * @param \HubSpot\Client\Crm\Properties\Model\Option[] $options A list of valid options for the property. This field is required for enumerated properties. + * @param \HubSpot\Client\Crm\Properties\Model\Option[] $options A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types. * * @return self */ @@ -1147,7 +1257,7 @@ public function getReferencedObjectType() /** * Sets referenced_object_type * - * @param string|null $referenced_object_type Should be set to 'OWNER' when 'externalOptions' is true, which causes the property to dynamically pull option values from the current HubSpot users. + * @param string|null $referenced_object_type If this property is related to other object(s), they'll be listed here. * * @return self */ @@ -1228,7 +1338,7 @@ public function getType() /** * Sets type * - * @param string $type The data type of the property. + * @param string $type The property data type. * * @return self */ diff --git a/codegen/Crm/Properties/Model/PropertyCreate.php b/codegen/Crm/Properties/Model/PropertyCreate.php index 741953cc..7deb2c29 100644 --- a/codegen/Crm/Properties/Model/PropertyCreate.php +++ b/codegen/Crm/Properties/Model/PropertyCreate.php @@ -58,6 +58,7 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'calculation_formula' => 'string', + 'currency_property_name' => 'string', 'data_sensitivity' => 'string', 'description' => 'string', 'display_order' => 'int', @@ -69,8 +70,10 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable 'hidden' => 'bool', 'label' => 'string', 'name' => 'string', + 'number_display_hint' => 'string', 'options' => '\HubSpot\Client\Crm\Properties\Model\OptionInput[]', 'referenced_object_type' => 'string', + 'show_currency_symbol' => 'bool', 'type' => 'string' ]; @@ -83,6 +86,7 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'calculation_formula' => null, + 'currency_property_name' => null, 'data_sensitivity' => null, 'description' => null, 'display_order' => 'int32', @@ -94,8 +98,10 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable 'hidden' => null, 'label' => null, 'name' => null, + 'number_display_hint' => null, 'options' => null, 'referenced_object_type' => null, + 'show_currency_symbol' => null, 'type' => null ]; @@ -106,6 +112,7 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'calculation_formula' => false, + 'currency_property_name' => false, 'data_sensitivity' => false, 'description' => false, 'display_order' => false, @@ -117,8 +124,10 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable 'hidden' => false, 'label' => false, 'name' => false, + 'number_display_hint' => false, 'options' => false, 'referenced_object_type' => false, + 'show_currency_symbol' => false, 'type' => false ]; @@ -209,6 +218,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'calculation_formula' => 'calculationFormula', + 'currency_property_name' => 'currencyPropertyName', 'data_sensitivity' => 'dataSensitivity', 'description' => 'description', 'display_order' => 'displayOrder', @@ -220,8 +230,10 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'hidden', 'label' => 'label', 'name' => 'name', + 'number_display_hint' => 'numberDisplayHint', 'options' => 'options', 'referenced_object_type' => 'referencedObjectType', + 'show_currency_symbol' => 'showCurrencySymbol', 'type' => 'type' ]; @@ -232,6 +244,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'calculation_formula' => 'setCalculationFormula', + 'currency_property_name' => 'setCurrencyPropertyName', 'data_sensitivity' => 'setDataSensitivity', 'description' => 'setDescription', 'display_order' => 'setDisplayOrder', @@ -243,8 +256,10 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'setHidden', 'label' => 'setLabel', 'name' => 'setName', + 'number_display_hint' => 'setNumberDisplayHint', 'options' => 'setOptions', 'referenced_object_type' => 'setReferencedObjectType', + 'show_currency_symbol' => 'setShowCurrencySymbol', 'type' => 'setType' ]; @@ -255,6 +270,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'calculation_formula' => 'getCalculationFormula', + 'currency_property_name' => 'getCurrencyPropertyName', 'data_sensitivity' => 'getDataSensitivity', 'description' => 'getDescription', 'display_order' => 'getDisplayOrder', @@ -266,8 +282,10 @@ public function isNullableSetToNull(string $property): bool 'hidden' => 'getHidden', 'label' => 'getLabel', 'name' => 'getName', + 'number_display_hint' => 'getNumberDisplayHint', 'options' => 'getOptions', 'referenced_object_type' => 'getReferencedObjectType', + 'show_currency_symbol' => 'getShowCurrencySymbol', 'type' => 'getType' ]; @@ -327,6 +345,12 @@ public function getModelName() public const FIELD_TYPE_SELECT = 'select'; public const FIELD_TYPE_TEXT = 'text'; public const FIELD_TYPE_TEXTAREA = 'textarea'; + public const NUMBER_DISPLAY_HINT_CURRENCY = 'currency'; + public const NUMBER_DISPLAY_HINT_DURATION = 'duration'; + public const NUMBER_DISPLAY_HINT_FORMATTED = 'formatted'; + public const NUMBER_DISPLAY_HINT_PERCENTAGE = 'percentage'; + public const NUMBER_DISPLAY_HINT_PROBABILITY = 'probability'; + public const NUMBER_DISPLAY_HINT_UNFORMATTED = 'unformatted'; public const TYPE_BOOL = 'bool'; public const TYPE_DATE = 'date'; public const TYPE_DATETIME = 'datetime'; @@ -372,6 +396,23 @@ public function getFieldTypeAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNumberDisplayHintAllowableValues() + { + return [ + self::NUMBER_DISPLAY_HINT_CURRENCY, + self::NUMBER_DISPLAY_HINT_DURATION, + self::NUMBER_DISPLAY_HINT_FORMATTED, + self::NUMBER_DISPLAY_HINT_PERCENTAGE, + self::NUMBER_DISPLAY_HINT_PROBABILITY, + self::NUMBER_DISPLAY_HINT_UNFORMATTED, + ]; + } + /** * Gets allowable values of the enum * @@ -406,6 +447,7 @@ public function getTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('calculation_formula', $data ?? [], null); + $this->setIfExists('currency_property_name', $data ?? [], null); $this->setIfExists('data_sensitivity', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('display_order', $data ?? [], null); @@ -417,8 +459,10 @@ public function __construct(?array $data = null) $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('number_display_hint', $data ?? [], null); $this->setIfExists('options', $data ?? [], null); $this->setIfExists('referenced_object_type', $data ?? [], null); + $this->setIfExists('show_currency_symbol', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -479,6 +523,15 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + $allowedValues = $this->getNumberDisplayHintAllowableValues(); + if (!is_null($this->container['number_display_hint']) && !in_array($this->container['number_display_hint'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'number_display_hint', must be one of '%s'", + $this->container['number_display_hint'], + implode("', '", $allowedValues) + ); + } + if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -533,6 +586,33 @@ public function setCalculationFormula($calculation_formula) return $this; } + /** + * Gets currency_property_name + * + * @return string|null + */ + public function getCurrencyPropertyName() + { + return $this->container['currency_property_name']; + } + + /** + * Sets currency_property_name + * + * @param string|null $currency_property_name currency_property_name + * + * @return self + */ + public function setCurrencyPropertyName($currency_property_name) + { + if (is_null($currency_property_name)) { + throw new \InvalidArgumentException('non-nullable currency_property_name cannot be null'); + } + $this->container['currency_property_name'] = $currency_property_name; + + return $this; + } + /** * Gets data_sensitivity * @@ -546,7 +626,7 @@ public function getDataSensitivity() /** * Sets data_sensitivity * - * @param string|null $data_sensitivity data_sensitivity + * @param string|null $data_sensitivity Indicates the sensitivity level of the property, with options: highly_sensitive, non_sensitive, or sensitive. * * @return self */ @@ -610,7 +690,7 @@ public function getDisplayOrder() /** * Sets display_order * - * @param int|null $display_order Property groups are displayed in order starting with the lowest positive integer value. Values of -1 will cause the property group to be displayed after any positive values. + * @param int|null $display_order Properties are displayed in order starting with the lowest positive integer value. Values of -1 will cause the property to be displayed after any positive values. * * @return self */ @@ -809,7 +889,7 @@ public function getLabel() /** * Sets label * - * @param string $label A human-readable label that will be shown in HubSpot. + * @param string $label A human-readable property label that will be shown in HubSpot. * * @return self */ @@ -836,7 +916,7 @@ public function getName() /** * Sets name * - * @param string $name The name of the property to read or modify. + * @param string $name The internal property name, which must be used when referencing the property via the API. * * @return self */ @@ -850,6 +930,43 @@ public function setName($name) return $this; } + /** + * Gets number_display_hint + * + * @return string|null + */ + public function getNumberDisplayHint() + { + return $this->container['number_display_hint']; + } + + /** + * Sets number_display_hint + * + * @param string|null $number_display_hint number_display_hint + * + * @return self + */ + public function setNumberDisplayHint($number_display_hint) + { + if (is_null($number_display_hint)) { + throw new \InvalidArgumentException('non-nullable number_display_hint cannot be null'); + } + $allowedValues = $this->getNumberDisplayHintAllowableValues(); + if (!in_array($number_display_hint, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'number_display_hint', must be one of '%s'", + $number_display_hint, + implode("', '", $allowedValues) + ) + ); + } + $this->container['number_display_hint'] = $number_display_hint; + + return $this; + } + /** * Gets options * @@ -904,6 +1021,33 @@ public function setReferencedObjectType($referenced_object_type) return $this; } + /** + * Gets show_currency_symbol + * + * @return bool|null + */ + public function getShowCurrencySymbol() + { + return $this->container['show_currency_symbol']; + } + + /** + * Sets show_currency_symbol + * + * @param bool|null $show_currency_symbol show_currency_symbol + * + * @return self + */ + public function setShowCurrencySymbol($show_currency_symbol) + { + if (is_null($show_currency_symbol)) { + throw new \InvalidArgumentException('non-nullable show_currency_symbol cannot be null'); + } + $this->container['show_currency_symbol'] = $show_currency_symbol; + + return $this; + } + /** * Gets type * diff --git a/codegen/Crm/Properties/Model/PropertyGroup.php b/codegen/Crm/Properties/Model/PropertyGroup.php index c008d54e..36c8fcd4 100644 --- a/codegen/Crm/Properties/Model/PropertyGroup.php +++ b/codegen/Crm/Properties/Model/PropertyGroup.php @@ -336,7 +336,7 @@ public function getArchived() /** * Sets archived * - * @param bool $archived archived + * @param bool $archived Indicates whether the property group is archived. * * @return self */ @@ -417,7 +417,7 @@ public function getName() /** * Sets name * - * @param string $name The name of the property to read or modify. + * @param string $name The internal property group name, which must be used when referencing the property group via the API. * * @return self */ diff --git a/codegen/Crm/Properties/Model/PropertyGroupCreate.php b/codegen/Crm/Properties/Model/PropertyGroupCreate.php index e8ac493f..ce3234ba 100644 --- a/codegen/Crm/Properties/Model/PropertyGroupCreate.php +++ b/codegen/Crm/Properties/Model/PropertyGroupCreate.php @@ -376,7 +376,7 @@ public function getName() /** * Sets name * - * @param string $name The name of the property to read or modify. + * @param string $name The internal property group name, which must be used when referencing the property group via the API. * * @return self */ diff --git a/codegen/Crm/Properties/Model/PropertyModificationMetadata.php b/codegen/Crm/Properties/Model/PropertyModificationMetadata.php index 5be5018a..89cfb5ff 100644 --- a/codegen/Crm/Properties/Model/PropertyModificationMetadata.php +++ b/codegen/Crm/Properties/Model/PropertyModificationMetadata.php @@ -332,7 +332,7 @@ public function getArchivable() /** * Sets archivable * - * @param bool $archivable archivable + * @param bool $archivable Specifies whether the property can be archived. * * @return self */ @@ -359,7 +359,7 @@ public function getReadOnlyDefinition() /** * Sets read_only_definition * - * @param bool $read_only_definition read_only_definition + * @param bool $read_only_definition Indicates whether the property's definition is read-only and cannot be modified. * * @return self */ @@ -386,7 +386,7 @@ public function getReadOnlyOptions() /** * Sets read_only_options * - * @param bool|null $read_only_options read_only_options + * @param bool|null $read_only_options Indicates whether the property's options are read-only and cannot be modified. * * @return self */ @@ -413,7 +413,7 @@ public function getReadOnlyValue() /** * Sets read_only_value * - * @param bool $read_only_value read_only_value + * @param bool $read_only_value Indicates whether the property's value is read-only and cannot be modified. * * @return self */ diff --git a/codegen/Crm/Properties/Model/PropertyUpdate.php b/codegen/Crm/Properties/Model/PropertyUpdate.php index 14735caf..0f869bb2 100644 --- a/codegen/Crm/Properties/Model/PropertyUpdate.php +++ b/codegen/Crm/Properties/Model/PropertyUpdate.php @@ -58,6 +58,7 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'calculation_formula' => 'string', + 'currency_property_name' => 'string', 'description' => 'string', 'display_order' => 'int', 'field_type' => 'string', @@ -65,7 +66,9 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable 'group_name' => 'string', 'hidden' => 'bool', 'label' => 'string', + 'number_display_hint' => 'string', 'options' => '\HubSpot\Client\Crm\Properties\Model\OptionInput[]', + 'show_currency_symbol' => 'bool', 'type' => 'string' ]; @@ -78,6 +81,7 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'calculation_formula' => null, + 'currency_property_name' => null, 'description' => null, 'display_order' => 'int32', 'field_type' => null, @@ -85,7 +89,9 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable 'group_name' => null, 'hidden' => null, 'label' => null, + 'number_display_hint' => null, 'options' => null, + 'show_currency_symbol' => null, 'type' => null ]; @@ -96,6 +102,7 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'calculation_formula' => false, + 'currency_property_name' => false, 'description' => false, 'display_order' => false, 'field_type' => false, @@ -103,7 +110,9 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable 'group_name' => false, 'hidden' => false, 'label' => false, + 'number_display_hint' => false, 'options' => false, + 'show_currency_symbol' => false, 'type' => false ]; @@ -194,6 +203,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'calculation_formula' => 'calculationFormula', + 'currency_property_name' => 'currencyPropertyName', 'description' => 'description', 'display_order' => 'displayOrder', 'field_type' => 'fieldType', @@ -201,7 +211,9 @@ public function isNullableSetToNull(string $property): bool 'group_name' => 'groupName', 'hidden' => 'hidden', 'label' => 'label', + 'number_display_hint' => 'numberDisplayHint', 'options' => 'options', + 'show_currency_symbol' => 'showCurrencySymbol', 'type' => 'type' ]; @@ -212,6 +224,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'calculation_formula' => 'setCalculationFormula', + 'currency_property_name' => 'setCurrencyPropertyName', 'description' => 'setDescription', 'display_order' => 'setDisplayOrder', 'field_type' => 'setFieldType', @@ -219,7 +232,9 @@ public function isNullableSetToNull(string $property): bool 'group_name' => 'setGroupName', 'hidden' => 'setHidden', 'label' => 'setLabel', + 'number_display_hint' => 'setNumberDisplayHint', 'options' => 'setOptions', + 'show_currency_symbol' => 'setShowCurrencySymbol', 'type' => 'setType' ]; @@ -230,6 +245,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'calculation_formula' => 'getCalculationFormula', + 'currency_property_name' => 'getCurrencyPropertyName', 'description' => 'getDescription', 'display_order' => 'getDisplayOrder', 'field_type' => 'getFieldType', @@ -237,7 +253,9 @@ public function isNullableSetToNull(string $property): bool 'group_name' => 'getGroupName', 'hidden' => 'getHidden', 'label' => 'getLabel', + 'number_display_hint' => 'getNumberDisplayHint', 'options' => 'getOptions', + 'show_currency_symbol' => 'getShowCurrencySymbol', 'type' => 'getType' ]; @@ -294,6 +312,12 @@ public function getModelName() public const FIELD_TYPE_SELECT = 'select'; public const FIELD_TYPE_TEXT = 'text'; public const FIELD_TYPE_TEXTAREA = 'textarea'; + public const NUMBER_DISPLAY_HINT_CURRENCY = 'currency'; + public const NUMBER_DISPLAY_HINT_DURATION = 'duration'; + public const NUMBER_DISPLAY_HINT_FORMATTED = 'formatted'; + public const NUMBER_DISPLAY_HINT_PERCENTAGE = 'percentage'; + public const NUMBER_DISPLAY_HINT_PROBABILITY = 'probability'; + public const NUMBER_DISPLAY_HINT_UNFORMATTED = 'unformatted'; public const TYPE_BOOL = 'bool'; public const TYPE_DATE = 'date'; public const TYPE_DATETIME = 'datetime'; @@ -325,6 +349,23 @@ public function getFieldTypeAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNumberDisplayHintAllowableValues() + { + return [ + self::NUMBER_DISPLAY_HINT_CURRENCY, + self::NUMBER_DISPLAY_HINT_DURATION, + self::NUMBER_DISPLAY_HINT_FORMATTED, + self::NUMBER_DISPLAY_HINT_PERCENTAGE, + self::NUMBER_DISPLAY_HINT_PROBABILITY, + self::NUMBER_DISPLAY_HINT_UNFORMATTED, + ]; + } + /** * Gets allowable values of the enum * @@ -359,6 +400,7 @@ public function getTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('calculation_formula', $data ?? [], null); + $this->setIfExists('currency_property_name', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('display_order', $data ?? [], null); $this->setIfExists('field_type', $data ?? [], null); @@ -366,7 +408,9 @@ public function __construct(?array $data = null) $this->setIfExists('group_name', $data ?? [], null); $this->setIfExists('hidden', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('number_display_hint', $data ?? [], null); $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('show_currency_symbol', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -406,6 +450,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getNumberDisplayHintAllowableValues(); + if (!is_null($this->container['number_display_hint']) && !in_array($this->container['number_display_hint'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'number_display_hint', must be one of '%s'", + $this->container['number_display_hint'], + implode("', '", $allowedValues) + ); + } + $allowedValues = $this->getTypeAllowableValues(); if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -457,6 +510,33 @@ public function setCalculationFormula($calculation_formula) return $this; } + /** + * Gets currency_property_name + * + * @return string|null + */ + public function getCurrencyPropertyName() + { + return $this->container['currency_property_name']; + } + + /** + * Sets currency_property_name + * + * @param string|null $currency_property_name currency_property_name + * + * @return self + */ + public function setCurrencyPropertyName($currency_property_name) + { + if (is_null($currency_property_name)) { + throw new \InvalidArgumentException('non-nullable currency_property_name cannot be null'); + } + $this->container['currency_property_name'] = $currency_property_name; + + return $this; + } + /** * Gets description * @@ -497,7 +577,7 @@ public function getDisplayOrder() /** * Sets display_order * - * @param int|null $display_order Property groups are displayed in order starting with the lowest positive integer value. Values of -1 will cause the property group to be displayed after any positive values. + * @param int|null $display_order Properties are displayed in order starting with the lowest positive integer value. Values of -1 will cause the Property to be displayed after any positive values. * * @return self */ @@ -642,7 +722,7 @@ public function getLabel() /** * Sets label * - * @param string|null $label A human-readable label that will be shown in HubSpot. + * @param string|null $label A human-readable property label that will be shown in HubSpot. * * @return self */ @@ -656,6 +736,43 @@ public function setLabel($label) return $this; } + /** + * Gets number_display_hint + * + * @return string|null + */ + public function getNumberDisplayHint() + { + return $this->container['number_display_hint']; + } + + /** + * Sets number_display_hint + * + * @param string|null $number_display_hint number_display_hint + * + * @return self + */ + public function setNumberDisplayHint($number_display_hint) + { + if (is_null($number_display_hint)) { + throw new \InvalidArgumentException('non-nullable number_display_hint cannot be null'); + } + $allowedValues = $this->getNumberDisplayHintAllowableValues(); + if (!in_array($number_display_hint, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'number_display_hint', must be one of '%s'", + $number_display_hint, + implode("', '", $allowedValues) + ) + ); + } + $this->container['number_display_hint'] = $number_display_hint; + + return $this; + } + /** * Gets options * @@ -669,7 +786,7 @@ public function getOptions() /** * Sets options * - * @param \HubSpot\Client\Crm\Properties\Model\OptionInput[]|null $options A list of valid options for the property. This field is required for enumerated properties. + * @param \HubSpot\Client\Crm\Properties\Model\OptionInput[]|null $options A list of valid options for the property. * * @return self */ @@ -683,6 +800,33 @@ public function setOptions($options) return $this; } + /** + * Gets show_currency_symbol + * + * @return bool|null + */ + public function getShowCurrencySymbol() + { + return $this->container['show_currency_symbol']; + } + + /** + * Sets show_currency_symbol + * + * @param bool|null $show_currency_symbol show_currency_symbol + * + * @return self + */ + public function setShowCurrencySymbol($show_currency_symbol) + { + if (is_null($show_currency_symbol)) { + throw new \InvalidArgumentException('non-nullable show_currency_symbol cannot be null'); + } + $this->container['show_currency_symbol'] = $show_currency_symbol; + + return $this; + } + /** * Gets type * diff --git a/codegen/Crm/Properties/Model/StandardError.php b/codegen/Crm/Properties/Model/StandardError.php index 9f6ad2ee..8a20d972 100644 --- a/codegen/Crm/Properties/Model/StandardError.php +++ b/codegen/Crm/Properties/Model/StandardError.php @@ -35,7 +35,7 @@ * StandardError Class Doc Comment * * @category Class - * @description Ye olde error + * @description Represents a standard error response in the HubSpot API, providing detailed information about an error that occurred during an API request. * @package HubSpot\Client\Crm\Properties * @author OpenAPI Generator team * @link https://openapi-generator.tech