activitysmith 1.14.0 → 1.16.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +130 -12
  3. data/generated/activitysmith_openapi/api/app_icon_badges_api.rb +4 -4
  4. data/generated/activitysmith_openapi/api/devices_api.rb +100 -0
  5. data/generated/activitysmith_openapi/api/live_activities_api.rb +4 -4
  6. data/generated/activitysmith_openapi/api/metrics_api.rb +87 -4
  7. data/generated/activitysmith_openapi/api/push_notifications_api.rb +67 -0
  8. data/generated/activitysmith_openapi/models/account_device.rb +367 -0
  9. data/generated/activitysmith_openapi/models/account_device_list_response.rb +239 -0
  10. data/generated/activitysmith_openapi/models/account_device_list_response_meta.rb +299 -0
  11. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +1 -1
  12. data/generated/activitysmith_openapi/models/content_state_start.rb +24 -3
  13. data/generated/activitysmith_openapi/models/content_state_update.rb +23 -2
  14. data/generated/activitysmith_openapi/models/live_activity_end_request.rb +42 -4
  15. data/generated/activitysmith_openapi/models/live_activity_start_request.rb +42 -4
  16. data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +42 -4
  17. data/generated/activitysmith_openapi/models/live_activity_stream_delete_response.rb +12 -1
  18. data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +42 -4
  19. data/generated/activitysmith_openapi/models/live_activity_update_request.rb +42 -4
  20. data/generated/activitysmith_openapi/models/metric.rb +411 -0
  21. data/generated/activitysmith_openapi/models/metric_response.rb +221 -0
  22. data/generated/activitysmith_openapi/models/metric_upsert_request.rb +370 -0
  23. data/generated/activitysmith_openapi/models/metric_value_update_response.rb +14 -4
  24. data/generated/activitysmith_openapi/models/no_recipients_error.rb +21 -1
  25. data/generated/activitysmith_openapi/models/push_notification_action.rb +1 -1
  26. data/generated/activitysmith_openapi/models/push_notification_dismiss_response.rb +257 -0
  27. data/generated/activitysmith_openapi/models/push_notification_replace_request.rb +1 -1
  28. data/generated/activitysmith_openapi/models/push_notification_request.rb +30 -1
  29. data/generated/activitysmith_openapi/models/stream_content_state.rb +24 -3
  30. data/generated/activitysmith_openapi/version.rb +1 -1
  31. data/generated/activitysmith_openapi.rb +8 -0
  32. data/generated/openapi-source.json +2 -2
  33. data/lib/activitysmith/client.rb +3 -1
  34. data/lib/activitysmith/devices.rb +30 -0
  35. data/lib/activitysmith/metrics.rb +15 -1
  36. data/lib/activitysmith/notifications.rb +11 -0
  37. data/lib/activitysmith/version.rb +1 -1
  38. data/lib/activitysmith.rb +1 -0
  39. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2ee0516e542f1c17496efa764ce0c069b86d2252c477b9627844324bbbb5dbc
4
- data.tar.gz: 5d819aaac4d797aa055dee752a93a30d22014470ed3b8da62dc16144554650be
3
+ metadata.gz: 847a7358606e055a340575251f75cb645d7608c17a5186653024be6208df41bc
4
+ data.tar.gz: 8ec8a64892be880476a14ce17e77d4381ca35ee5174a935fe8605fc075268c1f
5
5
  SHA512:
