From 48413bdd5eb353d36a852268aeb7eb34ef3d251a Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Sun, 3 May 2026 12:07:41 +0000 Subject: [PATCH] chore: regenerate SDK --- generated/Configuration.php | 4 +- generated/Model/MetricValueUpdateResponse.php | 38 +- generated/Model/WidgetMetric.php | 62 +-- generated/Model/WidgetMetricLatestValue.php | 382 ------------------ 4 files changed, 38 insertions(+), 448 deletions(-) delete mode 100644 generated/Model/WidgetMetricLatestValue.php diff --git a/generated/Configuration.php b/generated/Configuration.php index d12bcb4..ab518e5 100644 --- a/generated/Configuration.php +++ b/generated/Configuration.php @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/1.1.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.2.0/PHP'; /** * Debug switch (default set to false) @@ -433,7 +433,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 1.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 1.1.0' . PHP_EOL; + $report .= ' SDK Package Version: 1.2.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/generated/Model/MetricValueUpdateResponse.php b/generated/Model/MetricValueUpdateResponse.php index d59af85..dd6bfba 100644 --- a/generated/Model/MetricValueUpdateResponse.php +++ b/generated/Model/MetricValueUpdateResponse.php @@ -57,7 +57,7 @@ class MetricValueUpdateResponse implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'metric' => '\ActivitySmith\Generated\Model\WidgetMetric' + 'success' => 'bool' ]; /** @@ -68,7 +68,7 @@ class MetricValueUpdateResponse implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'metric' => null + 'success' => null ]; /** @@ -77,7 +77,7 @@ class MetricValueUpdateResponse implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'metric' => false + 'success' => false ]; /** @@ -166,7 +166,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'metric' => 'metric' + 'success' => 'success' ]; /** @@ -175,7 +175,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'metric' => 'setMetric' + 'success' => 'setSuccess' ]; /** @@ -184,7 +184,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'metric' => 'getMetric' + 'success' => 'getSuccess' ]; /** @@ -244,7 +244,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('metric', $data ?? [], null); + $this->setIfExists('success', $data ?? [], null); } /** @@ -274,8 +274,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['metric'] === null) { - $invalidProperties[] = "'metric' can't be null"; + if ($this->container['success'] === null) { + $invalidProperties[] = "'success' can't be null"; } return $invalidProperties; } @@ -293,28 +293,28 @@ public function valid() /** - * Gets metric + * Gets success * - * @return \ActivitySmith\Generated\Model\WidgetMetric + * @return bool */ - public function getMetric() + public function getSuccess() { - return $this->container['metric']; + return $this->container['success']; } /** - * Sets metric + * Sets success * - * @param \ActivitySmith\Generated\Model\WidgetMetric $metric metric + * @param bool $success success * * @return self */ - public function setMetric($metric) + public function setSuccess($success) { - if (is_null($metric)) { - throw new \InvalidArgumentException('non-nullable metric cannot be null'); + if (is_null($success)) { + throw new \InvalidArgumentException('non-nullable success cannot be null'); } - $this->container['metric'] = $metric; + $this->container['success'] = $success; return $this; } diff --git a/generated/Model/WidgetMetric.php b/generated/Model/WidgetMetric.php index fca6f47..05715d3 100644 --- a/generated/Model/WidgetMetric.php +++ b/generated/Model/WidgetMetric.php @@ -65,7 +65,7 @@ class WidgetMetric implements ModelInterface, ArrayAccess, \JsonSerializable 'unit' => 'string', 'unitSpacing' => '\ActivitySmith\Generated\Model\MetricUnitSpacing', 'format' => '\ActivitySmith\Generated\Model\MetricFormat', - 'latestValue' => '\ActivitySmith\Generated\Model\WidgetMetricLatestValue', + 'latestValue' => 'float', 'latestValueAt' => '\DateTime', 'createdAt' => '\DateTime', 'updatedAt' => '\DateTime' @@ -101,12 +101,12 @@ class WidgetMetric implements ModelInterface, ArrayAccess, \JsonSerializable 'publicId' => false, 'key' => false, 'label' => false, - 'currencyCode' => true, - 'unit' => true, + 'currencyCode' => false, + 'unit' => false, 'unitSpacing' => false, 'format' => false, - 'latestValue' => true, - 'latestValueAt' => true, + 'latestValue' => false, + 'latestValueAt' => false, 'createdAt' => false, 'updatedAt' => false ]; @@ -547,22 +547,15 @@ public function getCurrencyCode() public function setCurrencyCode($currencyCode) { if (is_null($currencyCode)) { - array_push($this->openAPINullablesSetToNull, 'currencyCode'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('currencyCode', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - if (!is_null($currencyCode) && (mb_strlen($currencyCode) > 3)) { + throw new \InvalidArgumentException('non-nullable currencyCode cannot be null'); + } + if ((mb_strlen($currencyCode) > 3)) { throw new \InvalidArgumentException('invalid length for $currencyCode when calling WidgetMetric., must be smaller than or equal to 3.'); } - if (!is_null($currencyCode) && (mb_strlen($currencyCode) < 3)) { + if ((mb_strlen($currencyCode) < 3)) { throw new \InvalidArgumentException('invalid length for $currencyCode when calling WidgetMetric., must be bigger than or equal to 3.'); } - if (!is_null($currencyCode) && (!preg_match("/^[A-Z]{3}$/", ObjectSerializer::toString($currencyCode)))) { + if ((!preg_match("/^[A-Z]{3}$/", ObjectSerializer::toString($currencyCode)))) { throw new \InvalidArgumentException("invalid value for \$currencyCode when calling WidgetMetric., must conform to the pattern /^[A-Z]{3}$/."); } @@ -591,16 +584,9 @@ public function getUnit() public function setUnit($unit) { if (is_null($unit)) { - array_push($this->openAPINullablesSetToNull, 'unit'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('unit', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - if (!is_null($unit) && (mb_strlen($unit) > 16)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + if ((mb_strlen($unit) > 16)) { throw new \InvalidArgumentException('invalid length for $unit when calling WidgetMetric., must be smaller than or equal to 16.'); } @@ -666,7 +652,7 @@ public function setFormat($format) /** * Gets latestValue * - * @return \ActivitySmith\Generated\Model\WidgetMetricLatestValue + * @return float */ public function getLatestValue() { @@ -676,21 +662,14 @@ public function getLatestValue() /** * Sets latestValue * - * @param \ActivitySmith\Generated\Model\WidgetMetricLatestValue $latestValue latestValue + * @param float $latestValue Latest metric value. Numeric formats return a number. String metrics return text. * * @return self */ public function setLatestValue($latestValue) { if (is_null($latestValue)) { - array_push($this->openAPINullablesSetToNull, 'latestValue'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('latestValue', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + throw new \InvalidArgumentException('non-nullable latestValue cannot be null'); } $this->container['latestValue'] = $latestValue; @@ -717,14 +696,7 @@ public function getLatestValueAt() public function setLatestValueAt($latestValueAt) { if (is_null($latestValueAt)) { - array_push($this->openAPINullablesSetToNull, 'latestValueAt'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('latestValueAt', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + throw new \InvalidArgumentException('non-nullable latestValueAt cannot be null'); } $this->container['latestValueAt'] = $latestValueAt; diff --git a/generated/Model/WidgetMetricLatestValue.php b/generated/Model/WidgetMetricLatestValue.php deleted file mode 100644 index fae9c56..0000000 --- a/generated/Model/WidgetMetricLatestValue.php +++ /dev/null @@ -1,382 +0,0 @@ - - */ -class WidgetMetricLatestValue implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'WidgetMetric_latest_value'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - - ]; - - /** - * 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 = [ - - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - -