From 991a2b76743beeed454a14c75207a3a43ec3e450 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Mon, 8 Jun 2026 07:44:30 +0000 Subject: [PATCH 1/5] chore: regenerate SDK --- .../api/live_activities_api.rb | 16 +++---- .../models/content_state_end.rb | 46 ++++++++++++++++--- .../models/content_state_start.rb | 46 ++++++++++++++++--- .../models/content_state_update.rb | 46 ++++++++++++++++--- .../models/live_activity_action.rb | 21 +-------- .../models/push_notification_action.rb | 21 +-------- .../models/push_notification_request.rb | 2 +- .../models/stream_content_state.rb | 46 ++++++++++++++++--- 8 files changed, 171 insertions(+), 73 deletions(-) diff --git a/generated/activitysmith_openapi/api/live_activities_api.rb b/generated/activitysmith_openapi/api/live_activities_api.rb index 08b9772..e8f65b9 100644 --- a/generated/activitysmith_openapi/api/live_activities_api.rb +++ b/generated/activitysmith_openapi/api/live_activities_api.rb @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # End a Live Activity (legacy manual lifecycle) - # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, and alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. + # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. # @param live_activity_end_request [LiveActivityEndRequest] # @param [Hash] opts the optional parameters # @return [LiveActivityEndResponse] @@ -30,7 +30,7 @@ def end_live_activity(live_activity_end_request, opts = {}) end # End a Live Activity (legacy manual lifecycle) - # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, and alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. + # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. # @param live_activity_end_request [LiveActivityEndRequest] # @param [Hash] opts the optional parameters # @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers @@ -167,7 +167,7 @@ def end_live_activity_stream_with_http_info(stream_key, opts = {}) end # Start a new Live Activity or update an existing one - # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. + # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. # @param live_activity_stream_request [LiveActivityStreamRequest] # @param [Hash] opts the optional parameters @@ -178,7 +178,7 @@ def reconcile_live_activity_stream(stream_key, live_activity_stream_request, opt end # Start a new Live Activity or update an existing one - # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. + # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens. # @param live_activity_stream_request [LiveActivityStreamRequest] # @param [Hash] opts the optional parameters @@ -250,7 +250,7 @@ def reconcile_live_activity_stream_with_http_info(stream_key, live_activity_stre end # Start a Live Activity (legacy manual lifecycle) - # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, and alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. + # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. # @param live_activity_start_request [LiveActivityStartRequest] # @param [Hash] opts the optional parameters # @return [LiveActivityStartResponse] @@ -260,7 +260,7 @@ def start_live_activity(live_activity_start_request, opts = {}) end # Start a Live Activity (legacy manual lifecycle) - # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, and alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. + # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. # @param live_activity_start_request [LiveActivityStartRequest] # @param [Hash] opts the optional parameters # @return [Array<(LiveActivityStartResponse, Integer, Hash)>] LiveActivityStartResponse data, response status code and response headers @@ -318,7 +318,7 @@ def start_live_activity_with_http_info(live_activity_start_request, opts = {}) end # Update a Live Activity (legacy manual lifecycle) - # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. + # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. # @param live_activity_update_request [LiveActivityUpdateRequest] # @param [Hash] opts the optional parameters # @return [LiveActivityUpdateResponse] @@ -328,7 +328,7 @@ def update_live_activity(live_activity_update_request, opts = {}) end # Update a Live Activity (legacy manual lifecycle) - # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. + # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. # @param live_activity_update_request [LiveActivityUpdateRequest] # @param [Hash] opts the optional parameters # @return [Array<(LiveActivityUpdateResponse, Integer, Hash)>] LiveActivityUpdateResponse data, response status code and response headers diff --git a/generated/activitysmith_openapi/models/content_state_end.rb b/generated/activitysmith_openapi/models/content_state_end.rb index 1c263e2..6290222 100644 --- a/generated/activitysmith_openapi/models/content_state_end.rb +++ b/generated/activitysmith_openapi/models/content_state_end.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - # 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. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. + # 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. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. class ContentStateEnd attr_accessor :title @@ -35,13 +35,22 @@ class ContentStateEnd # Maximum progress value. Use with value for type=progress. attr_accessor :upper_limit + # Timer duration in seconds. For type=timer, omit duration_seconds on end to preserve and freeze the latest timer state. + attr_accessor :duration_seconds + + # Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. + attr_accessor :counts_down + + # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. + attr_accessor :is_running + # Use for type=metrics or type=stats. attr_accessor :metrics # Alert message. Use for type=alert. attr_accessor :message - # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats. + # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. attr_accessor :icon # Optional badge. Supported by alert, progress, and segmented_progress. @@ -50,7 +59,7 @@ class ContentStateEnd # Optional. When omitted, the API uses the existing Live Activity type. attr_accessor :type - # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included. + # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included. attr_accessor :color # Optional. Overrides color for the current step. Only applies to type=segmented_progress. @@ -94,6 +103,9 @@ def self.attribute_map :'percentage' => :'percentage', :'value' => :'value', :'upper_limit' => :'upper_limit', + :'duration_seconds' => :'duration_seconds', + :'counts_down' => :'counts_down', + :'is_running' => :'is_running', :'metrics' => :'metrics', :'message' => :'message', :'icon' => :'icon', @@ -121,6 +133,9 @@ def self.openapi_types :'percentage' => :'Float', :'value' => :'Float', :'upper_limit' => :'Float', + :'duration_seconds' => :'Float', + :'counts_down' => :'Boolean', + :'is_running' => :'Boolean', :'metrics' => :'Array', :'message' => :'String', :'icon' => :'LiveActivityAlertIcon', @@ -184,6 +199,22 @@ def initialize(attributes = {}) self.upper_limit = attributes[:'upper_limit'] end + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'counts_down') + self.counts_down = attributes[:'counts_down'] + else + self.counts_down = true + end + + if attributes.key?(:'is_running') + self.is_running = attributes[:'is_running'] + else + self.is_running = true + end + if attributes.key?(:'metrics') if (value = attributes[:'metrics']).is_a?(Array) self.metrics = value @@ -283,7 +314,7 @@ def valid? return false if !@metrics.nil? && @metrics.length > 8 return false if !@metrics.nil? && @metrics.length < 1 return false if !@message.nil? && @message.to_s.length < 1 - type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"]) return false unless color_validator.valid?(@color) @@ -374,7 +405,7 @@ def message=(message) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -427,6 +458,9 @@ def ==(o) percentage == o.percentage && value == o.value && upper_limit == o.upper_limit && + duration_seconds == o.duration_seconds && + counts_down == o.counts_down && + is_running == o.is_running && metrics == o.metrics && message == o.message && icon == o.icon && @@ -447,7 +481,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, metrics, message, icon, badge, type, color, step_color, step_colors, auto_dismiss_minutes].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors, auto_dismiss_minutes].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/content_state_start.rb b/generated/activitysmith_openapi/models/content_state_start.rb index ed23510..32a67ad 100644 --- a/generated/activitysmith_openapi/models/content_state_start.rb +++ b/generated/activitysmith_openapi/models/content_state_start.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - # 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. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. + # 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. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. class ContentStateStart attr_accessor :title @@ -35,13 +35,22 @@ class ContentStateStart # Maximum progress value. Use with value for type=progress. attr_accessor :upper_limit + # Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted. + attr_accessor :duration_seconds + + # Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. + attr_accessor :counts_down + + # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. + attr_accessor :is_running + # Use for type=metrics or type=stats. attr_accessor :metrics # Required for type=alert. attr_accessor :message - # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats. + # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. attr_accessor :icon # Optional badge. Supported by alert, progress, and segmented_progress. @@ -49,7 +58,7 @@ class ContentStateStart attr_accessor :type - # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included. + # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included. attr_accessor :color # Optional. Overrides color for the current step. Only applies to type=segmented_progress. @@ -90,6 +99,9 @@ def self.attribute_map :'percentage' => :'percentage', :'value' => :'value', :'upper_limit' => :'upper_limit', + :'duration_seconds' => :'duration_seconds', + :'counts_down' => :'counts_down', + :'is_running' => :'is_running', :'metrics' => :'metrics', :'message' => :'message', :'icon' => :'icon', @@ -116,6 +128,9 @@ def self.openapi_types :'percentage' => :'Float', :'value' => :'Float', :'upper_limit' => :'Float', + :'duration_seconds' => :'Float', + :'counts_down' => :'Boolean', + :'is_running' => :'Boolean', :'metrics' => :'Array', :'message' => :'String', :'icon' => :'LiveActivityAlertIcon', @@ -178,6 +193,22 @@ def initialize(attributes = {}) self.upper_limit = attributes[:'upper_limit'] end + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'counts_down') + self.counts_down = attributes[:'counts_down'] + else + self.counts_down = true + end + + if attributes.key?(:'is_running') + self.is_running = attributes[:'is_running'] + else + self.is_running = true + end + if attributes.key?(:'metrics') if (value = attributes[:'metrics']).is_a?(Array) self.metrics = value @@ -274,7 +305,7 @@ def valid? return false if !@metrics.nil? && @metrics.length < 1 return false if !@message.nil? && @message.to_s.length < 1 return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"]) return false unless color_validator.valid?(@color) @@ -364,7 +395,7 @@ def message=(message) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -403,6 +434,9 @@ def ==(o) percentage == o.percentage && value == o.value && upper_limit == o.upper_limit && + duration_seconds == o.duration_seconds && + counts_down == o.counts_down && + is_running == o.is_running && metrics == o.metrics && message == o.message && icon == o.icon && @@ -422,7 +456,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, metrics, message, icon, badge, type, color, step_color, step_colors].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/content_state_update.rb b/generated/activitysmith_openapi/models/content_state_update.rb index 08760d9..095050d 100644 --- a/generated/activitysmith_openapi/models/content_state_update.rb +++ b/generated/activitysmith_openapi/models/content_state_update.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - # 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. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. + # 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. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. class ContentStateUpdate attr_accessor :title @@ -35,13 +35,22 @@ class ContentStateUpdate # Maximum progress value. Use with value for type=progress. attr_accessor :upper_limit + # Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window. + attr_accessor :duration_seconds + + # Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. + attr_accessor :counts_down + + # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. + attr_accessor :is_running + # Use for type=metrics or type=stats. attr_accessor :metrics # Alert message. Use for type=alert. attr_accessor :message - # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats. + # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. attr_accessor :icon # Optional badge. Supported by alert, progress, and segmented_progress. @@ -50,7 +59,7 @@ class ContentStateUpdate # Optional. When omitted, the API uses the existing Live Activity type. attr_accessor :type - # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included. + # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included. attr_accessor :color # Optional. Overrides color for the current step. Only applies to type=segmented_progress. @@ -91,6 +100,9 @@ def self.attribute_map :'percentage' => :'percentage', :'value' => :'value', :'upper_limit' => :'upper_limit', + :'duration_seconds' => :'duration_seconds', + :'counts_down' => :'counts_down', + :'is_running' => :'is_running', :'metrics' => :'metrics', :'message' => :'message', :'icon' => :'icon', @@ -117,6 +129,9 @@ def self.openapi_types :'percentage' => :'Float', :'value' => :'Float', :'upper_limit' => :'Float', + :'duration_seconds' => :'Float', + :'counts_down' => :'Boolean', + :'is_running' => :'Boolean', :'metrics' => :'Array', :'message' => :'String', :'icon' => :'LiveActivityAlertIcon', @@ -179,6 +194,22 @@ def initialize(attributes = {}) self.upper_limit = attributes[:'upper_limit'] end + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'counts_down') + self.counts_down = attributes[:'counts_down'] + else + self.counts_down = true + end + + if attributes.key?(:'is_running') + self.is_running = attributes[:'is_running'] + else + self.is_running = true + end + if attributes.key?(:'metrics') if (value = attributes[:'metrics']).is_a?(Array) self.metrics = value @@ -268,7 +299,7 @@ def valid? return false if !@metrics.nil? && @metrics.length > 8 return false if !@metrics.nil? && @metrics.length < 1 return false if !@message.nil? && @message.to_s.length < 1 - type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"]) return false unless color_validator.valid?(@color) @@ -358,7 +389,7 @@ def message=(message) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -397,6 +428,9 @@ def ==(o) percentage == o.percentage && value == o.value && upper_limit == o.upper_limit && + duration_seconds == o.duration_seconds && + counts_down == o.counts_down && + is_running == o.is_running && metrics == o.metrics && message == o.message && icon == o.icon && @@ -416,7 +450,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, metrics, message, icon, badge, type, color, step_color, step_colors].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/live_activity_action.rb b/generated/activitysmith_openapi/models/live_activity_action.rb index 6964bc4..7fcb036 100644 --- a/generated/activitysmith_openapi/models/live_activity_action.rb +++ b/generated/activitysmith_openapi/models/live_activity_action.rb @@ -21,7 +21,7 @@ class LiveActivityAction attr_accessor :type - # Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL. For webhook, use an HTTPS URL called by the ActivitySmith backend. + # Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. attr_accessor :url # Webhook HTTP method. Used only when type=webhook. @@ -95,7 +95,6 @@ def initialize(attributes = {}) else self.url = nil end - validate_action_url! if attributes.key?(:'method') self.method = attributes[:'method'] @@ -110,16 +109,6 @@ def initialize(attributes = {}) end end - def validate_action_url! - return if @url.nil? || @type.nil? - if @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\// - fail ArgumentError, 'invalid value for "url", open_url must use https or shortcuts.' - end - if @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\// - fail ArgumentError, 'invalid value for "url", webhook must use https.' - end - end - # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties @@ -136,12 +125,6 @@ def list_invalid_properties if @url.nil? invalid_properties.push('invalid value for "url", url cannot be nil.') end - if !@url.nil? && @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\// - invalid_properties.push('invalid value for "url", open_url must use https or shortcuts.') - end - if !@url.nil? && @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\// - invalid_properties.push('invalid value for "url", webhook must use https.') - end invalid_properties end @@ -153,8 +136,6 @@ def valid? return false if @title.nil? return false if @type.nil? return false if @url.nil? - return false if !@url.nil? && @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\// - return false if !@url.nil? && @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\// true end diff --git a/generated/activitysmith_openapi/models/push_notification_action.rb b/generated/activitysmith_openapi/models/push_notification_action.rb index 199d565..84ded6a 100644 --- a/generated/activitysmith_openapi/models/push_notification_action.rb +++ b/generated/activitysmith_openapi/models/push_notification_action.rb @@ -20,7 +20,7 @@ class PushNotificationAction attr_accessor :type - # Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL. For webhook, use an HTTPS URL called by the ActivitySmith backend. + # Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. attr_accessor :url # Webhook HTTP method. Used only when type=webhook. @@ -94,7 +94,6 @@ def initialize(attributes = {}) else self.url = nil end - validate_action_url! if attributes.key?(:'method') self.method = attributes[:'method'] @@ -109,16 +108,6 @@ def initialize(attributes = {}) end end - def validate_action_url! - return if @url.nil? || @type.nil? - if @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\// - fail ArgumentError, 'invalid value for "url", open_url must use https or shortcuts.' - end - if @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\// - fail ArgumentError, 'invalid value for "url", webhook must use https.' - end - end - # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties @@ -135,12 +124,6 @@ def list_invalid_properties if @url.nil? invalid_properties.push('invalid value for "url", url cannot be nil.') end - if !@url.nil? && @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\// - invalid_properties.push('invalid value for "url", open_url must use https or shortcuts.') - end - if !@url.nil? && @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\// - invalid_properties.push('invalid value for "url", webhook must use https.') - end invalid_properties end @@ -152,8 +135,6 @@ def valid? return false if @title.nil? return false if @type.nil? return false if @url.nil? - return false if !@url.nil? && @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\// - return false if !@url.nil? && @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\// true end diff --git a/generated/activitysmith_openapi/models/push_notification_request.rb b/generated/activitysmith_openapi/models/push_notification_request.rb index a32717f..7dd3a89 100644 --- a/generated/activitysmith_openapi/models/push_notification_request.rb +++ b/generated/activitysmith_openapi/models/push_notification_request.rb @@ -24,7 +24,7 @@ class PushNotificationRequest # Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`. attr_accessor :media - # Optional HTTPS URL or shortcuts://run-shortcut?name=... URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided. + # Optional HTTPS URL or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided. attr_accessor :redirection # Optional interactive actions shown when users expand the notification. Cannot be combined with `media`. diff --git a/generated/activitysmith_openapi/models/stream_content_state.rb b/generated/activitysmith_openapi/models/stream_content_state.rb index 8597f4d..88bcfc0 100644 --- a/generated/activitysmith_openapi/models/stream_content_state.rb +++ b/generated/activitysmith_openapi/models/stream_content_state.rb @@ -14,7 +14,7 @@ require 'time' module OpenapiClient - # Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, and alert types. + # Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, and timer types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. class StreamContentState attr_accessor :title @@ -35,10 +35,19 @@ class StreamContentState # Maximum progress value. Use with value for progress. attr_accessor :upper_limit + # Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window. + attr_accessor :duration_seconds + + # Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer. + attr_accessor :counts_down + + # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume. + attr_accessor :is_running + # Required on the first PUT or whenever the stream cannot infer the current activity type. attr_accessor :type - # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included. + # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included. attr_accessor :color # Optional. Overrides color for the current step. Only applies to segmented_progress. @@ -53,7 +62,7 @@ class StreamContentState # Required for type=alert. attr_accessor :message - # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats. + # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. attr_accessor :icon # Optional badge. Supported by alert, progress, and segmented_progress. @@ -97,6 +106,9 @@ def self.attribute_map :'percentage' => :'percentage', :'value' => :'value', :'upper_limit' => :'upper_limit', + :'duration_seconds' => :'duration_seconds', + :'counts_down' => :'counts_down', + :'is_running' => :'is_running', :'type' => :'type', :'color' => :'color', :'step_color' => :'step_color', @@ -125,6 +137,9 @@ def self.openapi_types :'percentage' => :'Float', :'value' => :'Float', :'upper_limit' => :'Float', + :'duration_seconds' => :'Float', + :'counts_down' => :'Boolean', + :'is_running' => :'Boolean', :'type' => :'String', :'color' => :'String', :'step_color' => :'String', @@ -189,6 +204,22 @@ def initialize(attributes = {}) self.upper_limit = attributes[:'upper_limit'] end + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'counts_down') + self.counts_down = attributes[:'counts_down'] + else + self.counts_down = true + end + + if attributes.key?(:'is_running') + self.is_running = attributes[:'is_running'] + else + self.is_running = true + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -291,7 +322,7 @@ def valid? return false if !@current_step.nil? && @current_step < 0 return false if !@percentage.nil? && @percentage > 100 return false if !@percentage.nil? && @percentage < 0 - type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"]) return false unless color_validator.valid?(@color) @@ -354,7 +385,7 @@ def percentage=(percentage) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"]) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -453,6 +484,9 @@ def ==(o) percentage == o.percentage && value == o.value && upper_limit == o.upper_limit && + duration_seconds == o.duration_seconds && + counts_down == o.counts_down && + is_running == o.is_running && type == o.type && color == o.color && step_color == o.step_color && @@ -474,7 +508,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, type, color, step_color, step_colors, metrics, message, icon, badge, auto_dismiss_seconds, auto_dismiss_minutes].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, counts_down, is_running, type, color, step_color, step_colors, metrics, message, icon, badge, auto_dismiss_seconds, auto_dismiss_minutes].hash end # Builds the object from hash From 1497e1ba29ad8dc2f4c2a412ad9c2a773e3d84de Mon Sep 17 00:00:00 2001 From: bardonadam Date: Mon, 8 Jun 2026 16:53:09 +0700 Subject: [PATCH 2/5] test: align generated validation expectations Why: - Generated Ruby models no longer provide conditional URL validation for webhook actions. - Backend validation remains authoritative, and SDK-generated models should not be required to reject webhook shortcuts locally. How: - Remove tests that expected generated webhook action models to reject shortcuts:// URLs. - Keep tests that verify shortcuts:// is preserved for open_url actions and redirection. Verification: - ruby -c test/resources_test.rb - Not run: bundle exec rake test; local Ruby is 2.6, but this gem requires Ruby >= 3.0. Initiated-by: user Implemented-by: codex --- test/resources_test.rb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/test/resources_test.rb b/test/resources_test.rb index 534d454..e2398b8 100644 --- a/test/resources_test.rb +++ b/test/resources_test.rb @@ -196,16 +196,6 @@ def test_generated_push_notification_open_url_allows_shortcuts assert action.valid? end - def test_generated_push_notification_webhook_rejects_shortcuts - assert_raises(ArgumentError) do - OpenapiClient::PushNotificationAction.new( - title: "Chat", - type: OpenapiClient::PushNotificationActionType::WEBHOOK, - url: "shortcuts://run-shortcut?name=JARVIS" - ) - end - end - def test_generated_push_notification_redirection_allows_shortcuts request = OpenapiClient::PushNotificationRequest.new( title: "Task finished", @@ -225,16 +215,6 @@ def test_generated_live_activity_open_url_allows_shortcuts assert action.valid? end - def test_generated_live_activity_webhook_rejects_shortcuts - assert_raises(ArgumentError) do - OpenapiClient::LiveActivityAction.new( - title: "Chat", - type: OpenapiClient::LiveActivityActionType::WEBHOOK, - url: "shortcuts://run-shortcut?name=JARVIS" - ) - end - end - def test_live_activities_short_and_legacy_methods api = FakeLiveApi.new resource = ActivitySmith::LiveActivities.new(api) From 7ab3729281d2968f0554095a791168f6a34a443b Mon Sep 17 00:00:00 2001 From: bardonadam Date: Mon, 8 Jun 2026 19:24:34 +0700 Subject: [PATCH 3/5] feat: add timer live activity DX wrappers --- README.md | 26 ++++++++++++- lib/activitysmith/live_activities.rb | 7 +++- test/resources_test.rb | 58 ++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e3033a5..1f79632 100644 --- a/README.md +++ b/README.md @@ -127,10 +127,11 @@ activitysmith.notifications.send( ## Live Activities -There are five types of Live Activities: +There are six 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 +- `timer`: best for countdowns and elapsed timers, like benchmark runs, cooking timers, workouts, soak windows, and long-running jobs - `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 @@ -246,6 +247,27 @@ activitysmith.live_activities.stream( ) ``` +#### Timer + +Use `duration_seconds` for a countdown. Omit `counts_down` for the default countdown behavior, or set `counts_down: false` for an elapsed timer. + +```ruby +activitysmith.live_activities.stream( + "benchmark-run", + { + content_state: ActivitySmith::LiveActivities.content_state( + title: "Benchmark Run", + subtitle: "sampling performance", + type: ActivitySmith::LiveActivities::TYPE_TIMER, + duration_seconds: 300, + color: "cyan" + ) + } +) +``` + +Later updates can change the title, subtitle, color, icon, or action without resetting the timer. Include `duration_seconds` again only when you want to restart the timer window from that update. + #### Alert