6
- metadata.gz: 40b1fc816fb5ec2ab730e145c005a53543477d24d519b06b4666b574b94e5948bf4b66c6dea72669cbd3386a4f4490faa1831873d4034754a17619139845e145
7
- data.tar.gz: a9e93c08d13d6f33ac83aa6ad2b185af99d981a9e35b08e81bc3a4751434312f2a51b13f1d6582008ecb75ac036382805a06f91d5d1718073e07b45c603dba7a
6
+ metadata.gz: 0f60325e034b85d8a5d921099ba0e0755738d5b495223bf91e6c3c6bb4ed59fc538ef87e9971cab21006e54ac31d9bba4bfedd8addf8cb277bff64fc08856a5e
7
+ data.tar.gz: 285c44d33d021653406b401a795b40acd0e7eacf571417133f3bd265fa2745a566fd29ca6ef07768aca163cc63329993262c733d5ebcf12552d6e8fea96f0faf
data/README.md CHANGED
@@ -44,14 +44,14 @@ activitysmith.notifications.send(
44
44
 
45
45
  ![Push Notifications with custom icons](https://cdn.activitysmith.com/features/push-notifications-with-custom-icons.png)
46
46
 
47
- Set `icon` to a publicly accessible HTTPS image URL to show a logo or avatar alongside a smaller ActivitySmith app icon. With a custom icon, iOS may omit the subtitle from the notification.
47
+ Set `icon` to a publicly accessible HTTPS image URL to show a logo or avatar alongside a smaller ActivitySmith app icon. Host the image anywhere, such as on your own website or CDN. With a custom icon, iOS may omit the subtitle from the notification.
48
48
 
49
49
  ```ruby
50
50
  activitysmith.notifications.send(
51
51
  {
52
52
  title: "MRR just crossed $10,000 🎉",
53
53
  message: "Up 18% this month from 31 new subscriptions.",
54
- icon: "https://cdn.activitysmith.com/integrations/icons/stripe.png"
54
+ icon: "https://example.com/icons/stripe.png"
55
55
  }
56
56
  )
57
57
  ```
@@ -152,7 +152,7 @@ activitysmith.notifications.send(
152
152
  )
153
153
  ```
154
154
 
155
- ### Push Notification Interruption Levels
155
+ ### Interruption Levels
156
156
 
157
157
  ![Time Sensitive Push Notification](https://cdn.activitysmith.com/features/time-sensitive-push-notifications.png)
158
158
 
@@ -206,6 +206,28 @@ activitysmith.notifications.send(
206
206
  )
207
207
  ```
208
208
 
209
+ ### Push Notification Sounds
210
+
211
+ Use `sound` to choose the sound a Push Notification plays. Omit it to play the Push Notifications sound picked in the ActivitySmith app under Settings > Sounds.
212
+
213
+ | Value | Behavior |
214
+ | --- | --- |
215
+ | `default` | Plays the sound picked on the device. This is the same as omitting `sound`. |
216
+ | `none` | Plays no sound. |
217
+ | A sound name | Plays one of the sounds bundled with the app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, or `zip`. |
218
+
219
+ Passive Push Notifications play no sound.
220
+
221
+ ```ruby
222
+ activitysmith.notifications.send(
223
+ {
224
+ title: "💸 New sale",
225
+ message: "Pro plan, $29/month",
226
+ sound: "coin"
227
+ }
228
+ )
229
+ ```
230
+
209
231
  ### Replace a Push Notification
210
232
 
211
233
  Every send returns a `notification_id`. Pass it to `replace` to update a Push Notification you already sent, for example when an incident you alerted on is resolved. The replacement takes the old notification's place on the Lock Screen and in history instead of stacking a second one. It arrives silently, without sound or waking the screen, and goes to the same recipients as the original.
@@ -229,6 +251,25 @@ activitysmith.notifications.replace(
229
251
  )
230
252
  ```
231
253
 
254
+ ### Dismiss a Push Notification
255
+
256
+ Pass the `notification_id` to `dismiss` when a Push Notification no longer needs attention, for example after you answered an agent's question somewhere else.
257
+
258
+ Dismissing clears it from the Lock Screen and Notification Center on every device it was sent to. History keeps it.
259
+
260
+ Devices clear the notification in the background, so it can take a moment.
261
+
262
+ ```ruby
263
+ sent = activitysmith.notifications.send(
264
+ {
265
+ title: "🙋 Agent needs your input",
266
+ message: "Approve the database migration?"
267
+ }
268
+ )
269
+
270
+ activitysmith.notifications.dismiss(sent.notification_id)
271
+ ```
272
+
232
273
  ## Live Activities
233
274
 
234
275
  Choose the Live Activity type that matches what you want to show:
@@ -415,6 +456,23 @@ For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `c
415
456
 
416
457
  To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`.
417
458
 
459
+ To count down to a set time, send `timer_end_at` instead of `duration_seconds`. If the timer started earlier, also send `timer_start_at`. The progress bar then shows the time already gone.
460
+
461
+ ```ruby
462
+ activitysmith.live_activities.stream(
463
+ "nightly-backup",
464
+ {
465
+ content_state: {
466
+ title: "Nightly Backup",
467
+ subtitle: "uploading archive",
468
+ type: "timer",
469
+ timer_start_at: "2026-11-19T01:00:00Z",
470
+ timer_end_at: "2026-11-19T02:00:00Z"
471
+ }
472
+ }
473
+ )
474
+ ```
475
+
418
476
  ### End Live Activity
419
477
 
420
478
  Call `end_stream(...)` with the same `stream_key` to dismiss the Live Activity. You can include final values before it is removed. Set `auto_dismiss_seconds` to dismiss it after a delay in seconds, or `auto_dismiss_minutes` for minutes. Use `0` for immediate dismissal. Seconds take precedence if both are set.
@@ -492,13 +550,13 @@ activitysmith.live_activities.stream(
492
550
  )
493
551
  ```
494
552
 
495
- ### Live Activity Colors
553
+ ### Colors
496
554
 
497
555
  Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge:
498
556
 
499
557
  `lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`
500
558
 
501
- ### Live Activity Action
559
+ ### Actions
502
560
 
503
561
  ![Metrics Live Activity with action](https://cdn.activitysmith.com/features/metrics-live-activity-action.png)
504
562
 
@@ -631,15 +689,34 @@ activitysmith.live_activities.stream(
631
689
  )
632
690
  ```
633
691
 
692
+ ### Live Activity Sounds
693
+
694
+ Starting a Live Activity plays the Live Activities sound picked in the ActivitySmith app. Updates and ends are silent. Set `sound` on a start, update, or end to choose its sound, with the same values as [Push Notification Sounds](#push-notification-sounds). A sound on an update or end also expands the Live Activity on the Lock Screen, so use it for moments that need attention, such as a failed step.
695
+
696
+ ```ruby
697
+ activitysmith.live_activities.stream(
698
+ "deploy-api",
699
+ {
700
+ content_state: {
701
+ title: "Deploying API",
702
+ subtitle: "Step 3 failed",
703
+ type: "segmented_progress",
704
+ number_of_steps: 4,
705
+ current_step: 3,
706
+ color: "red"
707
+ },
708
+ sound: "glitch"
709
+ }
710
+ )
711
+ ```
712
+
634
713
  ## Lock Screen Widgets
635
714
 
636
715
  ![Lock screen widgets](https://cdn.activitysmith.com/features/lock-screen-widgets.png)
637
716
 
638
- ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the [web app](https://activitysmith.com/app/widgets), then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically.
717
+ ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Send a value to a metric key, add a widget to your Lock Screen, and it fetches the latest value automatically.
639
718
 
640
- ![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png)
641
-
642
- Use the metric key to update its value.
719
+ Use the metric key to update its value. The first value creates the metric.
643
720
 
644
721
  ```ruby
645
722
  activitysmith.metrics.update("deploy.success_rate", 99.9)
@@ -651,12 +728,33 @@ String metric values work too.
651
728
  activitysmith.metrics.update("prod.status", "healthy")
652
729
  ```
653
730
 
654
- ## App Icon Badge Count
731
+ ### Create a metric
732
+
733
+ Use `create` to set the label and how widgets show the value, such as currency, percent, or a unit. Omitted fields keep their current values, so you can call it every time your app starts.
655
734
 
656
- ![ActivitySmith app icon with an App Icon Badge Count](https://cdn.activitysmith.com/features/badge-count.png)
735
+ ```ruby
736
+ activitysmith.metrics.create(
737
+ "mrr",
738
+ label: "MRR",
739
+ format: "currency",
740
+ currency_code: "USD"
741
+ )
742
+
743
+ activitysmith.metrics.update("mrr", 12450)
744
+ ```
745
+
746
+ You can also create and edit metrics in the [web app](https://activitysmith.com/app/widgets).
747
+
748
+ ![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png)
749
+
750
+ ## App Icon Badge
751
+
752
+ ![ActivitySmith app icon with an App Icon Badge](https://cdn.activitysmith.com/features/badge-count.png)
657
753
 
658
754
  Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view.
659
755
 
756
+ App Icon Badge requires Push Notifications enabled. On your iPhone, open Settings > ActivitySmith > Notifications and turn on Allow Notifications.
757
+
660
758
  ### Set or update the badge value
661
759
 
662
760
  ```ruby
@@ -729,7 +827,7 @@ activitysmith.live_activities.update(
729
827
 
730
828
  ## Channels
731
829
 
732
- Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery.
830
+ Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge updates. Omit it for account-wide delivery.
733
831
 
734
832
  ```ruby
735
833
  activitysmith.notifications.send(
@@ -756,6 +854,26 @@ activitysmith.live_activities.stream(
756
854
  activitysmith.badge_count(3, channels: ["sales", "customer-success"])
757
855
  ```
758
856
 
857
+ ## Paired Devices
858
+
859
+ List the iPhones and iPads paired to your account, for example to check that a device is paired before you send. Active devices come first:
860
+
861
+ ```ruby
862
+ result = activitysmith.devices.list
863
+
864
+ result.devices.each do |device|
865
+ puts [device.device_name, device.system_name, device.is_active].join(" ")
866
+ end
867
+ ```
868
+
869
+ An empty list means no device is paired. Install ActivitySmith on your iPhone, sign in with the same account, and allow notifications. Channel-scoped API keys cannot list devices.
870
+
871
+ Pass `include_inactive` to also list devices that can no longer receive deliveries:
872
+
873
+ ```ruby
874
+ activitysmith.devices.list(include_inactive: true)
875
+ ```
876
+
759
877
  ## Error Handling
760
878
 
761
879
  Handle API errors with `begin/rescue` around SDK calls:
@@ -19,8 +19,8 @@ module OpenapiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Set App Icon Badge Count
23
- # Shows a number on the ActivitySmith app icon.
22
+ # Set App Icon Badge
23
+ # Shows a number on the ActivitySmith app icon. Requires Push Notifications enabled for ActivitySmith on the device.
24
24
  # @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [AppIconBadgeCountUpdateResponse]
@@ -29,8 +29,8 @@ module OpenapiClient
29
29
  data
30
30
  end
31
31
 
32
- # Set App Icon Badge Count
33
- # Shows a number on the ActivitySmith app icon.
32
+ # Set App Icon Badge
33
+ # Shows a number on the ActivitySmith app icon. Requires Push Notifications enabled for ActivitySmith on the device.
34
34
  # @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(AppIconBadgeCountUpdateResponse, Integer, Hash)>] AppIconBadgeCountUpdateResponse data, response status code and response headers
@@ -0,0 +1,100 @@
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 'cgi'
14
+
15
+ module OpenapiClient
16
+ class DevicesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List paired devices
23
+ # Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [Integer] :limit Maximum devices to return, 1 to 100. Defaults to 100. (default to 100)
26
+ # @option opts [Integer] :offset Devices to skip. Use meta.next_offset from the previous page. (default to 0)
27
+ # @option opts [Boolean] :include_inactive Include devices that can no longer receive deliveries, such as unpaired phones. (default to false)
28
+ # @return [AccountDeviceListResponse]
29
+ def list_account_devices(opts = {})
30
+ data, _status_code, _headers = list_account_devices_with_http_info(opts)
31
+ data
32
+ end
33
+
34
+ # List paired devices
35
+ # Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [Integer] :limit Maximum devices to return, 1 to 100. Defaults to 100. (default to 100)
38
+ # @option opts [Integer] :offset Devices to skip. Use meta.next_offset from the previous page. (default to 0)
39
+ # @option opts [Boolean] :include_inactive Include devices that can no longer receive deliveries, such as unpaired phones. (default to false)
40
+ # @return [Array<(AccountDeviceListResponse, Integer, Hash)>] AccountDeviceListResponse data, response status code and response headers
41
+ def list_account_devices_with_http_info(opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: DevicesApi.list_account_devices ...'
44
+ end
45
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
46
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DevicesApi.list_account_devices, must be smaller than or equal to 100.'
47
+ end
48
+
49
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
50
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DevicesApi.list_account_devices, must be greater than or equal to 1.'
51
+ end
52
+
53
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
54
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DevicesApi.list_account_devices, must be greater than or equal to 0.'
55
+ end
56
+
57
+ # resource path
58
+ local_var_path = '/account/devices'
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
63
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
64
+ query_params[:'include_inactive'] = opts[:'include_inactive'] if !opts[:'include_inactive'].nil?
65
+
66
+ # header parameters
67
+ header_params = opts[:header_params] || {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body]
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'AccountDeviceListResponse'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"DevicesApi.list_account_devices",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: DevicesApi#list_account_devices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+ end
100
+ end
@@ -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, 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.
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. Ending a Live Activity that already ended returns 200 with ignored: true and sends nothing to devices, so retries are safe.
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, 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.
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. Ending a Live Activity that already ended returns 200 with ignored: true and sends nothing to devices, so retries are safe.
34
34
  # @param live_activity_end_request [LiveActivityEndRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers
@@ -167,7 +167,7 @@ module OpenapiClient
167
167
  end
168
168
 
169
169
  # Start a new Live Activity or update an existing one
170
- # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. 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.
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, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them 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, 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.
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, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them 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
@@ -20,8 +20,8 @@ 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. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
24
- # @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
23
+ # Updates the latest value for a metric displayed in ActivitySmith widgets. If no metric uses the key yet, the first value creates one: the label comes from the key, numeric values get the number format, and text values get the string format. To choose a currency, percent, or unit format, create the metric first with PUT /metrics/{key} or in the web app. A deleted metric is not recreated by new values; the request returns 404 with code metric_deleted. Each account can have up to 100 metrics created through the API. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
24
+ # @param key [String] Metric key. A key that has never been used creates the metric. 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
27
27
  # @return [MetricValueUpdateResponse]
@@ -31,8 +31,8 @@ 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. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
35
- # @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
34
+ # Updates the latest value for a metric displayed in ActivitySmith widgets. If no metric uses the key yet, the first value creates one: the label comes from the key, numeric values get the number format, and text values get the string format. To choose a currency, percent, or unit format, create the metric first with PUT /metrics/{key} or in the web app. A deleted metric is not recreated by new values; the request returns 404 with code metric_deleted. Each account can have up to 100 metrics created through the API. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
35
+ # @param key [String] Metric key. A key that has never been used creates the metric. 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
38
38
  # @return [Array<(MetricValueUpdateResponse, Integer, Hash)>] MetricValueUpdateResponse data, response status code and response headers
@@ -105,5 +105,88 @@ module OpenapiClient
105
105
  end
106
106
  return data, status_code, headers
107
107
  end
108
+
109
+ # Create or update a widget metric
110
+ # Creates a metric for widgets, or updates the fields sent for an existing metric. Omitted fields keep their current values, so repeating the same request does not change the metric. Changing between the string format and a numeric format clears the latest value. Shares the metric account allowance of 300 requests per minute and is not a billable metric update.
111
+ # @param key [String] Metric key. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
112
+ # @param [Hash] opts the optional parameters
113
+ # @option opts [MetricUpsertRequest] :metric_upsert_request
114
+ # @return [MetricResponse]
115
+ def upsert_metric(key, opts = {})
116
+ data, _status_code, _headers = upsert_metric_with_http_info(key, opts)
117
+ data
118
+ end
119
+
120
+ # Create or update a widget metric
121
+ # Creates a metric for widgets, or updates the fields sent for an existing metric. Omitted fields keep their current values, so repeating the same request does not change the metric. Changing between the string format and a numeric format clears the latest value. Shares the metric account allowance of 300 requests per minute and is not a billable metric update.
122
+ # @param key [String] Metric key. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
123
+ # @param [Hash] opts the optional parameters
124
+ # @option opts [MetricUpsertRequest] :metric_upsert_request
125
+ # @return [Array<(MetricResponse, Integer, Hash)>] MetricResponse data, response status code and response headers
126
+ def upsert_metric_with_http_info(key, opts = {})
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug 'Calling API: MetricsApi.upsert_metric ...'
129
+ end
130
+ # verify the required parameter 'key' is set
131
+ if @api_client.config.client_side_validation && key.nil?
132
+ fail ArgumentError, "Missing the required parameter 'key' when calling MetricsApi.upsert_metric"
133
+ end
134
+ if @api_client.config.client_side_validation && key.to_s.length > 64
135
+ fail ArgumentError, 'invalid value for "key" when calling MetricsApi.upsert_metric, the character length must be smaller than or equal to 64.'
136
+ end
137
+
138
+ if @api_client.config.client_side_validation && key.to_s.length < 1
139
+ fail ArgumentError, 'invalid value for "key" when calling MetricsApi.upsert_metric, the character length must be great than or equal to 1.'
140
+ end
141
+
142
+ pattern = Regexp.new(/^[a-z0-9][a-z0-9_.-]{0,63}$/)
143
+ if @api_client.config.client_side_validation && key !~ pattern
144
+ fail ArgumentError, "invalid value for 'key' when calling MetricsApi.upsert_metric, must conform to the pattern #{pattern}."
145
+ end
146
+
147
+ # resource path
148
+ local_var_path = '/metrics/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
149
+
150
+ # query parameters
151
+ query_params = opts[:query_params] || {}
152
+
153
+ # header parameters
154
+ header_params = opts[:header_params] || {}
155
+ # HTTP header 'Accept' (if needed)
156
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
157
+ # HTTP header 'Content-Type'
158
+ content_type = @api_client.select_header_content_type(['application/json'])
159
+ if !content_type.nil?
160
+ header_params['Content-Type'] = content_type
161
+ end
162
+
163
+ # form parameters
164
+ form_params = opts[:form_params] || {}
165
+
166
+ # http body (model)
167
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'metric_upsert_request'])
168
+
169
+ # return_type
170
+ return_type = opts[:debug_return_type] || 'MetricResponse'
171
+
172
+ # auth_names
173
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
174
+
175
+ new_options = opts.merge(
176
+ :operation => :"MetricsApi.upsert_metric",
177
+ :header_params => header_params,
178
+ :query_params => query_params,
179
+ :form_params => form_params,
180
+ :body => post_body,
181
+ :auth_names => auth_names,
182
+ :return_type => return_type
183
+ )
184
+
185
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug "API called: MetricsApi#upsert_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
188
+ end
189
+ return data, status_code, headers
190
+ end
108
191
  end
109
192
  end
@@ -19,6 +19,73 @@ module OpenapiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Dismiss a push notification
23
+ # Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
24
+ # @param notification_id [String] The &#x60;notification_id&#x60; returned when the Push Notification was sent.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [PushNotificationDismissResponse]
27
+ def dismiss_push_notification(notification_id, opts = {})
28
+ data, _status_code, _headers = dismiss_push_notification_with_http_info(notification_id, opts)
29
+ data
30
+ end
31
+
32
+ # Dismiss a push notification
33
+ # Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the &#x60;notification_id&#x60; from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
34
+ # @param notification_id [String] The &#x60;notification_id&#x60; returned when the Push Notification was sent.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(PushNotificationDismissResponse, Integer, Hash)>] PushNotificationDismissResponse data, response status code and response headers
37
+ def dismiss_push_notification_with_http_info(notification_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: PushNotificationsApi.dismiss_push_notification ...'
40
+ end
41
+ # verify the required parameter 'notification_id' is set
42
+ if @api_client.config.client_side_validation && notification_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling PushNotificationsApi.dismiss_push_notification"
44
+ end
45
+ if @api_client.config.client_side_validation && notification_id.to_s.length < 1
46
+ fail ArgumentError, 'invalid value for "notification_id" when calling PushNotificationsApi.dismiss_push_notification, the character length must be great than or equal to 1.'
47
+ end
48
+
49
+ # resource path
50
+ local_var_path = '/push-notification/{notification_id}/dismiss'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body]
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'PushNotificationDismissResponse'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"PushNotificationsApi.dismiss_push_notification",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: PushNotificationsApi#dismiss_push_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
22
89
  # Replace a push notification
23
90
  # Replaces a Push Notification you already sent, using the `notification_id` from the send response. The replacement takes the original's place on the Lock Screen and in Notification Center instead of appearing as a second notification. It is delivered silently, with no sound or screen wake, to the same recipients as the original. Notification history is updated in place.
24
91
  # @param notification_id [String] The &#x60;notification_id&#x60; returned when the Push Notification was sent.