activitysmith 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c57318695ada7f8c3d33082a4a60616ddbc0616919f66cd8d9f8bf752b393f4b
4
- data.tar.gz: b16241c1481014632938a841c71c483dc2fa70a22ede37668e1851ae367732de
3
+ metadata.gz: 17820f972e80244f813c791d40dd85f577e20138ab932a03360586b749fb0435
4
+ data.tar.gz: 7505405af1b3bccd651c14aa1961e514db8faddcec679d902771310b6fd50792
5
5
  SHA512:
6
- metadata.gz: 2cb2947432a4e3b44523632d5b49443e8703c097365be08e087d69f3745457240d940f0eb9a91261b43a7a16d15cf31532bd03203e27bda0c79ea6ce5cec1379
7
- data.tar.gz: 726fe1d3ecf9edaad5d428ea24ba0c41a5174cd2d51232605fe89343c2f750c5732e36c39b40a6e49b79a49da353229d2bfa0f3644fb2840180341dded57ae86
6
+ metadata.gz: 9b4b5da68c74c193b9b7eb87adca266b4573ebf56fb7c5a96133c4c6b45fb3eff85fbf168ae914951321359e4effd0c1ca3188a2c5cae14f0c838478862ab437
7
+ data.tar.gz: 1c21388cb1a583fa807fc8959db0286a0d65f937c031bde333120028e7508f45080e1f9dec46edfbe656cdb9bb9d667f5baa5845104dac6d772290f3eda1663c
data/README.md CHANGED
@@ -90,7 +90,7 @@ What will work:
90
90
  <img src="https://cdn.activitysmith.com/features/actionable-push-notifications-2.png" alt="Actionable push notification example" width="680" />
91
91
  </p>
92
92
 
93
- Actionable push notifications can open a URL on tap or trigger actions when someone long-presses the notification.
93
+ Push notification `redirection` and `actions` are optional. Use them to open HTTPS URLs, run a specific iPhone Shortcut with `shortcuts://run-shortcut?name=...`, or trigger backend webhook workflows.
94
94
  Webhooks are executed by the ActivitySmith backend.
95
95
 
96
96
  ```ruby
@@ -105,6 +105,11 @@ activitysmith.notifications.send(
105
105
  type: "open_url",
106
106
  url: "https://crm.example.com/customers/cus_9f3a1d"
107
107
  },
108
+ {
109
+ title: "Chat with Jarvis",
110
+ type: "open_url",
111
+ url: "shortcuts://run-shortcut?name=Jarvis"
112
+ },
108
113
  {
109
114
  title: "Start Onboarding Workflow",
110
115
  type: "webhook",
@@ -122,13 +127,14 @@ activitysmith.notifications.send(
122
127
 
123
128
  ## Live Activities
124
129
 
125
- There are five types of Live Activities:
130
+ There are six types of Live Activities:
126
131
 
127
132
  - `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
128
133
  - `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
129
134
  - `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
130
135
  - `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
131
136
  - `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states
137
+ - `timer`: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs
132
138
 
133
139
  ### Start & Update Live Activity
134
140
 
@@ -266,6 +272,35 @@ activitysmith.live_activities.stream(
266
272
  )
267
273
  ```
268
274
 
275
+ #### Timer
276
+
277
+ <p align="center">
278
+ <img
279
+ src="https://cdn.activitysmith.com/features/timer-live-activity.png"
280
+ alt="Timer Live Activity showing a benchmark run countdown"
281
+ width="680"
282
+ />
283
+ </p>
284
+
285
+ ```ruby
286
+ activitysmith.live_activities.stream(
287
+ "benchmark-run",
288
+ {
289
+ content_state: {
290
+ title: "Benchmark Run",
291
+ subtitle: "sampling",
292
+ type: "timer",
293
+ duration_seconds: 300,
294
+ color: "cyan"
295
+ }
296
+ }
297
+ )
298
+ ```
299
+
300
+ 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.
301
+
302
+ To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`.
303
+
269
304
  ### End Live Activity
270
305
 
271
306
  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.
@@ -290,8 +325,11 @@ activitysmith.live_activities.end_stream(
290
325
 
291
326
  ### Live Activity Action
292
327
 
293
- Live Activities can include one optional action button. Use it to open a URL from the Live Activity or trigger a backend webhook.
294
- For Alert Live Activities, set `color` in `content_state` to tint the action button. Icon and badge colors only affect the icon and badge.
328
+ Live Activities can include one optional action button.
329
+
330
+ - `open_url`: open an HTTPS URL.
331
+ - `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app.
332
+ - `webhook`: trigger a backend GET/POST workflow.
295
333
 
296
334
  <p align="center">
297
335
  <img
@@ -317,7 +355,7 @@ activitysmith.live_activities.stream(
317
355
  ]
318
356
  },
319
357
  action: {
320
- title: "Open Dashboard",
358
+ title: "Dashboard",
321
359
  type: "open_url",
322
360
  url: "https://ops.example.com/servers/prod-web-1"
323
361
  }
@@ -325,6 +363,28 @@ activitysmith.live_activities.stream(
325
363
  )
326
364
  ```
327
365
 
366
+ #### Apple Shortcut action
367
+
368
+ ```ruby
369
+ activitysmith.live_activities.stream(
370
+ "deploy-payments-api",
371
+ {
372
+ content_state: {
373
+ title: "Deploying payments-api",
374
+ subtitle: "Running database migrations",
375
+ type: "segmented_progress",
376
+ number_of_steps: 5,
377
+ current_step: 3
378
+ },
379
+ action: {
380
+ title: "Chat with Jarvis",
381
+ type: "open_url",
382
+ url: "shortcuts://run-shortcut?name=Jarvis"
383
+ }
384
+ }
385
+ )
386
+ ```
387
+
328
388
  #### Webhook action
329
389
 
330
390
  ```ruby
@@ -358,7 +418,7 @@ Add more context to Live Activities with icons and badges.
358
418
 
359
419
  #### Icon
360
420
 
361
- Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, and `alert`.
421
+ Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
362
422
 
363
423
  <p align="center">
364
424
  <img
@@ -20,7 +20,7 @@ module OpenapiClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # End a Live Activity (legacy manual lifecycle)
23
- # 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.
23
+ # 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.
24
24
  # @param live_activity_end_request [LiveActivityEndRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [LiveActivityEndResponse]
@@ -30,7 +30,7 @@ module OpenapiClient
30
30
  end
31
31
 
32
32
  # End a Live Activity (legacy manual lifecycle)
33
- # 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.
33
+ # 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.
34
34
  # @param live_activity_end_request [LiveActivityEndRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers
@@ -167,7 +167,7 @@ module OpenapiClient
167
167
  end
168
168
 
169
169
  # Start a new Live Activity or update an existing one
170
- # 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.
170
+ # 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.
171
171
  # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
172
172
  # @param live_activity_stream_request [LiveActivityStreamRequest]
173
173
  # @param [Hash] opts the optional parameters
@@ -178,7 +178,7 @@ module OpenapiClient
178
178
  end
179
179
 
180
180
  # Start a new Live Activity or update an existing one
181
- # 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.
181
+ # 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.
182
182
  # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
183
183
  # @param live_activity_stream_request [LiveActivityStreamRequest]
184
184
  # @param [Hash] opts the optional parameters
@@ -250,7 +250,7 @@ module OpenapiClient
250
250
  end
251
251
 
252
252
  # Start a Live Activity (legacy manual lifecycle)
253
- # 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.
253
+ # 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.
254
254
  # @param live_activity_start_request [LiveActivityStartRequest]
255
255
  # @param [Hash] opts the optional parameters
256
256
  # @return [LiveActivityStartResponse]
@@ -260,7 +260,7 @@ module OpenapiClient
260
260
  end
261
261
 
262
262
  # Start a Live Activity (legacy manual lifecycle)
263
- # 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.
263
+ # 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.
264
264
  # @param live_activity_start_request [LiveActivityStartRequest]
265
265
  # @param [Hash] opts the optional parameters
266
266
  # @return [Array<(LiveActivityStartResponse, Integer, Hash)>] LiveActivityStartResponse data, response status code and response headers
@@ -318,7 +318,7 @@ module OpenapiClient
318
318
  end
319
319
 
320
320
  # Update a Live Activity (legacy manual lifecycle)
321
- # 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.
321
+ # 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.
322
322
  # @param live_activity_update_request [LiveActivityUpdateRequest]
323
323
  # @param [Hash] opts the optional parameters
324
324
  # @return [LiveActivityUpdateResponse]
@@ -328,7 +328,7 @@ module OpenapiClient
328
328
  end
329
329
 
330
330
  # Update a Live Activity (legacy manual lifecycle)
331
- # 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.
331
+ # 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.
332
332
  # @param live_activity_update_request [LiveActivityUpdateRequest]
333
333
  # @param [Hash] opts the optional parameters
334
334
  # @return [Array<(LiveActivityUpdateResponse, Integer, Hash)>] LiveActivityUpdateResponse data, response status code and response headers
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # 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.
17
+ # 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.
18
18
  class ContentStateEnd
19
19
  attr_accessor :title
20
20
 
@@ -35,13 +35,22 @@ module OpenapiClient
35
35
  # Maximum progress value. Use with value for type=progress.
36
36
  attr_accessor :upper_limit
37
37
 
38
+ # Timer duration in seconds. For type=timer, omit duration_seconds on end to preserve and freeze the latest timer state.
39
+ attr_accessor :duration_seconds
40
+
41
+ # 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.
42
+ attr_accessor :counts_down
43
+
44
+ # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
45
+ attr_accessor :is_running
46
+
38
47
  # Use for type=metrics or type=stats.
39
48
  attr_accessor :metrics
40
49
 
41
50
  # Alert message. Use for type=alert.
42
51
  attr_accessor :message
43
52
 
44
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
53
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
45
54
  attr_accessor :icon
46
55
 
47
56
  # Optional badge. Supported by alert, progress, and segmented_progress.
@@ -50,7 +59,7 @@ module OpenapiClient
50
59
  # Optional. When omitted, the API uses the existing Live Activity type.
51
60
  attr_accessor :type
52
61
 
53
- # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
62
+ # 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.
54
63
  attr_accessor :color
55
64
 
56
65
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -94,6 +103,9 @@ module OpenapiClient
94
103
  :'percentage' => :'percentage',
95
104
  :'value' => :'value',
96
105
  :'upper_limit' => :'upper_limit',
106
+ :'duration_seconds' => :'duration_seconds',
107
+ :'counts_down' => :'counts_down',
108
+ :'is_running' => :'is_running',
97
109
  :'metrics' => :'metrics',
98
110
  :'message' => :'message',
99
111
  :'icon' => :'icon',
@@ -121,6 +133,9 @@ module OpenapiClient
121
133
  :'percentage' => :'Float',
122
134
  :'value' => :'Float',
123
135
  :'upper_limit' => :'Float',
136
+ :'duration_seconds' => :'Float',
137
+ :'counts_down' => :'Boolean',
138
+ :'is_running' => :'Boolean',
124
139
  :'metrics' => :'Array<ActivityMetric>',
125
140
  :'message' => :'String',
126
141
  :'icon' => :'LiveActivityAlertIcon',
@@ -184,6 +199,22 @@ module OpenapiClient
184
199
  self.upper_limit = attributes[:'upper_limit']
185
200
  end
186
201
 
202
+ if attributes.key?(:'duration_seconds')
203
+ self.duration_seconds = attributes[:'duration_seconds']
204
+ end
205
+
206
+ if attributes.key?(:'counts_down')
207
+ self.counts_down = attributes[:'counts_down']
208
+ else
209
+ self.counts_down = true
210
+ end
211
+
212
+ if attributes.key?(:'is_running')
213
+ self.is_running = attributes[:'is_running']
214
+ else
215
+ self.is_running = true
216
+ end
217
+
187
218
  if attributes.key?(:'metrics')
188
219
  if (value = attributes[:'metrics']).is_a?(Array)
189
220
  self.metrics = value
@@ -283,7 +314,7 @@ module OpenapiClient
283
314
  return false if !@metrics.nil? && @metrics.length > 8
284
315
  return false if !@metrics.nil? && @metrics.length < 1
285
316
  return false if !@message.nil? && @message.to_s.length < 1
286
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
317
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
287
318
  return false unless type_validator.valid?(@type)
288
319
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
289
320
  return false unless color_validator.valid?(@color)
@@ -374,7 +405,7 @@ module OpenapiClient
374
405
  # Custom attribute writer method checking allowed values (enum).
375
406
  # @param [Object] type Object to be assigned
376
407
  def type=(type)
377
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
408
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
378
409
  unless validator.valid?(type)
379
410
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
380
411
  end
@@ -427,6 +458,9 @@ module OpenapiClient
427
458
  percentage == o.percentage &&
428
459
  value == o.value &&
429
460
  upper_limit == o.upper_limit &&
461
+ duration_seconds == o.duration_seconds &&
462
+ counts_down == o.counts_down &&
463
+ is_running == o.is_running &&
430
464
  metrics == o.metrics &&
431
465
  message == o.message &&
432
466
  icon == o.icon &&
@@ -447,7 +481,7 @@ module OpenapiClient
447
481
  # Calculates hash code according to all attributes.
448
482
  # @return [Integer] Hash code
449
483
  def hash
450
- [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
484
+ [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
451
485
  end
452
486
 
453
487
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # 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.
17
+ # 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.
18
18
  class ContentStateStart
19
19
  attr_accessor :title
20
20
 
@@ -35,13 +35,22 @@ module OpenapiClient
35
35
  # Maximum progress value. Use with value for type=progress.
36
36
  attr_accessor :upper_limit
37
37
 
38
+ # Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.
39
+ attr_accessor :duration_seconds
40
+
41
+ # 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.
42
+ attr_accessor :counts_down
43
+
44
+ # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
45
+ attr_accessor :is_running
46
+
38
47
  # Use for type=metrics or type=stats.
39
48
  attr_accessor :metrics
40
49
 
41
50
  # Required for type=alert.
42
51
  attr_accessor :message
43
52
 
44
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
53
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
45
54
  attr_accessor :icon
46
55
 
47
56
  # Optional badge. Supported by alert, progress, and segmented_progress.
@@ -49,7 +58,7 @@ module OpenapiClient
49
58
 
50
59
  attr_accessor :type
51
60
 
52
- # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
61
+ # 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.
53
62
  attr_accessor :color
54
63
 
55
64
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -90,6 +99,9 @@ module OpenapiClient
90
99
  :'percentage' => :'percentage',
91
100
  :'value' => :'value',
92
101
  :'upper_limit' => :'upper_limit',
102
+ :'duration_seconds' => :'duration_seconds',
103
+ :'counts_down' => :'counts_down',
104
+ :'is_running' => :'is_running',
93
105
  :'metrics' => :'metrics',
94
106
  :'message' => :'message',
95
107
  :'icon' => :'icon',
@@ -116,6 +128,9 @@ module OpenapiClient
116
128
  :'percentage' => :'Float',
117
129
  :'value' => :'Float',
118
130
  :'upper_limit' => :'Float',
131
+ :'duration_seconds' => :'Float',
132
+ :'counts_down' => :'Boolean',
133
+ :'is_running' => :'Boolean',
119
134
  :'metrics' => :'Array<ActivityMetric>',
120
135
  :'message' => :'String',
121
136
  :'icon' => :'LiveActivityAlertIcon',
@@ -178,6 +193,22 @@ module OpenapiClient
178
193
  self.upper_limit = attributes[:'upper_limit']
179
194
  end
180
195
 
196
+ if attributes.key?(:'duration_seconds')
197
+ self.duration_seconds = attributes[:'duration_seconds']
198
+ end
199
+
200
+ if attributes.key?(:'counts_down')
201
+ self.counts_down = attributes[:'counts_down']
202
+ else
203
+ self.counts_down = true
204
+ end
205
+
206
+ if attributes.key?(:'is_running')
207
+ self.is_running = attributes[:'is_running']
208
+ else
209
+ self.is_running = true
210
+ end
211
+
181
212
  if attributes.key?(:'metrics')
182
213
  if (value = attributes[:'metrics']).is_a?(Array)
183
214
  self.metrics = value
@@ -274,7 +305,7 @@ module OpenapiClient
274
305
  return false if !@metrics.nil? && @metrics.length < 1
275
306
  return false if !@message.nil? && @message.to_s.length < 1
276
307
  return false if @type.nil?
277
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
308
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
278
309
  return false unless type_validator.valid?(@type)
279
310
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
280
311
  return false unless color_validator.valid?(@color)
@@ -364,7 +395,7 @@ module OpenapiClient
364
395
  # Custom attribute writer method checking allowed values (enum).
365
396
  # @param [Object] type Object to be assigned
366
397
  def type=(type)
367
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
398
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
368
399
  unless validator.valid?(type)
369
400
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
370
401
  end
@@ -403,6 +434,9 @@ module OpenapiClient
403
434
  percentage == o.percentage &&
404
435
  value == o.value &&
405
436
  upper_limit == o.upper_limit &&
437
+ duration_seconds == o.duration_seconds &&
438
+ counts_down == o.counts_down &&
439
+ is_running == o.is_running &&
406
440
  metrics == o.metrics &&
407
441
  message == o.message &&
408
442
  icon == o.icon &&
@@ -422,7 +456,7 @@ module OpenapiClient
422
456
  # Calculates hash code according to all attributes.
423
457
  # @return [Integer] Hash code
424
458
  def hash
425
- [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, metrics, message, icon, badge, type, color, step_color, step_colors].hash
459
+ [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
426
460
  end
427
461
 
428
462
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # 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.
17
+ # 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.
18
18
  class ContentStateUpdate
19
19
  attr_accessor :title
20
20
 
@@ -35,13 +35,22 @@ module OpenapiClient
35
35
  # Maximum progress value. Use with value for type=progress.
36
36
  attr_accessor :upper_limit
37
37
 
38
+ # 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.
39
+ attr_accessor :duration_seconds
40
+
41
+ # 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.
42
+ attr_accessor :counts_down
43
+
44
+ # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
45
+ attr_accessor :is_running
46
+
38
47
  # Use for type=metrics or type=stats.
39
48
  attr_accessor :metrics
40
49
 
41
50
  # Alert message. Use for type=alert.
42
51
  attr_accessor :message
43
52
 
44
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
53
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
45
54
  attr_accessor :icon
46
55
 
47
56
  # Optional badge. Supported by alert, progress, and segmented_progress.
@@ -50,7 +59,7 @@ module OpenapiClient
50
59
  # Optional. When omitted, the API uses the existing Live Activity type.
51
60
  attr_accessor :type
52
61
 
53
- # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
62
+ # 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.
54
63
  attr_accessor :color
55
64
 
56
65
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -91,6 +100,9 @@ module OpenapiClient
91
100
  :'percentage' => :'percentage',
92
101
  :'value' => :'value',
93
102
  :'upper_limit' => :'upper_limit',
103
+ :'duration_seconds' => :'duration_seconds',
104
+ :'counts_down' => :'counts_down',
105
+ :'is_running' => :'is_running',
94
106
  :'metrics' => :'metrics',
95
107
  :'message' => :'message',
96
108
  :'icon' => :'icon',
@@ -117,6 +129,9 @@ module OpenapiClient
117
129
  :'percentage' => :'Float',
118
130
  :'value' => :'Float',
119
131
  :'upper_limit' => :'Float',
132
+ :'duration_seconds' => :'Float',
133
+ :'counts_down' => :'Boolean',
134
+ :'is_running' => :'Boolean',
120
135
  :'metrics' => :'Array<ActivityMetric>',
121
136
  :'message' => :'String',
122
137
  :'icon' => :'LiveActivityAlertIcon',
@@ -179,6 +194,22 @@ module OpenapiClient
179
194
  self.upper_limit = attributes[:'upper_limit']
180
195
  end
181
196
 
197
+ if attributes.key?(:'duration_seconds')
198
+ self.duration_seconds = attributes[:'duration_seconds']
199
+ end
200
+
201
+ if attributes.key?(:'counts_down')
202
+ self.counts_down = attributes[:'counts_down']
203
+ else
204
+ self.counts_down = true
205
+ end
206
+
207
+ if attributes.key?(:'is_running')
208
+ self.is_running = attributes[:'is_running']
209
+ else
210
+ self.is_running = true
211
+ end
212
+
182
213
  if attributes.key?(:'metrics')
183
214
  if (value = attributes[:'metrics']).is_a?(Array)
184
215
  self.metrics = value
@@ -268,7 +299,7 @@ module OpenapiClient
268
299
  return false if !@metrics.nil? && @metrics.length > 8
269
300
  return false if !@metrics.nil? && @metrics.length < 1
270
301
  return false if !@message.nil? && @message.to_s.length < 1
271
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
302
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
272
303
  return false unless type_validator.valid?(@type)
273
304
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
274
305
  return false unless color_validator.valid?(@color)
@@ -358,7 +389,7 @@ module OpenapiClient
358
389
  # Custom attribute writer method checking allowed values (enum).
359
390
  # @param [Object] type Object to be assigned
360
391
  def type=(type)
361
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
392
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
362
393
  unless validator.valid?(type)
363
394
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
364
395
  end
@@ -397,6 +428,9 @@ module OpenapiClient
397
428
  percentage == o.percentage &&
398
429
  value == o.value &&
399
430
  upper_limit == o.upper_limit &&
431
+ duration_seconds == o.duration_seconds &&
432
+ counts_down == o.counts_down &&
433
+ is_running == o.is_running &&
400
434
  metrics == o.metrics &&
401
435
  message == o.message &&
402
436
  icon == o.icon &&
@@ -416,7 +450,7 @@ module OpenapiClient
416
450
  # Calculates hash code according to all attributes.
417
451
  # @return [Integer] Hash code
418
452
  def hash
419
- [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, metrics, message, icon, badge, type, color, step_color, step_colors].hash
453
+ [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
420
454
  end
421
455
 
422
456
  # Builds the object from hash
@@ -21,7 +21,7 @@ module OpenapiClient
21
21
 
22
22
  attr_accessor :type
23
23
 
24
- # Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.
24
+ # 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.
25
25
  attr_accessor :url
26
26
 
27
27
  # Webhook HTTP method. Used only when type=webhook.
@@ -95,7 +95,6 @@ module OpenapiClient
95
95
  else
96
96
  self.url = nil
97
97
  end
98
- validate_action_url!
99
98
 
100
99
  if attributes.key?(:'method')
101
100
  self.method = attributes[:'method']
@@ -110,16 +109,6 @@ module OpenapiClient
110
109
  end
111
110
  end
112
111
 
113
- def validate_action_url!
114
- return if @url.nil? || @type.nil?
115
- if @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
116
- fail ArgumentError, 'invalid value for "url", open_url must use https or shortcuts.'
117
- end
118
- if @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
119
- fail ArgumentError, 'invalid value for "url", webhook must use https.'
120
- end
121
- end
122
-
123
112
  # Show invalid properties with the reasons. Usually used together with valid?
124
113
  # @return Array for valid properties with the reasons
125
114
  def list_invalid_properties
@@ -136,12 +125,6 @@ module OpenapiClient
136
125
  if @url.nil?
137
126
  invalid_properties.push('invalid value for "url", url cannot be nil.')
138
127
  end
139
- if !@url.nil? && @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
140
- invalid_properties.push('invalid value for "url", open_url must use https or shortcuts.')
141
- end
142
- if !@url.nil? && @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
143
- invalid_properties.push('invalid value for "url", webhook must use https.')
144
- end
145
128
 
146
129
  invalid_properties
147
130
  end
@@ -153,8 +136,6 @@ module OpenapiClient
153
136
  return false if @title.nil?
154
137
  return false if @type.nil?
155
138
  return false if @url.nil?
156
- return false if !@url.nil? && @type == LiveActivityActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
157
- return false if !@url.nil? && @type == LiveActivityActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
158
139
  true
159
140
  end
160
141
 
@@ -20,7 +20,7 @@ module OpenapiClient
20
20
 
21
21
  attr_accessor :type
22
22
 
23
- # Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.
23
+ # 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.
24
24
  attr_accessor :url
25
25
 
26
26
  # Webhook HTTP method. Used only when type=webhook.
@@ -94,7 +94,6 @@ module OpenapiClient
94
94
  else
95
95
  self.url = nil
96
96
  end
97
- validate_action_url!
98
97
 
99
98
  if attributes.key?(:'method')
100
99
  self.method = attributes[:'method']
@@ -109,16 +108,6 @@ module OpenapiClient
109
108
  end
110
109
  end
111
110
 
112
- def validate_action_url!
113
- return if @url.nil? || @type.nil?
114
- if @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
115
- fail ArgumentError, 'invalid value for "url", open_url must use https or shortcuts.'
116
- end
117
- if @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
118
- fail ArgumentError, 'invalid value for "url", webhook must use https.'
119
- end
120
- end
121
-
122
111
  # Show invalid properties with the reasons. Usually used together with valid?
123
112
  # @return Array for valid properties with the reasons
124
113
  def list_invalid_properties
@@ -135,12 +124,6 @@ module OpenapiClient
135
124
  if @url.nil?
136
125
  invalid_properties.push('invalid value for "url", url cannot be nil.')
137
126
  end
138
- if !@url.nil? && @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
139
- invalid_properties.push('invalid value for "url", open_url must use https or shortcuts.')
140
- end
141
- if !@url.nil? && @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
142
- invalid_properties.push('invalid value for "url", webhook must use https.')
143
- end
144
127
 
145
128
  invalid_properties
146
129
  end
@@ -152,8 +135,6 @@ module OpenapiClient
152
135
  return false if @title.nil?
153
136
  return false if @type.nil?
154
137
  return false if @url.nil?
155
- return false if !@url.nil? && @type == PushNotificationActionType::OPEN_URL && @url !~ /\A(https|shortcuts):\/\//
156
- return false if !@url.nil? && @type == PushNotificationActionType::WEBHOOK && @url !~ /\Ahttps:\/\//
157
138
  true
158
139
  end
159
140
 
@@ -24,7 +24,7 @@ module OpenapiClient
24
24
  # 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`.
25
25
  attr_accessor :media
26
26
 
27
- # Optional HTTPS or shortcuts:// URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided.
27
+ # 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.
28
28
  attr_accessor :redirection
29
29
 
30
30
  # Optional interactive actions shown when users expand the notification. Cannot be combined with `media`.
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # 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.
17
+ # 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.
18
18
  class StreamContentState
19
19
  attr_accessor :title
20
20
 
@@ -35,10 +35,19 @@ module OpenapiClient
35
35
  # Maximum progress value. Use with value for progress.
36
36
  attr_accessor :upper_limit
37
37
 
38
+ # 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.
39
+ attr_accessor :duration_seconds
40
+
41
+ # 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.
42
+ attr_accessor :counts_down
43
+
44
+ # Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
45
+ attr_accessor :is_running
46
+
38
47
  # Required on the first PUT or whenever the stream cannot infer the current activity type.
39
48
  attr_accessor :type
40
49
 
41
- # Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
50
+ # 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.
42
51
  attr_accessor :color
43
52
 
44
53
  # Optional. Overrides color for the current step. Only applies to segmented_progress.
@@ -53,7 +62,7 @@ module OpenapiClient
53
62
  # Required for type=alert.
54
63
  attr_accessor :message
55
64
 
56
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
65
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
57
66
  attr_accessor :icon
58
67
 
59
68
  # Optional badge. Supported by alert, progress, and segmented_progress.
@@ -97,6 +106,9 @@ module OpenapiClient
97
106
  :'percentage' => :'percentage',
98
107
  :'value' => :'value',
99
108
  :'upper_limit' => :'upper_limit',
109
+ :'duration_seconds' => :'duration_seconds',
110
+ :'counts_down' => :'counts_down',
111
+ :'is_running' => :'is_running',
100
112
  :'type' => :'type',
101
113
  :'color' => :'color',
102
114
  :'step_color' => :'step_color',
@@ -125,6 +137,9 @@ module OpenapiClient
125
137
  :'percentage' => :'Float',
126
138
  :'value' => :'Float',
127
139
  :'upper_limit' => :'Float',
140
+ :'duration_seconds' => :'Float',
141
+ :'counts_down' => :'Boolean',
142
+ :'is_running' => :'Boolean',
128
143
  :'type' => :'String',
129
144
  :'color' => :'String',
130
145
  :'step_color' => :'String',
@@ -189,6 +204,22 @@ module OpenapiClient
189
204
  self.upper_limit = attributes[:'upper_limit']
190
205
  end
191
206
 
207
+ if attributes.key?(:'duration_seconds')
208
+ self.duration_seconds = attributes[:'duration_seconds']
209
+ end
210
+
211
+ if attributes.key?(:'counts_down')
212
+ self.counts_down = attributes[:'counts_down']
213
+ else
214
+ self.counts_down = true
215
+ end
216
+
217
+ if attributes.key?(:'is_running')
218
+ self.is_running = attributes[:'is_running']
219
+ else
220
+ self.is_running = true
221
+ end
222
+
192
223
  if attributes.key?(:'type')
193
224
  self.type = attributes[:'type']
194
225
  end
@@ -291,7 +322,7 @@ module OpenapiClient
291
322
  return false if !@current_step.nil? && @current_step < 0
292
323
  return false if !@percentage.nil? && @percentage > 100
293
324
  return false if !@percentage.nil? && @percentage < 0
294
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
325
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
295
326
  return false unless type_validator.valid?(@type)
296
327
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
297
328
  return false unless color_validator.valid?(@color)
@@ -354,7 +385,7 @@ module OpenapiClient
354
385
  # Custom attribute writer method checking allowed values (enum).
355
386
  # @param [Object] type Object to be assigned
356
387
  def type=(type)
357
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert"])
388
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
358
389
  unless validator.valid?(type)
359
390
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
360
391
  end
@@ -453,6 +484,9 @@ module OpenapiClient
453
484
  percentage == o.percentage &&
454
485
  value == o.value &&
455
486
  upper_limit == o.upper_limit &&
487
+ duration_seconds == o.duration_seconds &&
488
+ counts_down == o.counts_down &&
489
+ is_running == o.is_running &&
456
490
  type == o.type &&
457
491
  color == o.color &&
458
492
  step_color == o.step_color &&
@@ -474,7 +508,7 @@ module OpenapiClient
474
508
  # Calculates hash code according to all attributes.
475
509
  # @return [Integer] Hash code
476
510
  def hash
477
- [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
511
+ [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
478
512
  end
479
513
 
480
514
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.7.0
11
11
  =end
12
12
 
13
13
  module OpenapiClient
14
- VERSION = '1.6.0'
14
+ VERSION = '1.7.0'
15
15
  end
@@ -7,9 +7,10 @@ module ActivitySmith
7
7
  TYPE_METRICS = "metrics"
8
8
  TYPE_STATS = "stats"
9
9
  TYPE_ALERT = "alert"
10
+ TYPE_TIMER = "timer"
10
11
 
11
12
  class << self
12
- def content_state(title:, type: nil, subtitle: nil, message: nil, icon: nil, badge: nil, color: nil, **fields)
13
+ def content_state(title:, type: nil, subtitle: nil, message: nil, icon: nil, badge: nil, color: nil, duration_seconds: nil, counts_down: nil, **fields)
13
14
  {
14
15
  title: title,
15
16
  type: type,
@@ -17,7 +18,9 @@ module ActivitySmith
17
18
  message: message,
18
19
  icon: icon,
19
20
  badge: badge,
20
- color: color
21
+ color: color,
22
+ duration_seconds: duration_seconds,
23
+ counts_down: counts_down
21
24
  }.merge(fields).compact
22
25
  end
23
26
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivitySmith
4
- VERSION = "1.6.0"
4
+ VERSION = "1.7.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activitysmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ActivitySmith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-01 00:00:00.000000000 Z
11
+ date: 2026-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json