activitysmith 1.11.0 → 1.13.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +126 -26
  3. data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
  4. data/generated/activitysmith_openapi/api/metrics_api.rb +2 -2
  5. data/generated/activitysmith_openapi/api/push_notifications_api.rb +2 -2
  6. data/generated/activitysmith_openapi/models/billing_blocked_error.rb +296 -0
  7. data/generated/activitysmith_openapi/models/billing_blocked_error_trial_period.rb +237 -0
  8. data/generated/activitysmith_openapi/models/content_state_end.rb +8 -8
  9. data/generated/activitysmith_openapi/models/content_state_start.rb +8 -8
  10. data/generated/activitysmith_openapi/models/content_state_update.rb +8 -8
  11. data/generated/activitysmith_openapi/models/live_activity_action.rb +23 -1
  12. data/generated/activitysmith_openapi/models/live_activity_end_request.rb +1 -1
  13. data/generated/activitysmith_openapi/models/live_activity_start_request.rb +1 -1
  14. data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +1 -1
  15. data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +1 -1
  16. data/generated/activitysmith_openapi/models/live_activity_update_request.rb +1 -1
  17. data/generated/activitysmith_openapi/models/live_activity_value.rb +106 -0
  18. data/generated/activitysmith_openapi/models/push_interruption_level.rb +41 -0
  19. data/generated/activitysmith_openapi/models/push_notification_action.rb +22 -0
  20. data/generated/activitysmith_openapi/models/push_notification_request.rb +64 -1
  21. data/generated/activitysmith_openapi/models/push_notification_response.rb +3 -0
  22. data/generated/activitysmith_openapi/models/rate_limit_error.rb +44 -1
  23. data/generated/activitysmith_openapi/models/stream_content_state.rb +8 -8
  24. data/generated/activitysmith_openapi/version.rb +1 -1
  25. data/generated/activitysmith_openapi.rb +4 -0
  26. data/generated/openapi-source.json +2 -2
  27. data/lib/activitysmith/live_activities.rb +1 -0
  28. data/lib/activitysmith/notifications.rb +10 -4
  29. data/lib/activitysmith/push_interruption_level.rb +10 -0
  30. data/lib/activitysmith/version.rb +1 -1
  31. data/lib/activitysmith.rb +1 -0
  32. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78045b903d77e729f7f1f1621cb4a0c4159a65a5f705b795308e68b346cf71e7
4
- data.tar.gz: 76e166849874ae4507c8d61681a23a4f2a24905f5da7a5c262026e6372816172
3
+ metadata.gz: a34b4cbdf040d39ac1a0ffbce791601bfb02037c65200e601c69cc3b25483014
4
+ data.tar.gz: 50c856c221b5027091facf351b5f29b5e95c57e0db869eaea87aad5d06b628eb
5
5
  SHA512:
6
- metadata.gz: b2dbf9b00b2f550e4dd1d44068d976bf907e2ad073101dc7c716bfcab2820e3f79bd392a7b30440afa45c93c4a18585fa0526108ede03d6c74bb3b5ffb80ff1b
7
- data.tar.gz: 3a245a380d53cfd2ae25d2a446750c7e4515181e5d458462041dab983c3b63effee54f467182e15ea4dfa23fdf8b2e869aab1b30745c14b47e3922816bc47d3b
6
+ metadata.gz: c7ae076e9a17173a9aca6901be21bf2d4b600a80fd2f897b646ac1ead519eccf001fc72adc69aebccdda471679a8d81606f0ab54e0ceb8e7931b420705ef72f5
7
+ data.tar.gz: fcf3e1e4d7fb15faa8fdfaeefe7062ecd16f94d60e1b737cdf2a1904911354c65db6a60c620aba8bc980dbabc80ae17310fde700b4b3b948bd40a19ff5aeb4a0
data/README.md CHANGED
@@ -40,6 +40,22 @@ activitysmith.notifications.send(
40
40
  )
41
41
  ```
42
42
 
43
+ ### Custom Push Notification Icons
44
+
45
+ ![Push Notifications with custom icons](https://cdn.activitysmith.com/features/push-notifications-with-custom-icons.png)
46
+
47
+ Set `icon` to a publicly accessible HTTPS image URL to show an avatar or service logo alongside a smaller ActivitySmith app icon. With a custom icon, iOS may omit the subtitle from the notification.
48
+
49
+ ```ruby
50
+ activitysmith.notifications.send(
51
+ {
52
+ title: "MRR just crossed $10,000 🎉",
53
+ message: "Up 18% this month from 31 new subscriptions.",
54
+ icon: "https://cdn.activitysmith.com/integrations/icons/stripe.png"
55
+ }
56
+ )
57
+ ```
58
+
43
59
  ### Rich Push Notifications with Media
44
60
 
45
61
  ![Rich Push Notification with image](https://cdn.activitysmith.com/features/rich-push-notification-with-image.png)
@@ -136,14 +152,76 @@ activitysmith.notifications.send(
136
152
  )
137
153
  ```
138
154
 
