diff --git a/README.md b/README.md index fd06f0b..4512559 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ declare(strict_types=1); use ActivitySmith\ActivitySmith; use ActivitySmith\LiveActivityAction; +use ActivitySmith\LiveActivityAlertBadge; +use ActivitySmith\LiveActivityAlertIcon; use ActivitySmith\LiveActivityContentState; use ActivitySmith\LiveActivityMetric; use ActivitySmith\PushAction; @@ -122,12 +124,13 @@ $activitysmith->notifications->send( ## Live Activities -There are four types of Live Activities: +There are five types of Live Activities: - `stats`: best for showing business numbers side by side, such as revenue, sales, new users, conversion, refunds, or any other value you want visible at a glance - `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate - `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs - `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads +- `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states ### Start & Update Live Activity @@ -232,6 +235,37 @@ $activitysmith->liveActivities->stream( ); ``` +#### Alert + +
+
+
getTempFolderPath() . PHP_EOL;
return $report;
diff --git a/generated/Model/ActivityMetric.php b/generated/Model/ActivityMetric.php
index 1d8c1c6..abae08c 100644
--- a/generated/Model/ActivityMetric.php
+++ b/generated/Model/ActivityMetric.php
@@ -255,6 +255,7 @@ public function getModelName()
public const COLOR_RED = 'red';
public const COLOR_ORANGE = 'orange';
public const COLOR_YELLOW = 'yellow';
+ public const COLOR_GRAY = 'gray';
/**
* Gets allowable values of the enum
@@ -273,6 +274,7 @@ public function getColorAllowableValues()
self::COLOR_RED,
self::COLOR_ORANGE,
self::COLOR_YELLOW,
+ self::COLOR_GRAY,
];
}
diff --git a/generated/Model/ContentStateEnd.php b/generated/Model/ContentStateEnd.php
index e16eae8..b02b1c8 100644
--- a/generated/Model/ContentStateEnd.php
+++ b/generated/Model/ContentStateEnd.php
@@ -35,7 +35,7 @@
* ContentStateEnd Class Doc Comment
*
* @category Class
- * @description End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
+ * @description End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message, with optional icon and badge. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
* @package ActivitySmith\Generated
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
@@ -66,6 +66,9 @@ class ContentStateEnd implements ModelInterface, ArrayAccess, \JsonSerializable
'value' => 'float',
'upperLimit' => 'float',
'metrics' => '\ActivitySmith\Generated\Model\ActivityMetric[]',
+ 'message' => 'string',
+ 'icon' => '\ActivitySmith\Generated\Model\LiveActivityAlertIcon',
+ 'badge' => '\ActivitySmith\Generated\Model\LiveActivityAlertBadge',
'type' => 'string',
'color' => 'string',
'stepColor' => 'string',
@@ -89,6 +92,9 @@ class ContentStateEnd implements ModelInterface, ArrayAccess, \JsonSerializable
'value' => null,
'upperLimit' => null,
'metrics' => null,
+ 'message' => null,
+ 'icon' => null,
+ 'badge' => null,
'type' => null,
'color' => null,
'stepColor' => null,
@@ -110,6 +116,9 @@ class ContentStateEnd implements ModelInterface, ArrayAccess, \JsonSerializable
'value' => false,
'upperLimit' => false,
'metrics' => false,
+ 'message' => false,
+ 'icon' => false,
+ 'badge' => false,
'type' => false,
'color' => false,
'stepColor' => false,
@@ -211,6 +220,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'value',
'upperLimit' => 'upper_limit',
'metrics' => 'metrics',
+ 'message' => 'message',
+ 'icon' => 'icon',
+ 'badge' => 'badge',
'type' => 'type',
'color' => 'color',
'stepColor' => 'step_color',
@@ -232,6 +244,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'setValue',
'upperLimit' => 'setUpperLimit',
'metrics' => 'setMetrics',
+ 'message' => 'setMessage',
+ 'icon' => 'setIcon',
+ 'badge' => 'setBadge',
'type' => 'setType',
'color' => 'setColor',
'stepColor' => 'setStepColor',
@@ -253,6 +268,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'getValue',
'upperLimit' => 'getUpperLimit',
'metrics' => 'getMetrics',
+ 'message' => 'getMessage',
+ 'icon' => 'getIcon',
+ 'badge' => 'getBadge',
'type' => 'getType',
'color' => 'getColor',
'stepColor' => 'getStepColor',
@@ -305,6 +323,7 @@ public function getModelName()
public const TYPE_PROGRESS = 'progress';
public const TYPE_METRICS = 'metrics';
public const TYPE_STATS = 'stats';
+ public const TYPE_ALERT = 'alert';
public const COLOR_LIME = 'lime';
public const COLOR_GREEN = 'green';
public const COLOR_CYAN = 'cyan';
@@ -314,6 +333,7 @@ public function getModelName()
public const COLOR_RED = 'red';
public const COLOR_ORANGE = 'orange';
public const COLOR_YELLOW = 'yellow';
+ public const COLOR_GRAY = 'gray';
public const STEP_COLOR_LIME = 'lime';
public const STEP_COLOR_GREEN = 'green';
public const STEP_COLOR_CYAN = 'cyan';
@@ -323,6 +343,7 @@ public function getModelName()
public const STEP_COLOR_RED = 'red';
public const STEP_COLOR_ORANGE = 'orange';
public const STEP_COLOR_YELLOW = 'yellow';
+ public const STEP_COLOR_GRAY = 'gray';
public const STEP_COLORS_LIME = 'lime';
public const STEP_COLORS_GREEN = 'green';
public const STEP_COLORS_CYAN = 'cyan';
@@ -332,6 +353,7 @@ public function getModelName()
public const STEP_COLORS_RED = 'red';
public const STEP_COLORS_ORANGE = 'orange';
public const STEP_COLORS_YELLOW = 'yellow';
+ public const STEP_COLORS_GRAY = 'gray';
/**
* Gets allowable values of the enum
@@ -345,6 +367,7 @@ public function getTypeAllowableValues()
self::TYPE_PROGRESS,
self::TYPE_METRICS,
self::TYPE_STATS,
+ self::TYPE_ALERT,
];
}
@@ -365,6 +388,7 @@ public function getColorAllowableValues()
self::COLOR_RED,
self::COLOR_ORANGE,
self::COLOR_YELLOW,
+ self::COLOR_GRAY,
];
}
@@ -385,6 +409,7 @@ public function getStepColorAllowableValues()
self::STEP_COLOR_RED,
self::STEP_COLOR_ORANGE,
self::STEP_COLOR_YELLOW,
+ self::STEP_COLOR_GRAY,
];
}
@@ -405,6 +430,7 @@ public function getStepColorsAllowableValues()
self::STEP_COLORS_RED,
self::STEP_COLORS_ORANGE,
self::STEP_COLORS_YELLOW,
+ self::STEP_COLORS_GRAY,
];
}
@@ -431,8 +457,11 @@ public function __construct(array $data = null)
$this->setIfExists('value', $data ?? [], null);
$this->setIfExists('upperLimit', $data ?? [], null);
$this->setIfExists('metrics', $data ?? [], null);
+ $this->setIfExists('message', $data ?? [], null);
+ $this->setIfExists('icon', $data ?? [], null);
+ $this->setIfExists('badge', $data ?? [], null);
$this->setIfExists('type', $data ?? [], null);
- $this->setIfExists('color', $data ?? [], 'blue');
+ $this->setIfExists('color', $data ?? [], null);
$this->setIfExists('stepColor', $data ?? [], null);
$this->setIfExists('stepColors', $data ?? [], null);
$this->setIfExists('autoDismissMinutes', $data ?? [], 3);
@@ -492,6 +521,10 @@ public function listInvalidProperties()
$invalidProperties[] = "invalid value for 'metrics', number of items must be greater than or equal to 1.";
}
+ if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) < 1)) {
+ $invalidProperties[] = "invalid value for 'message', the character length must be bigger than or equal to 1.";
+ }
+
$allowedValues = $this->getTypeAllowableValues();
if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
@@ -779,6 +812,92 @@ public function setMetrics($metrics)
return $this;
}
+ /**
+ * Gets message
+ *
+ * @return string|null
+ */
+ public function getMessage()
+ {
+ return $this->container['message'];
+ }
+
+ /**
+ * Sets message
+ *
+ * @param string|null $message Alert message. Use for type=alert.
+ *
+ * @return self
+ */
+ public function setMessage($message)
+ {
+ if (is_null($message)) {
+ throw new \InvalidArgumentException('non-nullable message cannot be null');
+ }
+
+ if ((mb_strlen($message) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $message when calling ContentStateEnd., must be bigger than or equal to 1.');
+ }
+
+ $this->container['message'] = $message;
+
+ return $this;
+ }
+
+ /**
+ * Gets icon
+ *
+ * @return \ActivitySmith\Generated\Model\LiveActivityAlertIcon|null
+ */
+ public function getIcon()
+ {
+ return $this->container['icon'];
+ }
+
+ /**
+ * Sets icon
+ *
+ * @param \ActivitySmith\Generated\Model\LiveActivityAlertIcon|null $icon Optional SF Symbol icon for type=alert.
+ *
+ * @return self
+ */
+ public function setIcon($icon)
+ {
+ if (is_null($icon)) {
+ throw new \InvalidArgumentException('non-nullable icon cannot be null');
+ }
+ $this->container['icon'] = $icon;
+
+ return $this;
+ }
+
+ /**
+ * Gets badge
+ *
+ * @return \ActivitySmith\Generated\Model\LiveActivityAlertBadge|null
+ */
+ public function getBadge()
+ {
+ return $this->container['badge'];
+ }
+
+ /**
+ * Sets badge
+ *
+ * @param \ActivitySmith\Generated\Model\LiveActivityAlertBadge|null $badge Optional badge for type=alert.
+ *
+ * @return self
+ */
+ public function setBadge($badge)
+ {
+ if (is_null($badge)) {
+ throw new \InvalidArgumentException('non-nullable badge cannot be null');
+ }
+ $this->container['badge'] = $badge;
+
+ return $this;
+ }
+
/**
* Gets type
*
@@ -829,7 +948,7 @@ public function getColor()
/**
* Sets color
*
- * @param string|null $color Optional. Accent color for the Live Activity. Defaults to blue.
+ * @param string|null $color Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
*
* @return self
*/
diff --git a/generated/Model/ContentStateStart.php b/generated/Model/ContentStateStart.php
index efbe68a..839a0fb 100644
--- a/generated/Model/ContentStateStart.php
+++ b/generated/Model/ContentStateStart.php
@@ -35,7 +35,7 @@
* ContentStateStart Class Doc Comment
*
* @category Class
- * @description Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
+ * @description Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message, with optional icon and badge. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
* @package ActivitySmith\Generated
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
@@ -66,6 +66,9 @@ class ContentStateStart implements ModelInterface, ArrayAccess, \JsonSerializabl
'value' => 'float',
'upperLimit' => 'float',
'metrics' => '\ActivitySmith\Generated\Model\ActivityMetric[]',
+ 'message' => 'string',
+ 'icon' => '\ActivitySmith\Generated\Model\LiveActivityAlertIcon',
+ 'badge' => '\ActivitySmith\Generated\Model\LiveActivityAlertBadge',
'type' => 'string',
'color' => 'string',
'stepColor' => 'string',
@@ -88,6 +91,9 @@ class ContentStateStart implements ModelInterface, ArrayAccess, \JsonSerializabl
'value' => null,
'upperLimit' => null,
'metrics' => null,
+ 'message' => null,
+ 'icon' => null,
+ 'badge' => null,
'type' => null,
'color' => null,
'stepColor' => null,
@@ -108,6 +114,9 @@ class ContentStateStart implements ModelInterface, ArrayAccess, \JsonSerializabl
'value' => false,
'upperLimit' => false,
'metrics' => false,
+ 'message' => false,
+ 'icon' => false,
+ 'badge' => false,
'type' => false,
'color' => false,
'stepColor' => false,
@@ -208,6 +217,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'value',
'upperLimit' => 'upper_limit',
'metrics' => 'metrics',
+ 'message' => 'message',
+ 'icon' => 'icon',
+ 'badge' => 'badge',
'type' => 'type',
'color' => 'color',
'stepColor' => 'step_color',
@@ -228,6 +240,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'setValue',
'upperLimit' => 'setUpperLimit',
'metrics' => 'setMetrics',
+ 'message' => 'setMessage',
+ 'icon' => 'setIcon',
+ 'badge' => 'setBadge',
'type' => 'setType',
'color' => 'setColor',
'stepColor' => 'setStepColor',
@@ -248,6 +263,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'getValue',
'upperLimit' => 'getUpperLimit',
'metrics' => 'getMetrics',
+ 'message' => 'getMessage',
+ 'icon' => 'getIcon',
+ 'badge' => 'getBadge',
'type' => 'getType',
'color' => 'getColor',
'stepColor' => 'getStepColor',
@@ -299,6 +317,7 @@ public function getModelName()
public const TYPE_PROGRESS = 'progress';
public const TYPE_METRICS = 'metrics';
public const TYPE_STATS = 'stats';
+ public const TYPE_ALERT = 'alert';
public const COLOR_LIME = 'lime';
public const COLOR_GREEN = 'green';
public const COLOR_CYAN = 'cyan';
@@ -308,6 +327,7 @@ public function getModelName()
public const COLOR_RED = 'red';
public const COLOR_ORANGE = 'orange';
public const COLOR_YELLOW = 'yellow';
+ public const COLOR_GRAY = 'gray';
public const STEP_COLOR_LIME = 'lime';
public const STEP_COLOR_GREEN = 'green';
public const STEP_COLOR_CYAN = 'cyan';
@@ -317,6 +337,7 @@ public function getModelName()
public const STEP_COLOR_RED = 'red';
public const STEP_COLOR_ORANGE = 'orange';
public const STEP_COLOR_YELLOW = 'yellow';
+ public const STEP_COLOR_GRAY = 'gray';
public const STEP_COLORS_LIME = 'lime';
public const STEP_COLORS_GREEN = 'green';
public const STEP_COLORS_CYAN = 'cyan';
@@ -326,6 +347,7 @@ public function getModelName()
public const STEP_COLORS_RED = 'red';
public const STEP_COLORS_ORANGE = 'orange';
public const STEP_COLORS_YELLOW = 'yellow';
+ public const STEP_COLORS_GRAY = 'gray';
/**
* Gets allowable values of the enum
@@ -339,6 +361,7 @@ public function getTypeAllowableValues()
self::TYPE_PROGRESS,
self::TYPE_METRICS,
self::TYPE_STATS,
+ self::TYPE_ALERT,
];
}
@@ -359,6 +382,7 @@ public function getColorAllowableValues()
self::COLOR_RED,
self::COLOR_ORANGE,
self::COLOR_YELLOW,
+ self::COLOR_GRAY,
];
}
@@ -379,6 +403,7 @@ public function getStepColorAllowableValues()
self::STEP_COLOR_RED,
self::STEP_COLOR_ORANGE,
self::STEP_COLOR_YELLOW,
+ self::STEP_COLOR_GRAY,
];
}
@@ -399,6 +424,7 @@ public function getStepColorsAllowableValues()
self::STEP_COLORS_RED,
self::STEP_COLORS_ORANGE,
self::STEP_COLORS_YELLOW,
+ self::STEP_COLORS_GRAY,
];
}
@@ -425,8 +451,11 @@ public function __construct(array $data = null)
$this->setIfExists('value', $data ?? [], null);
$this->setIfExists('upperLimit', $data ?? [], null);
$this->setIfExists('metrics', $data ?? [], null);
+ $this->setIfExists('message', $data ?? [], null);
+ $this->setIfExists('icon', $data ?? [], null);
+ $this->setIfExists('badge', $data ?? [], null);
$this->setIfExists('type', $data ?? [], null);
- $this->setIfExists('color', $data ?? [], 'blue');
+ $this->setIfExists('color', $data ?? [], null);
$this->setIfExists('stepColor', $data ?? [], null);
$this->setIfExists('stepColors', $data ?? [], null);
}
@@ -485,6 +514,10 @@ public function listInvalidProperties()
$invalidProperties[] = "invalid value for 'metrics', number of items must be greater than or equal to 1.";
}
+ if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) < 1)) {
+ $invalidProperties[] = "invalid value for 'message', the character length must be bigger than or equal to 1.";
+ }
+
if ($this->container['type'] === null) {
$invalidProperties[] = "'type' can't be null";
}
@@ -771,6 +804,92 @@ public function setMetrics($metrics)
return $this;
}
+ /**
+ * Gets message
+ *
+ * @return string|null
+ */
+ public function getMessage()
+ {
+ return $this->container['message'];
+ }
+
+ /**
+ * Sets message
+ *
+ * @param string|null $message Required for type=alert.
+ *
+ * @return self
+ */
+ public function setMessage($message)
+ {
+ if (is_null($message)) {
+ throw new \InvalidArgumentException('non-nullable message cannot be null');
+ }
+
+ if ((mb_strlen($message) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $message when calling ContentStateStart., must be bigger than or equal to 1.');
+ }
+
+ $this->container['message'] = $message;
+
+ return $this;
+ }
+
+ /**
+ * Gets icon
+ *
+ * @return \ActivitySmith\Generated\Model\LiveActivityAlertIcon|null
+ */
+ public function getIcon()
+ {
+ return $this->container['icon'];
+ }
+
+ /**
+ * Sets icon
+ *
+ * @param \ActivitySmith\Generated\Model\LiveActivityAlertIcon|null $icon Optional SF Symbol icon for type=alert.
+ *
+ * @return self
+ */
+ public function setIcon($icon)
+ {
+ if (is_null($icon)) {
+ throw new \InvalidArgumentException('non-nullable icon cannot be null');
+ }
+ $this->container['icon'] = $icon;
+
+ return $this;
+ }
+
+ /**
+ * Gets badge
+ *
+ * @return \ActivitySmith\Generated\Model\LiveActivityAlertBadge|null
+ */
+ public function getBadge()
+ {
+ return $this->container['badge'];
+ }
+
+ /**
+ * Sets badge
+ *
+ * @param \ActivitySmith\Generated\Model\LiveActivityAlertBadge|null $badge Optional badge for type=alert.
+ *
+ * @return self
+ */
+ public function setBadge($badge)
+ {
+ if (is_null($badge)) {
+ throw new \InvalidArgumentException('non-nullable badge cannot be null');
+ }
+ $this->container['badge'] = $badge;
+
+ return $this;
+ }
+
/**
* Gets type
*
@@ -821,7 +940,7 @@ public function getColor()
/**
* Sets color
*
- * @param string|null $color Optional. Accent color for the Live Activity. Defaults to blue.
+ * @param string|null $color Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
*
* @return self
*/
diff --git a/generated/Model/ContentStateUpdate.php b/generated/Model/ContentStateUpdate.php
index d64088e..bc6195d 100644
--- a/generated/Model/ContentStateUpdate.php
+++ b/generated/Model/ContentStateUpdate.php
@@ -35,7 +35,7 @@
* ContentStateUpdate Class Doc Comment
*
* @category Class
- * @description Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
+ * @description Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message, with optional icon and badge. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
* @package ActivitySmith\Generated
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
@@ -66,6 +66,9 @@ class ContentStateUpdate implements ModelInterface, ArrayAccess, \JsonSerializab
'value' => 'float',
'upperLimit' => 'float',
'metrics' => '\ActivitySmith\Generated\Model\ActivityMetric[]',
+ 'message' => 'string',
+ 'icon' => '\ActivitySmith\Generated\Model\LiveActivityAlertIcon',
+ 'badge' => '\ActivitySmith\Generated\Model\LiveActivityAlertBadge',
'type' => 'string',
'color' => 'string',
'stepColor' => 'string',
@@ -88,6 +91,9 @@ class ContentStateUpdate implements ModelInterface, ArrayAccess, \JsonSerializab
'value' => null,
'upperLimit' => null,
'metrics' => null,
+ 'message' => null,
+ 'icon' => null,
+ 'badge' => null,
'type' => null,
'color' => null,
'stepColor' => null,
@@ -108,6 +114,9 @@ class ContentStateUpdate implements ModelInterface, ArrayAccess, \JsonSerializab
'value' => false,
'upperLimit' => false,
'metrics' => false,
+ 'message' => false,
+ 'icon' => false,
+ 'badge' => false,
'type' => false,
'color' => false,
'stepColor' => false,
@@ -208,6 +217,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'value',
'upperLimit' => 'upper_limit',
'metrics' => 'metrics',
+ 'message' => 'message',
+ 'icon' => 'icon',
+ 'badge' => 'badge',
'type' => 'type',
'color' => 'color',
'stepColor' => 'step_color',
@@ -228,6 +240,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'setValue',
'upperLimit' => 'setUpperLimit',
'metrics' => 'setMetrics',
+ 'message' => 'setMessage',
+ 'icon' => 'setIcon',
+ 'badge' => 'setBadge',
'type' => 'setType',
'color' => 'setColor',
'stepColor' => 'setStepColor',
@@ -248,6 +263,9 @@ public function isNullableSetToNull(string $property): bool
'value' => 'getValue',
'upperLimit' => 'getUpperLimit',
'metrics' => 'getMetrics',
+ 'message' => 'getMessage',
+ 'icon' => 'getIcon',
+ 'badge' => 'getBadge',
'type' => 'getType',
'color' => 'getColor',
'stepColor' => 'getStepColor',
@@ -299,6 +317,7 @@ public function getModelName()
public const TYPE_PROGRESS = 'progress';
public const TYPE_METRICS = 'metrics';
public const TYPE_STATS = 'stats';
+ public const TYPE_ALERT = 'alert';
public const COLOR_LIME = 'lime';
public const COLOR_GREEN = 'green';
public const COLOR_CYAN = 'cyan';
@@ -308,6 +327,7 @@ public function getModelName()
public const COLOR_RED = 'red';
public const COLOR_ORANGE = 'orange';
public const COLOR_YELLOW = 'yellow';
+ public const COLOR_GRAY = 'gray';
public const STEP_COLOR_LIME = 'lime';
public const STEP_COLOR_GREEN = 'green';
public const STEP_COLOR_CYAN = 'cyan';
@@ -317,6 +337,7 @@ public function getModelName()
public const STEP_COLOR_RED = 'red';
public const STEP_COLOR_ORANGE = 'orange';
public const STEP_COLOR_YELLOW = 'yellow';
+ public const STEP_COLOR_GRAY = 'gray';
public const STEP_COLORS_LIME = 'lime';
public const STEP_COLORS_GREEN = 'green';
public const STEP_COLORS_CYAN = 'cyan';
@@ -326,6 +347,7 @@ public function getModelName()
public const STEP_COLORS_RED = 'red';
public const STEP_COLORS_ORANGE = 'orange';
public const STEP_COLORS_YELLOW = 'yellow';
+ public const STEP_COLORS_GRAY = 'gray';
/**
* Gets allowable values of the enum
@@ -339,6 +361,7 @@ public function getTypeAllowableValues()
self::TYPE_PROGRESS,
self::TYPE_METRICS,
self::TYPE_STATS,
+ self::TYPE_ALERT,
];
}
@@ -359,6 +382,7 @@ public function getColorAllowableValues()
self::COLOR_RED,
self::COLOR_ORANGE,
self::COLOR_YELLOW,
+ self::COLOR_GRAY,
];
}
@@ -379,6 +403,7 @@ public function getStepColorAllowableValues()
self::STEP_COLOR_RED,
self::STEP_COLOR_ORANGE,
self::STEP_COLOR_YELLOW,
+ self::STEP_COLOR_GRAY,
];
}
@@ -399,6 +424,7 @@ public function getStepColorsAllowableValues()
self::STEP_COLORS_RED,
self::STEP_COLORS_ORANGE,
self::STEP_COLORS_YELLOW,
+ self::STEP_COLORS_GRAY,
];
}
@@ -425,8 +451,11 @@ public function __construct(array $data = null)
$this->setIfExists('value', $data ?? [], null);
$this->setIfExists('upperLimit', $data ?? [], null);
$this->setIfExists('metrics', $data ?? [], null);
+ $this->setIfExists('message', $data ?? [], null);
+ $this->setIfExists('icon', $data ?? [], null);
+ $this->setIfExists('badge', $data ?? [], null);
$this->setIfExists('type', $data ?? [], null);
- $this->setIfExists('color', $data ?? [], 'blue');
+ $this->setIfExists('color', $data ?? [], null);
$this->setIfExists('stepColor', $data ?? [], null);
$this->setIfExists('stepColors', $data ?? [], null);
}
@@ -485,6 +514,10 @@ public function listInvalidProperties()
$invalidProperties[] = "invalid value for 'metrics', number of items must be greater than or equal to 1.";
}
+ if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) < 1)) {
+ $invalidProperties[] = "invalid value for 'message', the character length must be bigger than or equal to 1.";
+ }
+
$allowedValues = $this->getTypeAllowableValues();
if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
@@ -768,6 +801,92 @@ public function setMetrics($metrics)
return $this;
}
+ /**
+ * Gets message
+ *
+ * @return string|null
+ */
+ public function getMessage()
+ {
+ return $this->container['message'];
+ }
+
+ /**
+ * Sets message
+ *
+ * @param string|null $message Alert message. Use for type=alert.
+ *
+ * @return self
+ */
+ public function setMessage($message)
+ {
+ if (is_null($message)) {
+ throw new \InvalidArgumentException('non-nullable message cannot be null');
+ }
+
+ if ((mb_strlen($message) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $message when calling ContentStateUpdate., must be bigger than or equal to 1.');
+ }
+
+ $this->container['message'] = $message;
+
+ return $this;
+ }
+
+ /**
+ * Gets icon
+ *
+ * @return \ActivitySmith\Generated\Model\LiveActivityAlertIcon|null
+ */
+ public function getIcon()
+ {
+ return $this->container['icon'];
+ }
+
+ /**
+ * Sets icon
+ *
+ * @param \ActivitySmith\Generated\Model\LiveActivityAlertIcon|null $icon Optional SF Symbol icon for type=alert.
+ *
+ * @return self
+ */
+ public function setIcon($icon)
+ {
+ if (is_null($icon)) {
+ throw new \InvalidArgumentException('non-nullable icon cannot be null');
+ }
+ $this->container['icon'] = $icon;
+
+ return $this;
+ }
+
+ /**
+ * Gets badge
+ *
+ * @return \ActivitySmith\Generated\Model\LiveActivityAlertBadge|null
+ */
+ public function getBadge()
+ {
+ return $this->container['badge'];
+ }
+
+ /**
+ * Sets badge
+ *
+ * @param \ActivitySmith\Generated\Model\LiveActivityAlertBadge|null $badge Optional badge for type=alert.
+ *
+ * @return self
+ */
+ public function setBadge($badge)
+ {
+ if (is_null($badge)) {
+ throw new \InvalidArgumentException('non-nullable badge cannot be null');
+ }
+ $this->container['badge'] = $badge;
+
+ return $this;
+ }
+
/**
* Gets type
*
@@ -818,7 +937,7 @@ public function getColor()
/**
* Sets color
*
- * @param string|null $color Optional. Accent color for the Live Activity. Defaults to blue.
+ * @param string|null $color Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
*
* @return self
*/
diff --git a/generated/Model/LiveActivityAlertBadge.php b/generated/Model/LiveActivityAlertBadge.php
new file mode 100644
index 0000000..39947fb
--- /dev/null
+++ b/generated/Model/LiveActivityAlertBadge.php
@@ -0,0 +1,456 @@
+
+ */
+class LiveActivityAlertBadge implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'LiveActivityAlertBadge';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'title' => 'string',
+ 'color' => '\ActivitySmith\Generated\Model\LiveActivityColor'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array