activitysmith 1.11.0 → 1.12.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 +53 -37
- data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
- data/generated/activitysmith_openapi/api/metrics_api.rb +2 -2
- data/generated/activitysmith_openapi/models/content_state_end.rb +8 -8
- data/generated/activitysmith_openapi/models/content_state_start.rb +8 -8
- data/generated/activitysmith_openapi/models/content_state_update.rb +8 -8
- data/generated/activitysmith_openapi/models/live_activity_action.rb +23 -1
- data/generated/activitysmith_openapi/models/live_activity_end_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_start_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_update_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_value.rb +106 -0
- data/generated/activitysmith_openapi/models/push_notification_action.rb +22 -0
- data/generated/activitysmith_openapi/models/rate_limit_error.rb +44 -1
- data/generated/activitysmith_openapi/models/stream_content_state.rb +8 -8
- data/generated/activitysmith_openapi/version.rb +1 -1
- data/generated/activitysmith_openapi.rb +1 -0
- data/generated/openapi-source.json +2 -2
- data/lib/activitysmith/live_activities.rb +1 -0
- data/lib/activitysmith/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f86e85308bf6c8e023bd259ab6eba591f133b374f3f7ac1e15b82bac6be9048
|
|
4
|
+
data.tar.gz: 513d68dbcb7fd304985455cae2402a164e06fb37f2a78b80388ff24f70d531a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7dbbe2d1bb79c686e17d2e366a0ee37eb72122b0f0767fb1fa38aaade1e7f1ae18a4094634e99bc18f92f9e33d37dfe5f1612e848f8cfd43193b467cb5066d71
|
|
7
|
+
data.tar.gz: 7b9163d87d7d3e7207233880cbeb7a45fd577725d7f6753d92d1acf70d778374962a2f63b9c0ddb652aeb130833a1939cd5f7e4da6370b2585d1d8dfdad67e0e
|
data/README.md
CHANGED
|
@@ -140,33 +140,45 @@ activitysmith.notifications.send(
|
|
|
140
140
|
|
|
141
141
|
Choose the Live Activity type that matches what you want to show:
|
|
142
142
|
|
|
143
|
-
 **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature.
|
|
144
144
|
|
|
145
|
-
**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
|
|
145
|
+
-  **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
|
|
146
146
|
|
|
147
|
-
 **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
|
|
148
148
|
|
|
149
|
-
**Metrics**: Track two related values with segmented bars, such as CPU and memory.
|
|
149
|
+
-  **Metrics**: Track two related values with segmented bars, such as CPU and memory.
|
|
150
150
|
|
|
151
|
-

|
|
151
|
+
-  **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
-  **Progress**: Show percentage progress for jobs that move continuously toward completion.
|
|
154
154
|
|
|
155
|
-
 **Timer**: Count down from a duration, or count up from 00:00 while a job runs.
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-

|
|
157
|
+
### Start & Update Live Activity
|
|
160
158
|
|
|
161
|
-
|
|
159
|
+
Use a stable `stream_key` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `stream_key` update it.
|
|
162
160
|
|
|
163
|
-
|
|
161
|
+
#### Value
|
|
164
162
|
|
|
165
|
-
|
|
163
|
+

|
|
166
164
|
|
|
167
|
-
|
|
165
|
+
```ruby
|
|
166
|
+
activitysmith.live_activities.stream(
|
|
167
|
+
"revenue-today",
|
|
168
|
+
{
|
|
169
|
+
content_state: {
|
|
170
|
+
title: "Revenue",
|
|
171
|
+
type: "value",
|
|
172
|
+
value: "$1,240",
|
|
173
|
+
color: "green",
|
|
174
|
+
icon: { symbol: "dollarsign.circle", color: "green" },
|
|
175
|
+
badge: { title: "↑ 18%", color: "purple" }
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
```
|
|
168
180
|
|
|
169
|
-
|
|
181
|
+
Send a string or number in `value`. Strings keep their formatting, including currency symbols, units, and decimal places.
|
|
170
182
|
|
|
171
183
|
#### Stats
|
|
172
184
|
|
|
@@ -193,6 +205,25 @@ activitysmith.live_activities.stream(
|
|
|
193
205
|
)
|
|
194
206
|
```
|
|
195
207
|
|
|
208
|
+
#### Alert
|
|
209
|
+
|
|
210
|
+

|
|
211
|
+
|
|
212
|
+
```ruby
|
|
213
|
+
activitysmith.live_activities.stream(
|
|
214
|
+
"customer-ops",
|
|
215
|
+
{
|
|
216
|
+
content_state: ActivitySmith::LiveActivities.content_state(
|
|
217
|
+
title: "Reactivation",
|
|
218
|
+
message: "Lumen came back after 2 weeks",
|
|
219
|
+
type: ActivitySmith::LiveActivities::TYPE_ALERT,
|
|
220
|
+
icon: ActivitySmith::LiveActivities.alert_icon("cloud.sun", color: "yellow"),
|
|
221
|
+
badge: ActivitySmith::LiveActivities.alert_badge("Customer", color: "magenta")
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
```
|
|
226
|
+
|
|
196
227
|
#### Metrics
|
|
197
228
|
|
|
198
229
|

|
|
@@ -251,25 +282,6 @@ activitysmith.live_activities.stream(
|
|
|
251
282
|
)
|
|
252
283
|
```
|
|
253
284
|
|
|
254
|
-
#### Alert
|
|
255
|
-
|
|
256
|
-

|
|
257
|
-
|
|
258
|
-
```ruby
|
|
259
|
-
activitysmith.live_activities.stream(
|
|
260
|
-
"customer-ops",
|
|
261
|
-
{
|
|
262
|
-
content_state: ActivitySmith::LiveActivities.content_state(
|
|
263
|
-
title: "Reactivation",
|
|
264
|
-
message: "Lumen came back after 2 weeks",
|
|
265
|
-
type: ActivitySmith::LiveActivities::TYPE_ALERT,
|
|
266
|
-
icon: ActivitySmith::LiveActivities.alert_icon("cloud.sun", color: "yellow"),
|
|
267
|
-
badge: ActivitySmith::LiveActivities.alert_badge("Customer", color: "magenta")
|
|
268
|
-
)
|
|
269
|
-
}
|
|
270
|
-
)
|
|
271
|
-
```
|
|
272
|
-
|
|
273
285
|
#### Timer
|
|
274
286
|
|
|
275
287
|

|
|
@@ -321,7 +333,7 @@ Add more context to Live Activities with icons and badges.
|
|
|
321
333
|
|
|
322
334
|
#### Icon
|
|
323
335
|
|
|
324
|
-
Supported Live Activity types: `stats`, `
|
|
336
|
+
Supported Live Activity types: `value`, `stats`, `alert`, `metrics`, `segmented_progress`, `progress`, and `timer`.
|
|
325
337
|
|
|
326
338
|

|
|
327
339
|
|
|
@@ -351,7 +363,7 @@ The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one
|
|
|
351
363
|
|
|
352
364
|
#### Badge
|
|
353
365
|
|
|
354
|
-
Badges are supported by `alert`, `
|
|
366
|
+
Badges are supported by `value`, `alert`, `segmented_progress`, and `progress` Live Activities.
|
|
355
367
|
|
|
356
368
|

|
|
357
369
|
|
|
@@ -471,7 +483,7 @@ activitysmith.live_activities.stream(
|
|
|
471
483
|
|
|
472
484
|
Use `secondary_action` when you want a second button beside the primary `action`.
|
|
473
485
|
|
|
474
|
-
The secondary action button is supported for `alert`, `
|
|
486
|
+
The secondary action button is supported for `value`, `alert`, `segmented_progress`, and `progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes.
|
|
475
487
|
|
|
476
488
|
```ruby
|
|
477
489
|
activitysmith.live_activities.stream(
|
|
@@ -653,3 +665,7 @@ end
|
|
|
653
665
|
### [RubyGems Package](https://rubygems.org/gems/activitysmith)
|
|
654
666
|
|
|
655
667
|
Install the ActivitySmith Ruby SDK from RubyGems
|
|
668
|
+
|
|
669
|
+
### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-ruby)
|
|
670
|
+
|
|
671
|
+
View the Ruby SDK source on GitHub
|
|
@@ -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, alert, 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, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
|
|
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, alert, 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, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
|
|
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
|
|
@@ -88,7 +88,7 @@ module OpenapiClient
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# End a stream
|
|
91
|
-
# Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and
|
|
91
|
+
# Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
|
|
92
92
|
# @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
|
|
93
93
|
# @param [Hash] opts the optional parameters
|
|
94
94
|
# @option opts [LiveActivityStreamDeleteRequest] :live_activity_stream_delete_request
|
|
@@ -99,7 +99,7 @@ module OpenapiClient
|
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
# End a stream
|
|
102
|
-
# Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and
|
|
102
|
+
# Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
|
|
103
103
|
# @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
|
|
104
104
|
# @param [Hash] opts the optional parameters
|
|
105
105
|
# @option opts [LiveActivityStreamDeleteRequest] :live_activity_stream_delete_request
|
|
@@ -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. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and
|
|
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. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
|
|
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. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and
|
|
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. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
|
|
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, alert, 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, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history.
|
|
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, alert, 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, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history.
|
|
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, alert, 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, timer, and value 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. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
|
|
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, alert, 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, timer, and value 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. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
|
|
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
|
|
@@ -20,7 +20,7 @@ module OpenapiClient
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Update a widget metric value
|
|
23
|
-
# Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
|
|
23
|
+
# Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
|
|
24
24
|
# @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
|
|
25
25
|
# @param metric_value_update_request [MetricValueUpdateRequest]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
@@ -31,7 +31,7 @@ module OpenapiClient
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Update a widget metric value
|
|
34
|
-
# Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
|
|
34
|
+
# Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
|
|
35
35
|
# @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
|
|
36
36
|
# @param metric_value_update_request [MetricValueUpdateRequest]
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
@@ -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. 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
|
|
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 value include a string or number in value; strings preserve currency, units, and other formatting. 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, segmented_progress, and value. 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
|
|
|
@@ -29,7 +29,7 @@ module OpenapiClient
|
|
|
29
29
|
# Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
30
30
|
attr_accessor :percentage
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.
|
|
33
33
|
attr_accessor :value
|
|
34
34
|
|
|
35
35
|
# Maximum progress value. Use with value for type=progress.
|
|
@@ -50,16 +50,16 @@ module OpenapiClient
|
|
|
50
50
|
# Alert message. Use for type=alert.
|
|
51
51
|
attr_accessor :message
|
|
52
52
|
|
|
53
|
-
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and
|
|
53
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
|
|
54
54
|
attr_accessor :icon
|
|
55
55
|
|
|
56
|
-
# Optional badge. Supported by alert, progress, and
|
|
56
|
+
# Optional badge. Supported by alert, progress, segmented_progress, and value.
|
|
57
57
|
attr_accessor :badge
|
|
58
58
|
|
|
59
59
|
# Optional. When omitted, the API uses the existing Live Activity type.
|
|
60
60
|
attr_accessor :type
|
|
61
61
|
|
|
62
|
-
# Optional. Accent color for progress, segmented_progress, metrics, and
|
|
62
|
+
# Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
|
|
63
63
|
attr_accessor :color
|
|
64
64
|
|
|
65
65
|
# Optional. Overrides color for the current step. Only applies to type=segmented_progress.
|
|
@@ -131,7 +131,7 @@ module OpenapiClient
|
|
|
131
131
|
:'number_of_steps' => :'Integer',
|
|
132
132
|
:'current_step' => :'Integer',
|
|
133
133
|
:'percentage' => :'Float',
|
|
134
|
-
:'value' => :'
|
|
134
|
+
:'value' => :'LiveActivityValue',
|
|
135
135
|
:'upper_limit' => :'Float',
|
|
136
136
|
:'duration_seconds' => :'Float',
|
|
137
137
|
:'counts_down' => :'Boolean',
|
|
@@ -314,7 +314,7 @@ module OpenapiClient
|
|
|
314
314
|
return false if !@metrics.nil? && @metrics.length > 8
|
|
315
315
|
return false if !@metrics.nil? && @metrics.length < 1
|
|
316
316
|
return false if !@message.nil? && @message.to_s.length < 1
|
|
317
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
317
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
318
318
|
return false unless type_validator.valid?(@type)
|
|
319
319
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
|
|
320
320
|
return false unless color_validator.valid?(@color)
|
|
@@ -405,7 +405,7 @@ module OpenapiClient
|
|
|
405
405
|
# Custom attribute writer method checking allowed values (enum).
|
|
406
406
|
# @param [Object] type Object to be assigned
|
|
407
407
|
def type=(type)
|
|
408
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
408
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
409
409
|
unless validator.valid?(type)
|
|
410
410
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
411
411
|
end
|
|
@@ -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. 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
|
|
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 value include a string or number in value; strings preserve currency, units, and other formatting. 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, segmented_progress, and value. 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
|
|
|
@@ -29,7 +29,7 @@ module OpenapiClient
|
|
|
29
29
|
# Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
30
30
|
attr_accessor :percentage
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.
|
|
33
33
|
attr_accessor :value
|
|
34
34
|
|
|
35
35
|
# Maximum progress value. Use with value for type=progress.
|
|
@@ -50,15 +50,15 @@ module OpenapiClient
|
|
|
50
50
|
# Required for type=alert.
|
|
51
51
|
attr_accessor :message
|
|
52
52
|
|
|
53
|
-
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and
|
|
53
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
|
|
54
54
|
attr_accessor :icon
|
|
55
55
|
|
|
56
|
-
# Optional badge. Supported by alert, progress, and
|
|
56
|
+
# Optional badge. Supported by alert, progress, segmented_progress, and value.
|
|
57
57
|
attr_accessor :badge
|
|
58
58
|
|
|
59
59
|
attr_accessor :type
|
|
60
60
|
|
|
61
|
-
# Optional. Accent color for progress, segmented_progress, metrics, and
|
|
61
|
+
# Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
|
|
62
62
|
attr_accessor :color
|
|
63
63
|
|
|
64
64
|
# Optional. Overrides color for the current step. Only applies to type=segmented_progress.
|
|
@@ -126,7 +126,7 @@ module OpenapiClient
|
|
|
126
126
|
:'number_of_steps' => :'Integer',
|
|
127
127
|
:'current_step' => :'Integer',
|
|
128
128
|
:'percentage' => :'Float',
|
|
129
|
-
:'value' => :'
|
|
129
|
+
:'value' => :'LiveActivityValue',
|
|
130
130
|
:'upper_limit' => :'Float',
|
|
131
131
|
:'duration_seconds' => :'Float',
|
|
132
132
|
:'counts_down' => :'Boolean',
|
|
@@ -305,7 +305,7 @@ module OpenapiClient
|
|
|
305
305
|
return false if !@metrics.nil? && @metrics.length < 1
|
|
306
306
|
return false if !@message.nil? && @message.to_s.length < 1
|
|
307
307
|
return false if @type.nil?
|
|
308
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
308
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
309
309
|
return false unless type_validator.valid?(@type)
|
|
310
310
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
|
|
311
311
|
return false unless color_validator.valid?(@color)
|
|
@@ -395,7 +395,7 @@ module OpenapiClient
|
|
|
395
395
|
# Custom attribute writer method checking allowed values (enum).
|
|
396
396
|
# @param [Object] type Object to be assigned
|
|
397
397
|
def type=(type)
|
|
398
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
398
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
399
399
|
unless validator.valid?(type)
|
|
400
400
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
401
401
|
end
|
|
@@ -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. 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
|
|
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 value include a string or number in value; strings preserve currency, units, and other formatting. 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, segmented_progress, and value. 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
|
|
|
@@ -29,7 +29,7 @@ module OpenapiClient
|
|
|
29
29
|
# Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
30
30
|
attr_accessor :percentage
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.
|
|
33
33
|
attr_accessor :value
|
|
34
34
|
|
|
35
35
|
# Maximum progress value. Use with value for type=progress.
|
|
@@ -50,16 +50,16 @@ module OpenapiClient
|
|
|
50
50
|
# Alert message. Use for type=alert.
|
|
51
51
|
attr_accessor :message
|
|
52
52
|
|
|
53
|
-
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and
|
|
53
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
|
|
54
54
|
attr_accessor :icon
|
|
55
55
|
|
|
56
|
-
# Optional badge. Supported by alert, progress, and
|
|
56
|
+
# Optional badge. Supported by alert, progress, segmented_progress, and value.
|
|
57
57
|
attr_accessor :badge
|
|
58
58
|
|
|
59
59
|
# Optional. When omitted, the API uses the existing Live Activity type.
|
|
60
60
|
attr_accessor :type
|
|
61
61
|
|
|
62
|
-
# Optional. Accent color for progress, segmented_progress, metrics, and
|
|
62
|
+
# Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
|
|
63
63
|
attr_accessor :color
|
|
64
64
|
|
|
65
65
|
# Optional. Overrides color for the current step. Only applies to type=segmented_progress.
|
|
@@ -127,7 +127,7 @@ module OpenapiClient
|
|
|
127
127
|
:'number_of_steps' => :'Integer',
|
|
128
128
|
:'current_step' => :'Integer',
|
|
129
129
|
:'percentage' => :'Float',
|
|
130
|
-
:'value' => :'
|
|
130
|
+
:'value' => :'LiveActivityValue',
|
|
131
131
|
:'upper_limit' => :'Float',
|
|
132
132
|
:'duration_seconds' => :'Float',
|
|
133
133
|
:'counts_down' => :'Boolean',
|
|
@@ -299,7 +299,7 @@ module OpenapiClient
|
|
|
299
299
|
return false if !@metrics.nil? && @metrics.length > 8
|
|
300
300
|
return false if !@metrics.nil? && @metrics.length < 1
|
|
301
301
|
return false if !@message.nil? && @message.to_s.length < 1
|
|
302
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
302
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
303
303
|
return false unless type_validator.valid?(@type)
|
|
304
304
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
|
|
305
305
|
return false unless color_validator.valid?(@color)
|
|
@@ -389,7 +389,7 @@ module OpenapiClient
|
|
|
389
389
|
# Custom attribute writer method checking allowed values (enum).
|
|
390
390
|
# @param [Object] type Object to be assigned
|
|
391
391
|
def type=(type)
|
|
392
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
392
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
393
393
|
unless validator.valid?(type)
|
|
394
394
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
395
395
|
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
-
# Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, and
|
|
17
|
+
# Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, segmented_progress, and value Live Activities.
|
|
18
18
|
class LiveActivityAction
|
|
19
19
|
# Button title displayed in the Live Activity UI.
|
|
20
20
|
attr_accessor :title
|
|
@@ -30,6 +30,28 @@ 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
|
+
|
|
33
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
56
|
def self.attribute_map
|
|
35
57
|
{
|
|
@@ -28,7 +28,7 @@ module OpenapiClient
|
|
|
28
28
|
|
|
29
29
|
attr_accessor :action
|
|
30
30
|
|
|
31
|
-
# Optional secondary action button. Supported for alert, progress, and
|
|
31
|
+
# Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
|
|
32
32
|
attr_accessor :secondary_action
|
|
33
33
|
|
|
34
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -23,7 +23,7 @@ module OpenapiClient
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :action
|
|
25
25
|
|
|
26
|
-
# Optional secondary action button. Supported for alert, progress, and
|
|
26
|
+
# Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
|
|
27
27
|
attr_accessor :secondary_action
|
|
28
28
|
|
|
29
29
|
attr_accessor :alert
|
|
@@ -26,7 +26,7 @@ module OpenapiClient
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :action
|
|
28
28
|
|
|
29
|
-
# Optional secondary action button. Supported for alert, progress, and
|
|
29
|
+
# Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
|
|
30
30
|
attr_accessor :secondary_action
|
|
31
31
|
|
|
32
32
|
attr_accessor :alert
|
|
@@ -23,7 +23,7 @@ module OpenapiClient
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :action
|
|
25
25
|
|
|
26
|
-
# Optional secondary action button. Supported for alert, progress, and
|
|
26
|
+
# Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
|
|
27
27
|
attr_accessor :secondary_action
|
|
28
28
|
|
|
29
29
|
attr_accessor :alert
|
|
@@ -28,7 +28,7 @@ module OpenapiClient
|
|
|
28
28
|
|
|
29
29
|
attr_accessor :action
|
|
30
30
|
|
|
31
|
-
# Optional secondary action button. Supported for alert, progress, and
|
|
31
|
+
# Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
|
|
32
32
|
attr_accessor :secondary_action
|
|
33
33
|
|
|
34
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ActivitySmith API
|
|
3
|
+
|
|
4
|
+
#Send push notifications and Live Activities to your own devices via a single API key.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.7.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OpenapiClient
|
|
17
|
+
# A formatted string or finite numeric Live Activity value. String formatting is preserved.
|
|
18
|
+
module LiveActivityValue
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
21
|
+
def openapi_one_of
|
|
22
|
+
[
|
|
23
|
+
:'Float',
|
|
24
|
+
:'String'
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the object
|
|
29
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
30
|
+
# @return [Object] Returns the model or the data itself
|
|
31
|
+
def build(data)
|
|
32
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
33
|
+
# Note:
|
|
34
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
35
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
36
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
37
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
38
|
+
# - TODO: logging when debugging is set.
|
|
39
|
+
openapi_one_of.each do |klass|
|
|
40
|
+
begin
|
|
41
|
+
next if klass == :AnyType # "nullable: true"
|
|
42
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
43
|
+
return typed_data if typed_data
|
|
44
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
53
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
54
|
+
|
|
55
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
56
|
+
def find_and_cast_into_type(klass, data)
|
|
57
|
+
return if data.nil?
|
|
58
|
+
|
|
59
|
+
case klass.to_s
|
|
60
|
+
when 'Boolean'
|
|
61
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
62
|
+
when 'Float'
|
|
63
|
+
return data if data.instance_of?(Float)
|
|
64
|
+
when 'Integer'
|
|
65
|
+
return data if data.instance_of?(Integer)
|
|
66
|
+
when 'Time'
|
|
67
|
+
return Time.parse(data)
|
|
68
|
+
when 'Date'
|
|
69
|
+
return Date.parse(data)
|
|
70
|
+
when 'String'
|
|
71
|
+
return data if data.instance_of?(String)
|
|
72
|
+
when 'Object' # "type: object"
|
|
73
|
+
return data if data.instance_of?(Hash)
|
|
74
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
75
|
+
if data.instance_of?(Array)
|
|
76
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
77
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
78
|
+
end
|
|
79
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
80
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
81
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
82
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
83
|
+
end
|
|
84
|
+
else # model
|
|
85
|
+
const = OpenapiClient.const_get(klass)
|
|
86
|
+
if const
|
|
87
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
88
|
+
model = const.build(data)
|
|
89
|
+
return model if model
|
|
90
|
+
else
|
|
91
|
+
# raise if data contains keys that are not known to the model
|
|
92
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
93
|
+
model = const.build_from_hash(data)
|
|
94
|
+
return model if model
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
raise # if no match by now, raise
|
|
100
|
+
rescue
|
|
101
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
end
|
|
@@ -29,6 +29,28 @@ 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
|
+
|
|
32
54
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
55
|
def self.attribute_map
|
|
34
56
|
{
|
|
@@ -15,13 +15,38 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
17
|
class RateLimitError
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
18
20
|
attr_accessor :error
|
|
19
21
|
|
|
20
22
|
attr_accessor :message
|
|
21
23
|
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
22
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
47
|
def self.attribute_map
|
|
24
48
|
{
|
|
49
|
+
:'code' => :'code',
|
|
25
50
|
:'error' => :'error',
|
|
26
51
|
:'message' => :'message'
|
|
27
52
|
}
|
|
@@ -35,6 +60,7 @@ module OpenapiClient
|
|
|
35
60
|
# Attribute type mapping.
|
|
36
61
|
def self.openapi_types
|
|
37
62
|
{
|
|
63
|
+
:'code' => :'String',
|
|
38
64
|
:'error' => :'String',
|
|
39
65
|
:'message' => :'String'
|
|
40
66
|
}
|
|
@@ -61,6 +87,10 @@ module OpenapiClient
|
|
|
61
87
|
h[k.to_sym] = v
|
|
62
88
|
}
|
|
63
89
|
|
|
90
|
+
if attributes.key?(:'code')
|
|
91
|
+
self.code = attributes[:'code']
|
|
92
|
+
end
|
|
93
|
+
|
|
64
94
|
if attributes.key?(:'error')
|
|
65
95
|
self.error = attributes[:'error']
|
|
66
96
|
else
|
|
@@ -94,16 +124,29 @@ module OpenapiClient
|
|
|
94
124
|
# @return true if the model is valid
|
|
95
125
|
def valid?
|
|
96
126
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
127
|
+
code_validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
128
|
+
return false unless code_validator.valid?(@code)
|
|
97
129
|
return false if @error.nil?
|
|
98
130
|
return false if @message.nil?
|
|
99
131
|
true
|
|
100
132
|
end
|
|
101
133
|
|
|
134
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
135
|
+
# @param [Object] code Object to be assigned
|
|
136
|
+
def code=(code)
|
|
137
|
+
validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
138
|
+
unless validator.valid?(code)
|
|
139
|
+
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
140
|
+
end
|
|
141
|
+
@code = code
|
|
142
|
+
end
|
|
143
|
+
|
|
102
144
|
# Checks equality by comparing each attribute.
|
|
103
145
|
# @param [Object] Object to be compared
|
|
104
146
|
def ==(o)
|
|
105
147
|
return true if self.equal?(o)
|
|
106
148
|
self.class == o.class &&
|
|
149
|
+
code == o.code &&
|
|
107
150
|
error == o.error &&
|
|
108
151
|
message == o.message
|
|
109
152
|
end
|
|
@@ -117,7 +160,7 @@ module OpenapiClient
|
|
|
117
160
|
# Calculates hash code according to all attributes.
|
|
118
161
|
# @return [Integer] Hash code
|
|
119
162
|
def hash
|
|
120
|
-
[error, message].hash
|
|
163
|
+
[code, error, message].hash
|
|
121
164
|
end
|
|
122
165
|
|
|
123
166
|
# Builds the object from hash
|
|
@@ -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, alert, 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, timer, and value 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
|
|
|
@@ -29,7 +29,7 @@ module OpenapiClient
|
|
|
29
29
|
# Use for progress. Takes precedence over value/upper_limit if both are provided.
|
|
30
30
|
attr_accessor :percentage
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit.
|
|
33
33
|
attr_accessor :value
|
|
34
34
|
|
|
35
35
|
# Maximum progress value. Use with value for progress.
|
|
@@ -47,7 +47,7 @@ module OpenapiClient
|
|
|
47
47
|
# Required on the first PUT or whenever the stream cannot infer the current activity type.
|
|
48
48
|
attr_accessor :type
|
|
49
49
|
|
|
50
|
-
# Optional. Accent color for progress, segmented_progress, metrics, and
|
|
50
|
+
# Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
|
|
51
51
|
attr_accessor :color
|
|
52
52
|
|
|
53
53
|
# Optional. Overrides color for the current step. Only applies to segmented_progress.
|
|
@@ -62,10 +62,10 @@ module OpenapiClient
|
|
|
62
62
|
# Required for type=alert.
|
|
63
63
|
attr_accessor :message
|
|
64
64
|
|
|
65
|
-
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and
|
|
65
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
|
|
66
66
|
attr_accessor :icon
|
|
67
67
|
|
|
68
|
-
# Optional badge. Supported by alert, progress, and
|
|
68
|
+
# Optional badge. Supported by alert, progress, segmented_progress, and value.
|
|
69
69
|
attr_accessor :badge
|
|
70
70
|
|
|
71
71
|
# Optional. Seconds before the ended Live Activity is dismissed.
|
|
@@ -135,7 +135,7 @@ module OpenapiClient
|
|
|
135
135
|
:'number_of_steps' => :'Integer',
|
|
136
136
|
:'current_step' => :'Integer',
|
|
137
137
|
:'percentage' => :'Float',
|
|
138
|
-
:'value' => :'
|
|
138
|
+
:'value' => :'LiveActivityValue',
|
|
139
139
|
:'upper_limit' => :'Float',
|
|
140
140
|
:'duration_seconds' => :'Float',
|
|
141
141
|
:'counts_down' => :'Boolean',
|
|
@@ -322,7 +322,7 @@ module OpenapiClient
|
|
|
322
322
|
return false if !@current_step.nil? && @current_step < 0
|
|
323
323
|
return false if !@percentage.nil? && @percentage > 100
|
|
324
324
|
return false if !@percentage.nil? && @percentage < 0
|
|
325
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
325
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
326
326
|
return false unless type_validator.valid?(@type)
|
|
327
327
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
|
|
328
328
|
return false unless color_validator.valid?(@color)
|
|
@@ -385,7 +385,7 @@ module OpenapiClient
|
|
|
385
385
|
# Custom attribute writer method checking allowed values (enum).
|
|
386
386
|
# @param [Object] type Object to be assigned
|
|
387
387
|
def type=(type)
|
|
388
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
388
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
389
389
|
unless validator.valid?(type)
|
|
390
390
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
391
391
|
end
|
|
@@ -45,6 +45,7 @@ require 'activitysmith_openapi/models/live_activity_stream_put_response'
|
|
|
45
45
|
require 'activitysmith_openapi/models/live_activity_stream_request'
|
|
46
46
|
require 'activitysmith_openapi/models/live_activity_update_request'
|
|
47
47
|
require 'activitysmith_openapi/models/live_activity_update_response'
|
|
48
|
+
require 'activitysmith_openapi/models/live_activity_value'
|
|
48
49
|
require 'activitysmith_openapi/models/live_activity_webhook_method'
|
|
49
50
|
require 'activitysmith_openapi/models/metadata_value'
|
|
50
51
|
require 'activitysmith_openapi/models/metric_error'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "ActivitySmithHQ/activitysmith-backend",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "6832df646de7de8a6aaf0110960c37074b513c48",
|
|
4
4
|
"path": "openapi.json",
|
|
5
|
-
"sha256": "
|
|
5
|
+
"sha256": "9ae85ad6127cfa2d50c33261459f5f9e85e011939d01ac4a9d507fa6ed11aa61"
|
|
6
6
|
}
|
|
@@ -8,6 +8,7 @@ module ActivitySmith
|
|
|
8
8
|
TYPE_STATS = "stats"
|
|
9
9
|
TYPE_ALERT = "alert"
|
|
10
10
|
TYPE_TIMER = "timer"
|
|
11
|
+
TYPE_VALUE = "value"
|
|
11
12
|
|
|
12
13
|
class << self
|
|
13
14
|
def content_state(title:, type: nil, subtitle: nil, message: nil, icon: nil, badge: nil, color: nil, duration_seconds: nil, counts_down: nil, **fields)
|
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.12.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-09-
|
|
11
|
+
date: 2026-09-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -111,6 +111,7 @@ files:
|
|
|
111
111
|
- generated/activitysmith_openapi/models/live_activity_stream_request.rb
|
|
112
112
|
- generated/activitysmith_openapi/models/live_activity_update_request.rb
|
|
113
113
|
- generated/activitysmith_openapi/models/live_activity_update_response.rb
|
|
114
|
+
- generated/activitysmith_openapi/models/live_activity_value.rb
|
|
114
115
|
- generated/activitysmith_openapi/models/live_activity_webhook_method.rb
|
|
115
116
|
- generated/activitysmith_openapi/models/metadata_value.rb
|
|
116
117
|
- generated/activitysmith_openapi/models/metric_error.rb
|