155
+ ### Push Notification Interruption Levels
156
+
157
+ ![Time Sensitive Push Notification](https://cdn.activitysmith.com/features/time-sensitive-push-notifications.png)
158
+
159
+ Use `interruption_level` to choose how urgently iOS presents a Push Notification. Omit it for normal delivery. Explicit `active` has the same behavior as the default.
160
+
161
+ | Value | Behavior |
162
+ | --- | --- |
163
+ | `passive` | Appears quietly in the notification list, without sound or waking the screen. |
164
+ | `active` | Normal delivery, subject to the device's notification settings and Focus. This is the default. |
165
+ | `time-sensitive` | Can bypass Scheduled Summary and Focus when the user allows Time Sensitive Notifications for ActivitySmith. |
166
+
167
+ See Apple's [interruption levels](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel) for the system behavior.
168
+
169
+ The SDK also exports these values as `ActivitySmith::PushInterruptionLevel::PASSIVE`, `ACTIVE`, and `TIME_SENSITIVE`.
170
+
171
+ #### Passive
172
+
173
+ ```ruby
174
+ activitysmith.notifications.send(
175
+ {
176
+ title: "Daily summary",
177
+ message: "All scheduled jobs completed successfully.",
178
+ interruption_level: "passive"
179
+ }
180
+ )
181
+ ```
182
+
183
+ #### Active (default)
184
+
185
+ ```ruby
186
+ activitysmith.notifications.send(
187
+ {
188
+ title: "Deployment complete",
189
+ message: "Your latest changes are live.",
190
+ interruption_level: "active"
191
+ }
192
+ )
193
+ ```
194
+
195
+ Removing the interruption level from this example produces the same delivery behavior.
196
+
197
+ #### Time Sensitive
198
+
199
+ ```ruby
200
+ activitysmith.notifications.send(
201
+ {
202
+ title: "🚨 checkout-api is down",
203
+ message: "500 errors on 62% of requests. Customers can't complete payments.",
204
+ interruption_level: "time-sensitive"
205
+ }
206
+ )
207
+ ```
208
+
139
209
  ## Live Activities
140
210
 
141
211
  Choose the Live Activity type that matches what you want to show:
142
212
 
213
+ ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png)
214
+
215
+ **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature.
216
+
143
217
  ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png)
144
218
 
145
219
  **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
146
220
 
221
+ ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png)
222
+
223
+ **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
224
+
147
225
  ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
148
226
 
149
227
  **Metrics**: Track two related values with segmented bars, such as CPU and memory.
@@ -156,10 +234,6 @@ Choose the Live Activity type that matches what you want to show:
156
234
 
157
235
  **Progress**: Show percentage progress for jobs that move continuously toward completion.
158
236
 
159
- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png)
160
-
161
- **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
162
-
163
237
  ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png)
164
238
 
165
239
  **Timer**: Count down from a duration, or count up from 00:00 while a job runs.
@@ -168,6 +242,28 @@ Choose the Live Activity type that matches what you want to show:
168
242
 
169
243
  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.
170
244
 