@@ -388,7 +410,7 @@ Add more context to Live Activities with icons and badges. #### Icon -Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, and `alert`. +Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.

Date: Mon, 8 Jun 2026 19:46:44 +0700 Subject: [PATCH 4/5] docs: sync timer live activity readme --- README.md | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 1f79632..d7dfbb9 100644 --- a/README.md +++ b/README.md @@ -131,10 +131,10 @@ There are six 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 -- `timer`: best for countdowns and elapsed timers, like benchmark runs, cooking timers, workouts, soak windows, and long-running jobs - `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 +- `timer`: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs ### Start & Update Live Activity @@ -247,27 +247,6 @@ activitysmith.live_activities.stream( ) ``` -#### Timer - -Use `duration_seconds` for a countdown. Omit `counts_down` for the default countdown behavior, or set `counts_down: false` for an elapsed timer. - -```ruby -activitysmith.live_activities.stream( - "benchmark-run", - { - content_state: ActivitySmith::LiveActivities.content_state( - title: "Benchmark Run", - subtitle: "sampling performance", - type: ActivitySmith::LiveActivities::TYPE_TIMER, - duration_seconds: 300, - color: "cyan" - ) - } -) -``` - -Later updates can change the title, subtitle, color, icon, or action without resetting the timer. Include `duration_seconds` again only when you want to restart the timer window from that update. - #### Alert

@@ -293,6 +272,35 @@ activitysmith.live_activities.stream( ) ``` +#### Timer + +

+ Timer Live Activity showing a benchmark run countdown +

+ +```ruby +activitysmith.live_activities.stream( + "benchmark-run", + { + content_state: { + title: "Benchmark Run", + subtitle: "sampling", + type: "timer", + duration_seconds: 300, + color: "cyan" + } + } +) +``` + +For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `color`, or any other visible field as the work changes. Leave `duration_seconds` out unless you want to change the timer. + +To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`. + ### End Live Activity Call `end_stream(...)` with the same `stream_key` to dismiss the Live Activity. You can include final values before it is removed. By default, iOS removes the Live Activity after two minutes. Set `auto_dismiss_minutes` to choose a different dismissal time, including `0` for immediate dismissal. From e1c415bdf48815434480b720712189b62b66abe6 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Mon, 8 Jun 2026 19:54:22 +0700 Subject: [PATCH 5/5] chore: bump version to 1.7.0 --- generated/activitysmith_openapi/version.rb | 2 +- lib/activitysmith/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generated/activitysmith_openapi/version.rb b/generated/activitysmith_openapi/version.rb index 8d85695..cc7fd58 100644 --- a/generated/activitysmith_openapi/version.rb +++ b/generated/activitysmith_openapi/version.rb @@ -11,5 +11,5 @@ =end module OpenapiClient - VERSION = '1.6.0' + VERSION = '1.7.0' end diff --git a/lib/activitysmith/version.rb b/lib/activitysmith/version.rb index 719c1f9..3d4fd6f 100644 --- a/lib/activitysmith/version.rb +++ b/lib/activitysmith/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActivitySmith - VERSION = "1.6.0" + VERSION = "1.7.0" end