activitysmith 1.4.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 +4 -4
- data/README.md +137 -10
- data/generated/activitysmith_openapi/api/live_activities_api.rb +8 -8
- data/generated/activitysmith_openapi/models/content_state_end.rb +47 -13
- data/generated/activitysmith_openapi/models/content_state_start.rb +47 -13
- data/generated/activitysmith_openapi/models/content_state_update.rb +47 -13
- data/generated/activitysmith_openapi/models/live_activity_action.rb +1 -44
- data/generated/activitysmith_openapi/models/live_activity_alert_badge.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_alert_icon.rb +1 -1
- data/generated/activitysmith_openapi/models/push_notification_action.rb +1 -44
- data/generated/activitysmith_openapi/models/push_notification_request.rb +4 -4
- data/generated/activitysmith_openapi/models/stream_content_state.rb +47 -13
- data/generated/activitysmith_openapi/version.rb +1 -1
- data/lib/activitysmith/live_activities.rb +5 -2
- data/lib/activitysmith/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17820f972e80244f813c791d40dd85f577e20138ab932a03360586b749fb0435
|
|
4
|
+
data.tar.gz: 7505405af1b3bccd651c14aa1961e514db8faddcec679d902771310b6fd50792
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b4b5da68c74c193b9b7eb87adca266b4573ebf56fb7c5a96133c4c6b45fb3eff85fbf168ae914951321359e4effd0c1ca3188a2c5cae14f0c838478862ab437
|
|
7
|
+
data.tar.gz: 1c21388cb1a583fa807fc8959db0286a0d65f937c031bde333120028e7508f45080e1f9dec46edfbe656cdb9bb9d667f5baa5845104dac6d772290f3eda1663c
|
data/README.md
CHANGED
|
@@ -18,6 +18,8 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction).
|
|
|
18
18
|
- [Start & Update Live Activity](#start--update-live-activity)
|
|
19
19
|
- [End Live Activity](#end-live-activity)
|
|
20
20
|
- [Live Activity Action](#live-activity-action)
|
|
21
|
+
- [Icons and Badges](#icons-and-badges)
|
|
22
|
+
- [Live Activity Colors](#live-activity-colors)
|
|
21
23
|
- [Channels](#channels)
|
|
22
24
|
- [Widgets](#widgets)
|
|
23
25
|
|
|
@@ -88,7 +90,7 @@ What will work:
|
|
|
88
90
|
<img src="https://cdn.activitysmith.com/features/actionable-push-notifications-2.png" alt="Actionable push notification example" width="680" />
|
|
89
91
|
</p>
|
|
90
92
|
|
|
91
|
-
|
|
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.
|
|
92
94
|
Webhooks are executed by the ActivitySmith backend.
|
|
93
95
|
|
|
94
96
|
```ruby
|
|
@@ -103,6 +105,11 @@ activitysmith.notifications.send(
|
|
|
103
105
|
type: "open_url",
|
|
104
106
|
url: "https://crm.example.com/customers/cus_9f3a1d"
|
|
105
107
|
},
|
|
108
|
+
{
|
|
109
|
+
title: "Chat with Jarvis",
|
|
110
|
+
type: "open_url",
|
|
111
|
+
url: "shortcuts://run-shortcut?name=Jarvis"
|
|
112
|
+
},
|
|
106
113
|
{
|
|
107
114
|
title: "Start Onboarding Workflow",
|
|
108
115
|
type: "webhook",
|
|
@@ -120,13 +127,14 @@ activitysmith.notifications.send(
|
|
|
120
127
|
|
|
121
128
|
## Live Activities
|
|
122
129
|
|
|
123
|
-
There are
|
|
130
|
+
There are six types of Live Activities:
|
|
124
131
|
|
|
125
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
|
|
126
133
|
- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
|
|
127
134
|
- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
|
|
128
135
|
- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
|
|
129
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
|
|
130
138
|
|
|
131
139
|
### Start & Update Live Activity
|
|
132
140
|
|
|
@@ -264,13 +272,34 @@ activitysmith.live_activities.stream(
|
|
|
264
272
|
)
|
|
265
273
|
```
|
|
266
274
|
|
|
267
|
-
|
|
275
|
+
#### Timer
|
|
268
276
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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>
|
|
272
284
|
|
|
273
|
-
|
|
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`.
|
|
274
303
|
|
|
275
304
|
### End Live Activity
|
|
276
305
|
|
|
@@ -296,8 +325,11 @@ activitysmith.live_activities.end_stream(
|
|
|
296
325
|
|
|
297
326
|
### Live Activity Action
|
|
298
327
|
|
|
299
|
-
Live Activities can include one optional action button.
|
|
300
|
-
|
|
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.
|
|
301
333
|
|
|
302
334
|
<p align="center">
|
|
303
335
|
<img
|
|
@@ -323,7 +355,7 @@ activitysmith.live_activities.stream(
|
|
|
323
355
|
]
|
|
324
356
|
},
|
|
325
357
|
action: {
|
|
326
|
-
title: "
|
|
358
|
+
title: "Dashboard",
|
|
327
359
|
type: "open_url",
|
|
328
360
|
url: "https://ops.example.com/servers/prod-web-1"
|
|
329
361
|
}
|
|
@@ -331,6 +363,28 @@ activitysmith.live_activities.stream(
|
|
|
331
363
|
)
|
|
332
364
|
```
|
|
333
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
|
+
|
|
334
388
|
#### Webhook action
|
|
335
389
|
|
|
336
390
|
```ruby
|
|
@@ -358,6 +412,79 @@ activitysmith.live_activities.stream(
|
|
|
358
412
|
)
|
|
359
413
|
```
|
|
360
414
|
|
|
415
|
+
### Icons and Badges
|
|
416
|
+
|
|
417
|
+
Add more context to Live Activities with icons and badges.
|
|
418
|
+
|
|
419
|
+
#### Icon
|
|
420
|
+
|
|
421
|
+
Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
|
|
422
|
+
|
|
423
|
+
<p align="center">
|
|
424
|
+
<img
|
|
425
|
+
src="https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png"
|
|
426
|
+
alt="Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen"
|
|
427
|
+
width="680"
|
|
428
|
+
/>
|
|
429
|
+
</p>
|
|
430
|
+
|
|
431
|
+
```ruby
|
|
432
|
+
activitysmith.live_activities.stream(
|
|
433
|
+
"prod-web-1",
|
|
434
|
+
{
|
|
435
|
+
content_state: ActivitySmith::LiveActivities.content_state(
|
|
436
|
+
title: "Server Health",
|
|
437
|
+
subtitle: "prod-web-1",
|
|
438
|
+
type: "metrics",
|
|
439
|
+
icon: ActivitySmith::LiveActivities.alert_icon("server.rack", color: "blue"),
|
|
440
|
+
metrics: [
|
|
441
|
+
{ label: "CPU", value: 18, unit: "%" },
|
|
442
|
+
{ label: "MEM", value: 42, unit: "%" }
|
|
443
|
+
]
|
|
444
|
+
)
|
|
445
|
+
}
|
|
446
|
+
)
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one of these tools:
|
|
450
|
+
|
|
451
|
+
- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use
|
|
452
|
+
- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app
|
|
453
|
+
- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography
|
|
454
|
+
|
|
455
|
+
#### Badge
|
|
456
|
+
|
|
457
|
+
Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities.
|
|
458
|
+
|
|
459
|
+
<p align="center">
|
|
460
|
+
<img
|
|
461
|
+
src="https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png"
|
|
462
|
+
alt="Progress Live Activity with a badge on the iPhone Lock Screen"
|
|
463
|
+
width="680"
|
|
464
|
+
/>
|
|
465
|
+
</p>
|
|
466
|
+
|
|
467
|
+
```ruby
|
|
468
|
+
activitysmith.live_activities.stream(
|
|
469
|
+
"nightly-database-backup",
|
|
470
|
+
{
|
|
471
|
+
content_state: ActivitySmith::LiveActivities.content_state(
|
|
472
|
+
title: "Nightly Database Backup",
|
|
473
|
+
subtitle: "verify restore",
|
|
474
|
+
type: "progress",
|
|
475
|
+
badge: ActivitySmith::LiveActivities.alert_badge("S3", color: "cyan"),
|
|
476
|
+
percentage: 62
|
|
477
|
+
)
|
|
478
|
+
}
|
|
479
|
+
)
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### Live Activity Colors
|
|
483
|
+
|
|
484
|
+
Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge:
|
|
485
|
+
|
|
486
|
+
`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`
|
|
487
|
+
|
|
361
488
|
## Channels
|
|
362
489
|
|
|
363
490
|
Channels are used to target specific team members or devices. Can be used for both push notifications and live activities.
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
|
@@ -23,7 +23,7 @@ module OpenapiClient
|
|
|
23
23
|
# Total number of steps. Use for type=segmented_progress. Optional on end, and safe to change if the final workflow used more or fewer steps than originally planned.
|
|
24
24
|
attr_accessor :number_of_steps
|
|
25
25
|
|
|
26
|
-
# Current step. Use for type=segmented_progress.
|
|
26
|
+
# Current completed step count. Use for type=segmented_progress. Must be less than or equal to number_of_steps when number_of_steps is provided.
|
|
27
27
|
attr_accessor :current_step
|
|
28
28
|
|
|
29
29
|
# Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
@@ -35,22 +35,31 @@ 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
|
|
53
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
45
54
|
attr_accessor :icon
|
|
46
55
|
|
|
47
|
-
# Optional badge
|
|
56
|
+
# Optional badge. Supported by alert, progress, and segmented_progress.
|
|
48
57
|
attr_accessor :badge
|
|
49
58
|
|
|
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
|
|
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
|
|
@@ -240,8 +271,8 @@ module OpenapiClient
|
|
|
240
271
|
invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.')
|
|
241
272
|
end
|
|
242
273
|
|
|
243
|
-
if !@current_step.nil? && @current_step <
|
|
244
|
-
invalid_properties.push('invalid value for "current_step", must be greater than or equal to
|
|
274
|
+
if !@current_step.nil? && @current_step < 0
|
|
275
|
+
invalid_properties.push('invalid value for "current_step", must be greater than or equal to 0.')
|
|
245
276
|
end
|
|
246
277
|
|
|
247
278
|
if !@percentage.nil? && @percentage > 100
|
|
@@ -277,13 +308,13 @@ module OpenapiClient
|
|
|
277
308
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
278
309
|
return false if @title.nil?
|
|
279
310
|
return false if !@number_of_steps.nil? && @number_of_steps < 1
|
|
280
|
-
return false if !@current_step.nil? && @current_step <
|
|
311
|
+
return false if !@current_step.nil? && @current_step < 0
|
|
281
312
|
return false if !@percentage.nil? && @percentage > 100
|
|
282
313
|
return false if !@percentage.nil? && @percentage < 0
|
|
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)
|
|
@@ -314,8 +345,8 @@ module OpenapiClient
|
|
|
314
345
|
fail ArgumentError, 'current_step cannot be nil'
|
|
315
346
|
end
|
|
316
347
|
|
|
317
|
-
if current_step <
|
|
318
|
-
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to
|
|
348
|
+
if current_step < 0
|
|
349
|
+
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to 0.'
|
|
319
350
|
end
|
|
320
351
|
|
|
321
352
|
@current_step = current_step
|
|
@@ -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,
|
|
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
|
|
|
@@ -23,7 +23,7 @@ module OpenapiClient
|
|
|
23
23
|
# Total number of steps. Use for type=segmented_progress. This value can be increased or decreased later when updating or ending the same activity.
|
|
24
24
|
attr_accessor :number_of_steps
|
|
25
25
|
|
|
26
|
-
# Current step. Use for type=segmented_progress.
|
|
26
|
+
# Current completed step count. Use for type=segmented_progress. Set 0 when the activity has started but no segment is complete yet. Must be less than or equal to number_of_steps.
|
|
27
27
|
attr_accessor :current_step
|
|
28
28
|
|
|
29
29
|
# Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
@@ -35,21 +35,30 @@ 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
|
|
53
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
45
54
|
attr_accessor :icon
|
|
46
55
|
|
|
47
|
-
# Optional badge
|
|
56
|
+
# Optional badge. Supported by alert, progress, and segmented_progress.
|
|
48
57
|
attr_accessor :badge
|
|
49
58
|
|
|
50
59
|
attr_accessor :type
|
|
51
60
|
|
|
52
|
-
# Optional. Accent color for progress, segmented_progress, and
|
|
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
|
|
@@ -230,8 +261,8 @@ module OpenapiClient
|
|
|
230
261
|
invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.')
|
|
231
262
|
end
|
|
232
263
|
|
|
233
|
-
if !@current_step.nil? && @current_step <
|
|
234
|
-
invalid_properties.push('invalid value for "current_step", must be greater than or equal to
|
|
264
|
+
if !@current_step.nil? && @current_step < 0
|
|
265
|
+
invalid_properties.push('invalid value for "current_step", must be greater than or equal to 0.')
|
|
235
266
|
end
|
|
236
267
|
|
|
237
268
|
if !@percentage.nil? && @percentage > 100
|
|
@@ -267,14 +298,14 @@ module OpenapiClient
|
|
|
267
298
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
268
299
|
return false if @title.nil?
|
|
269
300
|
return false if !@number_of_steps.nil? && @number_of_steps < 1
|
|
270
|
-
return false if !@current_step.nil? && @current_step <
|
|
301
|
+
return false if !@current_step.nil? && @current_step < 0
|
|
271
302
|
return false if !@percentage.nil? && @percentage > 100
|
|
272
303
|
return false if !@percentage.nil? && @percentage < 0
|
|
273
304
|
return false if !@metrics.nil? && @metrics.length > 8
|
|
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)
|
|
@@ -304,8 +335,8 @@ module OpenapiClient
|
|
|
304
335
|
fail ArgumentError, 'current_step cannot be nil'
|
|
305
336
|
end
|
|
306
337
|
|
|
307
|
-
if current_step <
|
|
308
|
-
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to
|
|
338
|
+
if current_step < 0
|
|
339
|
+
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to 0.'
|
|
309
340
|
end
|
|
310
341
|
|
|
311
342
|
@current_step = current_step
|
|
@@ -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,
|
|
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
|
|
|
@@ -23,7 +23,7 @@ module OpenapiClient
|
|
|
23
23
|
# Total number of steps. Use for type=segmented_progress. Optional on update, and safe to change if the workflow gains or loses steps.
|
|
24
24
|
attr_accessor :number_of_steps
|
|
25
25
|
|
|
26
|
-
# Current step. Use for type=segmented_progress.
|
|
26
|
+
# Current completed step count. Use for type=segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.
|
|
27
27
|
attr_accessor :current_step
|
|
28
28
|
|
|
29
29
|
# Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
@@ -35,22 +35,31 @@ 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
|
|
53
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
45
54
|
attr_accessor :icon
|
|
46
55
|
|
|
47
|
-
# Optional badge
|
|
56
|
+
# Optional badge. Supported by alert, progress, and segmented_progress.
|
|
48
57
|
attr_accessor :badge
|
|
49
58
|
|
|
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
|
|
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
|
|
@@ -229,8 +260,8 @@ module OpenapiClient
|
|
|
229
260
|
invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.')
|
|
230
261
|
end
|
|
231
262
|
|
|
232
|
-
if !@current_step.nil? && @current_step <
|
|
233
|
-
invalid_properties.push('invalid value for "current_step", must be greater than or equal to
|
|
263
|
+
if !@current_step.nil? && @current_step < 0
|
|
264
|
+
invalid_properties.push('invalid value for "current_step", must be greater than or equal to 0.')
|
|
234
265
|
end
|
|
235
266
|
|
|
236
267
|
if !@percentage.nil? && @percentage > 100
|
|
@@ -262,13 +293,13 @@ module OpenapiClient
|
|
|
262
293
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
263
294
|
return false if @title.nil?
|
|
264
295
|
return false if !@number_of_steps.nil? && @number_of_steps < 1
|
|
265
|
-
return false if !@current_step.nil? && @current_step <
|
|
296
|
+
return false if !@current_step.nil? && @current_step < 0
|
|
266
297
|
return false if !@percentage.nil? && @percentage > 100
|
|
267
298
|
return false if !@percentage.nil? && @percentage < 0
|
|
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)
|
|
@@ -298,8 +329,8 @@ module OpenapiClient
|
|
|
298
329
|
fail ArgumentError, 'current_step cannot be nil'
|
|
299
330
|
end
|
|
300
331
|
|
|
301
|
-
if current_step <
|
|
302
|
-
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to
|
|
332
|
+
if current_step < 0
|
|
333
|
+
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to 0.'
|
|
303
334
|
end
|
|
304
335
|
|
|
305
336
|
@current_step = current_step
|
|
@@ -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
|
-
#
|
|
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.
|
|
@@ -30,28 +30,6 @@ module OpenapiClient
|
|
|
30
30
|
# Optional webhook payload body. Used only when type=webhook.
|
|
31
31
|
attr_accessor :body
|
|
32
32
|
|
|
33
|
-
class EnumAttributeValidator
|
|
34
|
-
attr_reader :datatype
|
|
35
|
-
attr_reader :allowable_values
|
|
36
|
-
|
|
37
|
-
def initialize(datatype, allowable_values)
|
|
38
|
-
@allowable_values = allowable_values.map do |value|
|
|
39
|
-
case datatype.to_s
|
|
40
|
-
when /Integer/i
|
|
41
|
-
value.to_i
|
|
42
|
-
when /Float/i
|
|
43
|
-
value.to_f
|
|
44
|
-
else
|
|
45
|
-
value
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def valid?(value)
|
|
51
|
-
!value || allowable_values.include?(value)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
34
|
def self.attribute_map
|
|
57
35
|
{
|
|
@@ -148,11 +126,6 @@ module OpenapiClient
|
|
|
148
126
|
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
149
127
|
end
|
|
150
128
|
|
|
151
|
-
pattern = Regexp.new(/^https:\/\//)
|
|
152
|
-
if @url !~ pattern
|
|
153
|
-
invalid_properties.push("invalid value for \"url\", must conform to the pattern #{pattern}.")
|
|
154
|
-
end
|
|
155
|
-
|
|
156
129
|
invalid_properties
|
|
157
130
|
end
|
|
158
131
|
|
|
@@ -163,25 +136,9 @@ module OpenapiClient
|
|
|
163
136
|
return false if @title.nil?
|
|
164
137
|
return false if @type.nil?
|
|
165
138
|
return false if @url.nil?
|
|
166
|
-
return false if @url !~ Regexp.new(/^https:\/\//)
|
|
167
139
|
true
|
|
168
140
|
end
|
|
169
141
|
|
|
170
|
-
# Custom attribute writer method with validation
|
|
171
|
-
# @param [Object] url Value to be assigned
|
|
172
|
-
def url=(url)
|
|
173
|
-
if url.nil?
|
|
174
|
-
fail ArgumentError, 'url cannot be nil'
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
pattern = Regexp.new(/^https:\/\//)
|
|
178
|
-
if url !~ pattern
|
|
179
|
-
fail ArgumentError, "invalid value for \"url\", must conform to the pattern #{pattern}."
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
@url = url
|
|
183
|
-
end
|
|
184
|
-
|
|
185
142
|
# Checks equality by comparing each attribute.
|
|
186
143
|
# @param [Object] Object to be compared
|
|
187
144
|
def ==(o)
|
|
@@ -20,7 +20,7 @@ module OpenapiClient
|
|
|
20
20
|
|
|
21
21
|
attr_accessor :type
|
|
22
22
|
|
|
23
|
-
#
|
|
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.
|
|
@@ -29,28 +29,6 @@ module OpenapiClient
|
|
|
29
29
|
# Optional webhook payload body. Used only when type=webhook.
|
|
30
30
|
attr_accessor :body
|
|
31
31
|
|
|
32
|
-
class EnumAttributeValidator
|
|
33
|
-
attr_reader :datatype
|
|
34
|
-
attr_reader :allowable_values
|
|
35
|
-
|
|
36
|
-
def initialize(datatype, allowable_values)
|
|
37
|
-
@allowable_values = allowable_values.map do |value|
|
|
38
|
-
case datatype.to_s
|
|
39
|
-
when /Integer/i
|
|
40
|
-
value.to_i
|
|
41
|
-
when /Float/i
|
|
42
|
-
value.to_f
|
|
43
|
-
else
|
|
44
|
-
value
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def valid?(value)
|
|
50
|
-
!value || allowable_values.include?(value)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
33
|
def self.attribute_map
|
|
56
34
|
{
|
|
@@ -147,11 +125,6 @@ module OpenapiClient
|
|
|
147
125
|
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
148
126
|
end
|
|
149
127
|
|
|
150
|
-
pattern = Regexp.new(/^https:\/\//)
|
|
151
|
-
if @url !~ pattern
|
|
152
|
-
invalid_properties.push("invalid value for \"url\", must conform to the pattern #{pattern}.")
|
|
153
|
-
end
|
|
154
|
-
|
|
155
128
|
invalid_properties
|
|
156
129
|
end
|
|
157
130
|
|
|
@@ -162,25 +135,9 @@ module OpenapiClient
|
|
|
162
135
|
return false if @title.nil?
|
|
163
136
|
return false if @type.nil?
|
|
164
137
|
return false if @url.nil?
|
|
165
|
-
return false if @url !~ Regexp.new(/^https:\/\//)
|
|
166
138
|
true
|
|
167
139
|
end
|
|
168
140
|
|
|
169
|
-
# Custom attribute writer method with validation
|
|
170
|
-
# @param [Object] url Value to be assigned
|
|
171
|
-
def url=(url)
|
|
172
|
-
if url.nil?
|
|
173
|
-
fail ArgumentError, 'url cannot be nil'
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
pattern = Regexp.new(/^https:\/\//)
|
|
177
|
-
if url !~ pattern
|
|
178
|
-
fail ArgumentError, "invalid value for \"url\", must conform to the pattern #{pattern}."
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
@url = url
|
|
182
|
-
end
|
|
183
|
-
|
|
184
141
|
# Checks equality by comparing each attribute.
|
|
185
142
|
# @param [Object] Object to be compared
|
|
186
143
|
def ==(o)
|
|
@@ -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 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`.
|
|
@@ -157,7 +157,7 @@ module OpenapiClient
|
|
|
157
157
|
invalid_properties.push("invalid value for \"media\", must conform to the pattern #{pattern}.")
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
-
pattern = Regexp.new(/^https:\/\//)
|
|
160
|
+
pattern = Regexp.new(/^(https|shortcuts):\/\//)
|
|
161
161
|
if !@redirection.nil? && @redirection !~ pattern
|
|
162
162
|
invalid_properties.push("invalid value for \"redirection\", must conform to the pattern #{pattern}.")
|
|
163
163
|
end
|
|
@@ -175,7 +175,7 @@ module OpenapiClient
|
|
|
175
175
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
176
176
|
return false if @title.nil?
|
|
177
177
|
return false if !@media.nil? && @media !~ Regexp.new(/^https:\/\//)
|
|
178
|
-
return false if !@redirection.nil? && @redirection !~ Regexp.new(/^https:\/\//)
|
|
178
|
+
return false if !@redirection.nil? && @redirection !~ Regexp.new(/^(https|shortcuts):\/\//)
|
|
179
179
|
return false if !@actions.nil? && @actions.length > 4
|
|
180
180
|
true
|
|
181
181
|
end
|
|
@@ -202,7 +202,7 @@ module OpenapiClient
|
|
|
202
202
|
fail ArgumentError, 'redirection cannot be nil'
|
|
203
203
|
end
|
|
204
204
|
|
|
205
|
-
pattern = Regexp.new(/^https:\/\//)
|
|
205
|
+
pattern = Regexp.new(/^(https|shortcuts):\/\//)
|
|
206
206
|
if redirection !~ pattern
|
|
207
207
|
fail ArgumentError, "invalid value for \"redirection\", must conform to the pattern #{pattern}."
|
|
208
208
|
end
|
|
@@ -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
|
|
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
|
|
|
@@ -23,7 +23,7 @@ module OpenapiClient
|
|
|
23
23
|
# Use for segmented_progress.
|
|
24
24
|
attr_accessor :number_of_steps
|
|
25
25
|
|
|
26
|
-
# Use for segmented_progress.
|
|
26
|
+
# Use for segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.
|
|
27
27
|
attr_accessor :current_step
|
|
28
28
|
|
|
29
29
|
# Use for progress. Takes precedence over value/upper_limit if both are provided.
|
|
@@ -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
|
|
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,10 +62,10 @@ module OpenapiClient
|
|
|
53
62
|
# Required for type=alert.
|
|
54
63
|
attr_accessor :message
|
|
55
64
|
|
|
56
|
-
# Optional SF Symbol icon
|
|
65
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
57
66
|
attr_accessor :icon
|
|
58
67
|
|
|
59
|
-
# Optional badge
|
|
68
|
+
# Optional badge. Supported by alert, progress, and segmented_progress.
|
|
60
69
|
attr_accessor :badge
|
|
61
70
|
|
|
62
71
|
# Optional. Seconds before the ended Live Activity is dismissed.
|
|
@@ -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
|
|
@@ -247,8 +278,8 @@ module OpenapiClient
|
|
|
247
278
|
invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.')
|
|
248
279
|
end
|
|
249
280
|
|
|
250
|
-
if !@current_step.nil? && @current_step <
|
|
251
|
-
invalid_properties.push('invalid value for "current_step", must be greater than or equal to
|
|
281
|
+
if !@current_step.nil? && @current_step < 0
|
|
282
|
+
invalid_properties.push('invalid value for "current_step", must be greater than or equal to 0.')
|
|
252
283
|
end
|
|
253
284
|
|
|
254
285
|
if !@percentage.nil? && @percentage > 100
|
|
@@ -288,10 +319,10 @@ module OpenapiClient
|
|
|
288
319
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
289
320
|
return false if @title.nil?
|
|
290
321
|
return false if !@number_of_steps.nil? && @number_of_steps < 1
|
|
291
|
-
return false if !@current_step.nil? && @current_step <
|
|
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)
|
|
@@ -326,8 +357,8 @@ module OpenapiClient
|
|
|
326
357
|
fail ArgumentError, 'current_step cannot be nil'
|
|
327
358
|
end
|
|
328
359
|
|
|
329
|
-
if current_step <
|
|
330
|
-
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to
|
|
360
|
+
if current_step < 0
|
|
361
|
+
fail ArgumentError, 'invalid value for "current_step", must be greater than or equal to 0.'
|
|
331
362
|
end
|
|
332
363
|
|
|
333
364
|
@current_step = current_step
|
|
@@ -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
|
|
@@ -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
|
|
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.
|
|
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-
|
|
11
|
+
date: 2026-06-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|