245
+ #### Value
246
+
247
+ ![Value Live Activity stream example](https://cdn.activitysmith.com/features/value-live-activity.png)
248
+
249
+ ```ruby
250
+ activitysmith.live_activities.stream(
251
+ "revenue-today",
252
+ {
253
+ content_state: {
254
+ title: "Revenue",
255
+ type: "value",
256
+ value: "$1,240",
257
+ color: "green",
258
+ icon: { symbol: "dollarsign.circle", color: "green" },
259
+ badge: { title: "↑ 18%", color: "purple" }
260
+ }
261
+ }
262
+ )
263
+ ```
264
+
265
+ Send a string or number in `value`. Strings keep their formatting, including currency symbols, units, and decimal places.
266
+
171
267
  #### Stats
172
268
 
173
269
  ![Stats Live Activity stream example](https://cdn.activitysmith.com/features/stats-live-activity.png)
@@ -193,6 +289,25 @@ activitysmith.live_activities.stream(
193
289
  )
194
290
  ```
195
291
 
292
+ #### Alert
293
+
294
+ ![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png)
295
+
296
+ ```ruby
297
+ activitysmith.live_activities.stream(
298
+ "customer-ops",
299
+ {
300
+ content_state: ActivitySmith::LiveActivities.content_state(
301
+ title: "Reactivation",
302
+ message: "Lumen came back after 2 weeks",
303
+ type: ActivitySmith::LiveActivities::TYPE_ALERT,
304
+ icon: ActivitySmith::LiveActivities.alert_icon("cloud.sun", color: "yellow"),
305
+ badge: ActivitySmith::LiveActivities.alert_badge("Customer", color: "magenta")
306
+ )
307
+ }
308
+ )
309
+ ```
310
+
196
311
  #### Metrics
197
312
 
198
313
  ![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
@@ -251,25 +366,6 @@ activitysmith.live_activities.stream(
251
366
  )
252
367
  ```
253
368
 
254
- #### Alert
255
-
256
- ![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png)
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
369
  #### Timer
274
370
 
275
371
  ![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png)
@@ -321,7 +417,7 @@ Add more context to Live Activities with icons and badges.
321
417
 
322
418
  #### Icon
323
419
 
324
- Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
420
+ Supported Live Activity types: `value`, `stats`, `alert`, `metrics`, `segmented_progress`, `progress`, and `timer`.
325
421
 
326
422
  ![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png)
327
423
 
@@ -351,7 +447,7 @@ The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one
351
447
 
352
448
  #### Badge
353
449
 
354
- Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities.
450
+ Badges are supported by `value`, `alert`, `segmented_progress`, and `progress` Live Activities.
355
451
 
356
452
  ![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png)
357
453
 
@@ -471,7 +567,7 @@ activitysmith.live_activities.stream(
471
567
 
472
568
  Use `secondary_action` when you want a second button beside the primary `action`.
473
569
 
474
- The secondary action button is supported for `alert`, `progress`, and `segmented_progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes.
570
+ 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
571
 
476
572
  ```ruby
477
573
  activitysmith.live_activities.stream(
@@ -653,3 +749,7 @@ end
653
749
  ### [RubyGems Package](https://rubygems.org/gems/activitysmith)
654
750
 
655
751
  Install the ActivitySmith Ruby SDK from RubyGems
752
+
753
+ ### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-ruby)
754
+
755
+ 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 timer 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, and segmented_progress Live Activities.
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 timer 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, and segmented_progress Live Activities.
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 segmented_progress Live Activities.
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 segmented_progress Live Activities.
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 segmented_progress 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.
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 segmented_progress 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.
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 timer 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, and segmented_progress Live Activities. Optional tags to organize and filter notification history.
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 timer 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, and segmented_progress Live Activities. Optional tags to organize and filter notification history.
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 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. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
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 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. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
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
@@ -20,7 +20,7 @@ module OpenapiClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Send a push notification
23
- # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history.
23
+ # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
24
24
  # @param push_notification_request [PushNotificationRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [PushNotificationResponse]
@@ -30,7 +30,7 @@ module OpenapiClient
30
30
  end
31
31
 
32
32
  # Send a push notification
33
- # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. &#x60;media&#x60; cannot be combined with &#x60;actions&#x60;. Optional tags to organize and filter notification history.
33
+ # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. &#x60;media&#x60; cannot be combined with &#x60;actions&#x60;. Optional &#x60;icon&#x60; shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional &#x60;interruption_level&#x60; sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
34
34
  # @param push_notification_request [PushNotificationRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(PushNotificationResponse, Integer, Hash)>] PushNotificationResponse data, response status code and response headers
@@ -0,0 +1,296 @@
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
+ class BillingBlockedError
18
+ attr_accessor :error
19
+
20
+ attr_accessor :message
21
+
22
+ attr_accessor :trial_period
23
+
24
+ attr_accessor :upgrade_url
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'error' => :'error',
52
+ :'message' => :'message',
53
+ :'trial_period' => :'trial_period',
54
+ :'upgrade_url' => :'upgrade_url'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'error' => :'String',
67
+ :'message' => :'String',
68
+ :'trial_period' => :'BillingBlockedErrorTrialPeriod',
69
+ :'upgrade_url' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::BillingBlockedError` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::BillingBlockedError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'error')
95
+ self.error = attributes[:'error']
96
+ else
97
+ self.error = nil
98
+ end
99
+
100
+ if attributes.key?(:'message')
101
+ self.message = attributes[:'message']
102
+ else
103
+ self.message = nil
104
+ end
105
+
106
+ if attributes.key?(:'trial_period')
107
+ self.trial_period = attributes[:'trial_period']
108
+ end
109
+
110
+ if attributes.key?(:'upgrade_url')
111
+ self.upgrade_url = attributes[:'upgrade_url']
112
+ else
113
+ self.upgrade_url = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @error.nil?
123
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
124
+ end
125
+
126
+ if @message.nil?
127
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
128
+ end
129
+
130
+ if @upgrade_url.nil?
131
+ invalid_properties.push('invalid value for "upgrade_url", upgrade_url cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @error.nil?
142
+ error_validator = EnumAttributeValidator.new('String', ["trial_expired", "trial_exhausted", "billing_overage_cap_reached"])
143
+ return false unless error_validator.valid?(@error)
144
+ return false if @message.nil?
145
+ return false if @upgrade_url.nil?
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method checking allowed values (enum).
150
+ # @param [Object] error Object to be assigned
151
+ def error=(error)
152
+ validator = EnumAttributeValidator.new('String', ["trial_expired", "trial_exhausted", "billing_overage_cap_reached"])
153
+ unless validator.valid?(error)
154
+ fail ArgumentError, "invalid value for \"error\", must be one of #{validator.allowable_values}."
155
+ end
156
+ @error = error
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ error == o.error &&
165
+ message == o.message &&
166
+ trial_period == o.trial_period &&
167
+ upgrade_url == o.upgrade_url
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [error, message, trial_period, upgrade_url].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ transformed_hash = {}
189
+ openapi_types.each_pair do |key, type|
190
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = nil
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[attribute_map[key]].is_a?(Array)
196
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
+ end
198
+ elsif !attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
+ end
201
+ end
202
+ new(transformed_hash)
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def self._deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = OpenapiClient.const_get(type)
244
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ end