activitysmith 1.8.0 → 1.10.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 (25) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +75 -15
  3. data/generated/activitysmith_openapi/api/app_icon_badges_api.rb +90 -0
  4. data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
  5. data/generated/activitysmith_openapi/api/push_notifications_api.rb +2 -2
  6. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_request.rb +259 -0
  7. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +331 -0
  8. data/generated/activitysmith_openapi/models/live_activity_action.rb +3 -5
  9. data/generated/activitysmith_openapi/models/live_activity_end_request.rb +1 -1
  10. data/generated/activitysmith_openapi/models/live_activity_start_request.rb +17 -5
  11. data/generated/activitysmith_openapi/models/live_activity_start_response.rb +13 -1
  12. data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +1 -1
  13. data/generated/activitysmith_openapi/models/live_activity_stream_put_response.rb +13 -1
  14. data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +17 -5
  15. data/generated/activitysmith_openapi/models/live_activity_update_request.rb +1 -1
  16. data/generated/activitysmith_openapi/models/push_notification_action.rb +3 -5
  17. data/generated/activitysmith_openapi/models/push_notification_request.rb +22 -12
  18. data/generated/activitysmith_openapi/models/push_notification_response.rb +13 -1
  19. data/generated/activitysmith_openapi/version.rb +1 -1
  20. data/generated/activitysmith_openapi.rb +3 -0
  21. data/lib/activitysmith/client.rb +15 -1
  22. data/lib/activitysmith/live_activities.rb +30 -8
  23. data/lib/activitysmith/notifications.rb +19 -4
  24. data/lib/activitysmith/version.rb +1 -1
  25. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 997a69d88cda72ef415a4774c5af354d531b9d3b9b1cae31dad5393899042a90
4
- data.tar.gz: 41399899c3a8c9ff1854c39e69370d1fe21047beac360871f41ed5529cd80bfa
3
+ metadata.gz: 56e1c73a642c093215a09fe5e57aa7a5e33a5e6f7bfdce44e11ea731c36ec9e5
4
+ data.tar.gz: 0421b3c7ea2f1bc8d7b49de0d8b6eb9dfddc209161eebff46c4bc567cc65d90d
5
5
  SHA512:
6
- metadata.gz: 24f59510621de8d861c99e908091784a6b8a8f025324bf26d17e031e9e79145438320399239cf3e5cb0b8c8b6895e3f42b2950deecc3930044d6fd6d3517514a
7
- data.tar.gz: dfa17c2e1038bf9248dd25ab6f7472319301dd784f4e52c0fe866f6342428947b860492fa2146b9548c9b3045ab22e508cb9c3a1a0f51d0f3ff816e07eba22c6
6
+ metadata.gz: 93deb0d9008171575a0bbaaa8d6223bf9bbf0522ea5a1717c39ac4a0aa9fac52ef0b6ffe1fc51193506dd09113adae129c5ee986c46bbf32e8f5681fc6d8b7f5
7
+ data.tar.gz: 3b6d91d5fc7218823e0e045906d2a9a370aa3e8b7f8902e5ca94fcbf4ffad0ba2e847b5d5d3a7919c2449fcaaea7ace4682e18592a93fa9b243d1b8370bb0e6e
data/README.md CHANGED
@@ -20,8 +20,10 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction).
20
20
  - [Live Activity Action](#live-activity-action)
21
21
  - [Icons and Badges](#icons-and-badges)
22
22
  - [Live Activity Colors](#live-activity-colors)
23
- - [Channels](#channels)
24
23
  - [Widgets](#widgets)
24
+ - [App Icon Badge Count](#app-icon-badge-count)
25
+ - [Channels](#channels)
26
+ - [Tags](#tags)
25
27
 
26
28
  ## Installation
27
29
 
@@ -535,20 +537,6 @@ Choose from these colors for the Live Activity accent, including progress bars a
535
537
 
536
538
  `lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`
537
539
 
538
- ## Channels
539
-
540
- Channels are used to target specific team members or devices. Can be used for both push notifications and live activities.
541
-
542
- ```ruby
543
- activitysmith.notifications.send(
544
- {
545
- title: "New subscription 💸",
546
- message: "Customer upgraded to Pro plan",
547
- channels: ["sales", "customer-success"] # Optional
548
- }
549
- )
550
- ```
551
-
552
540
  ## Widgets
553
541
 
554
542
  <p align="center">
@@ -571,6 +559,78 @@ String metric values work too.
571
559
  activitysmith.metrics.update("prod.status", "healthy")
572
560
  ```
573
561
 
562
+ ## App Icon Badge Count
563
+
564
+ <p align="center">
565
+ <img src="https://cdn.activitysmith.com/features/badge-count.png" alt="ActivitySmith app icon with an App Icon Badge Count" width="680" />
566
+ </p>
567
+
568
+ 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.
569
+
570
+ Set or update the badge value.
571
+
572
+ ```ruby
573
+ activitysmith.badge_count(8333)
574
+ ```
575
+
576
+ To clear the badge, set its value to 0.
577
+
578
+ ```ruby
579
+ activitysmith.badge_count(0)
580
+ ```
581
+
582
+ ## Channels
583
+
584
+ Use `channels` to target specific team members or devices
585
+
586
+ ### Push Notifications
587
+
588
+ ```ruby
589
+ activitysmith.notifications.send(
590
+ {
591
+ title: "New subscription 💸",
592
+ message: "Customer upgraded to Pro plan",
593
+ channels: ["sales", "customer-success"]
594
+ }
595
+ )
596
+ ```
597
+
598
+ ### Live Activities
599
+
600
+ ```ruby
601
+ activitysmith.live_activities.start(
602
+ {
603
+ content_state: {
604
+ title: "Nightly Database Backup",
605
+ subtitle: "verify restore",
606
+ type: "progress",
607
+ percentage: 62
608
+ },
609
+ channels: ["sales", "customer-success"]
610
+ }
611
+ )
612
+ ```
613
+
614
+ ### App Icon Badge Count
615
+
616
+ ```ruby
617
+ activitysmith.badge_count(3, channels: ["sales", "customer-success"])
618
+ ```
619
+
620
+ ## Tags
621
+
622
+ Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them.
623
+
624
+ ```ruby
625
+ activitysmith.notifications.send(
626
+ {
627
+ title: "New subscription 💸",
628
+ message: "Customer upgraded to Pro plan",
629
+ tags: ["user:382", "billing"]
630
+ }
631
+ )
632
+ ```
633
+
574
634
  ## Error Handling
575
635
 
576
636
  ```ruby
@@ -0,0 +1,90 @@
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 AppIconBadgesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Set App Icon Badge Count
23
+ # Shows a number on the ActivitySmith app icon.
24
+ # @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AppIconBadgeCountUpdateResponse]
27
+ def update_app_icon_badge_count(app_icon_badge_count_update_request, opts = {})
28
+ data, _status_code, _headers = update_app_icon_badge_count_with_http_info(app_icon_badge_count_update_request, opts)
29
+ data
30
+ end
31
+
32
+ # Set App Icon Badge Count
33
+ # Shows a number on the ActivitySmith app icon.
34
+ # @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AppIconBadgeCountUpdateResponse, Integer, Hash)>] AppIconBadgeCountUpdateResponse data, response status code and response headers
37
+ def update_app_icon_badge_count_with_http_info(app_icon_badge_count_update_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AppIconBadgesApi.update_app_icon_badge_count ...'
40
+ end
41
+ # verify the required parameter 'app_icon_badge_count_update_request' is set
42
+ if @api_client.config.client_side_validation && app_icon_badge_count_update_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'app_icon_badge_count_update_request' when calling AppIconBadgesApi.update_app_icon_badge_count"
44
+ end
45
+ # resource path
46
+ local_var_path = '/badge'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(app_icon_badge_count_update_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'AppIconBadgeCountUpdateResponse'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"AppIconBadgesApi.update_app_icon_badge_count",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: AppIconBadgesApi#update_app_icon_badge_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+ end
90
+ 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, 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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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 only.
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.
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
  # 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`.
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.
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;.
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.
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,259 @@
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 AppIconBadgeCountUpdateRequest
18
+ # The count to show on the ActivitySmith app icon. Send 0 to clear it.
19
+ attr_accessor :badge
20
+
21
+ attr_accessor :target
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'badge' => :'badge',
27
+ :'target' => :'target'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'badge' => :'Integer',
40
+ :'target' => :'ChannelTarget'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AppIconBadgeCountUpdateRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AppIconBadgeCountUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'badge')
66
+ self.badge = attributes[:'badge']
67
+ else
68
+ self.badge = nil
69
+ end
70
+
71
+ if attributes.key?(:'target')
72
+ self.target = attributes[:'target']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if @badge.nil?
82
+ invalid_properties.push('invalid value for "badge", badge cannot be nil.')
83
+ end
84
+
85
+ if @badge > 2147483647
86
+ invalid_properties.push('invalid value for "badge", must be smaller than or equal to 2147483647.')
87
+ end
88
+
89
+ if @badge < 0
90
+ invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ return false if @badge.nil?
101
+ return false if @badge > 2147483647
102
+ return false if @badge < 0
103
+ true
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param [Object] badge Value to be assigned
108
+ def badge=(badge)
109
+ if badge.nil?
110
+ fail ArgumentError, 'badge cannot be nil'
111
+ end
112
+
113
+ if badge > 2147483647
114
+ fail ArgumentError, 'invalid value for "badge", must be smaller than or equal to 2147483647.'
115
+ end
116
+
117
+ if badge < 0
118
+ fail ArgumentError, 'invalid value for "badge", must be greater than or equal to 0.'
119
+ end
120
+
121
+ @badge = badge
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ badge == o.badge &&
130
+ target == o.target
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [badge, target].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
164
+ end
165
+ new(transformed_hash)
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def self._deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = OpenapiClient.const_get(type)
207
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end