Skip to content

Commit eaecff5

Browse files
activitysmith-sdk-bot[bot]activitysmith-bot
andauthored
chore: regenerate SDK (#32)
Co-authored-by: activitysmith-bot <activitysmith-bot@users.noreply.github.com>
1 parent 3c60894 commit eaecff5

2 files changed

Lines changed: 470 additions & 23 deletions

File tree

generated/Model/ActivityMetric.php

Lines changed: 89 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ class ActivityMetric implements ModelInterface, ArrayAccess, \JsonSerializable
5858
*/
5959
protected static $openAPITypes = [
6060
'label' => 'string',
61-
'value' => 'float',
62-
'unit' => 'string'
61+
'value' => '\ActivitySmith\Generated\Model\ActivityMetricValue',
62+
'unit' => 'string',
63+
'color' => 'string'
6364
];
6465

6566
/**
@@ -72,7 +73,8 @@ class ActivityMetric implements ModelInterface, ArrayAccess, \JsonSerializable
7273
protected static $openAPIFormats = [
7374
'label' => null,
7475
'value' => null,
75-
'unit' => null
76+
'unit' => null,
77+
'color' => null
7678
];
7779

7880
/**
@@ -83,7 +85,8 @@ class ActivityMetric implements ModelInterface, ArrayAccess, \JsonSerializable
8385
protected static array $openAPINullables = [
8486
'label' => false,
8587
'value' => false,
86-
'unit' => false
88+
'unit' => false,
89+
'color' => false
8790
];
8891

8992
/**
@@ -174,7 +177,8 @@ public function isNullableSetToNull(string $property): bool
174177
protected static $attributeMap = [
175178
'label' => 'label',
176179
'value' => 'value',
177-
'unit' => 'unit'
180+
'unit' => 'unit',
181+
'color' => 'color'
178182
];
179183

180184
/**
@@ -185,7 +189,8 @@ public function isNullableSetToNull(string $property): bool
185189
protected static $setters = [
186190
'label' => 'setLabel',
187191
'value' => 'setValue',
188-
'unit' => 'setUnit'
192+
'unit' => 'setUnit',
193+
'color' => 'setColor'
189194
];
190195

191196
/**
@@ -196,7 +201,8 @@ public function isNullableSetToNull(string $property): bool
196201
protected static $getters = [
197202
'label' => 'getLabel',
198203
'value' => 'getValue',
199-
'unit' => 'getUnit'
204+
'unit' => 'getUnit',
205+
'color' => 'getColor'
200206
];
201207

202208
/**
@@ -240,6 +246,35 @@ public function getModelName()
240246
return self::$openAPIModelName;
241247
}
242248

249+
public const COLOR_LIME = 'lime';
250+
public const COLOR_GREEN = 'green';
251+
public const COLOR_CYAN = 'cyan';
252+
public const COLOR_BLUE = 'blue';
253+
public const COLOR_PURPLE = 'purple';
254+
public const COLOR_MAGENTA = 'magenta';
255+
public const COLOR_RED = 'red';
256+
public const COLOR_ORANGE = 'orange';
257+
public const COLOR_YELLOW = 'yellow';
258+
259+
/**
260+
* Gets allowable values of the enum
261+
*
262+
* @return string[]
263+
*/
264+
public function getColorAllowableValues()
265+
{
266+
return [
267+
self::COLOR_LIME,
268+
self::COLOR_GREEN,
269+
self::COLOR_CYAN,
270+
self::COLOR_BLUE,
271+
self::COLOR_PURPLE,
272+
self::COLOR_MAGENTA,
273+
self::COLOR_RED,
274+
self::COLOR_ORANGE,
275+
self::COLOR_YELLOW,
276+
];
277+
}
243278

244279
/**
245280
* Associative array for storing property values
@@ -259,6 +294,7 @@ public function __construct(array $data = null)
259294
$this->setIfExists('label', $data ?? [], null);
260295
$this->setIfExists('value', $data ?? [], null);
261296
$this->setIfExists('unit', $data ?? [], null);
297+
$this->setIfExists('color', $data ?? [], null);
262298
}
263299

264300
/**
@@ -298,12 +334,13 @@ public function listInvalidProperties()
298334
if ($this->container['value'] === null) {
299335
$invalidProperties[] = "'value' can't be null";
300336
}
301-
if (($this->container['value'] > 100)) {
302-
$invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 100.";
303-
}
304-
305-
if (($this->container['value'] < 0)) {
306-
$invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 0.";
337+
$allowedValues = $this->getColorAllowableValues();
338+
if (!is_null($this->container['color']) && !in_array($this->container['color'], $allowedValues, true)) {
339+
$invalidProperties[] = sprintf(
340+
"invalid value '%s' for 'color', must be one of '%s'",
341+
$this->container['color'],
342+
implode("', '", $allowedValues)
343+
);
307344
}
308345

309346
return $invalidProperties;
@@ -356,7 +393,7 @@ public function setLabel($label)
356393
/**
357394
* Gets value
358395
*
359-
* @return float
396+
* @return \ActivitySmith\Generated\Model\ActivityMetricValue
360397
*/
361398
public function getValue()
362399
{
@@ -366,7 +403,7 @@ public function getValue()
366403
/**
367404
* Sets value
368405
*
369-
* @param float $value value
406+
* @param \ActivitySmith\Generated\Model\ActivityMetricValue $value value
370407
*
371408
* @return self
372409
*/
@@ -375,14 +412,6 @@ public function setValue($value)
375412
if (is_null($value)) {
376413
throw new \InvalidArgumentException('non-nullable value cannot be null');
377414
}
378-
379-
if (($value > 100)) {
380-
throw new \InvalidArgumentException('invalid value for $value when calling ActivityMetric., must be smaller than or equal to 100.');
381-
}
382-
if (($value < 0)) {
383-
throw new \InvalidArgumentException('invalid value for $value when calling ActivityMetric., must be bigger than or equal to 0.');
384-
}
385-
386415
$this->container['value'] = $value;
387416

388417
return $this;
@@ -414,6 +443,43 @@ public function setUnit($unit)
414443

415444
return $this;
416445
}
446+
447+
/**
448+
* Gets color
449+
*
450+
* @return string|null
451+
*/
452+
public function getColor()
453+
{
454+
return $this->container['color'];
455+
}
456+
457+
/**
458+
* Sets color
459+
*
460+
* @param string|null $color Optional per-metric accent color for metrics and stats activities.
461+
*
462+
* @return self
463+
*/
464+
public function setColor($color)
465+
{
466+
if (is_null($color)) {
467+
throw new \InvalidArgumentException('non-nullable color cannot be null');
468+
}
469+
$allowedValues = $this->getColorAllowableValues();
470+
if (!in_array($color, $allowedValues, true)) {
471+
throw new \InvalidArgumentException(
472+
sprintf(
473+
"Invalid value '%s' for 'color', must be one of '%s'",
474+
$color,
475+
implode("', '", $allowedValues)
476+
)
477+
);
478+
}
479+
$this->container['color'] = $color;
480+
481+
return $this;
482+
}
417483
/**
418484
* Returns true if offset exists. False otherwise.
419485
*

0 commit comments

Comments
 (0)