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.
- checksums.yaml +4 -4
- data/README.md +126 -26
- data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
- data/generated/activitysmith_openapi/api/metrics_api.rb +2 -2
- data/generated/activitysmith_openapi/api/push_notifications_api.rb +2 -2
- data/generated/activitysmith_openapi/models/billing_blocked_error.rb +296 -0
- data/generated/activitysmith_openapi/models/billing_blocked_error_trial_period.rb +237 -0
- data/generated/activitysmith_openapi/models/content_state_end.rb +8 -8
- data/generated/activitysmith_openapi/models/content_state_start.rb +8 -8
- data/generated/activitysmith_openapi/models/content_state_update.rb +8 -8
- data/generated/activitysmith_openapi/models/live_activity_action.rb +23 -1
- data/generated/activitysmith_openapi/models/live_activity_end_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_start_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_update_request.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_value.rb +106 -0
- data/generated/activitysmith_openapi/models/push_interruption_level.rb +41 -0
- data/generated/activitysmith_openapi/models/push_notification_action.rb +22 -0
- data/generated/activitysmith_openapi/models/push_notification_request.rb +64 -1
- data/generated/activitysmith_openapi/models/push_notification_response.rb +3 -0
- data/generated/activitysmith_openapi/models/rate_limit_error.rb +44 -1
- data/generated/activitysmith_openapi/models/stream_content_state.rb +8 -8
- data/generated/activitysmith_openapi/version.rb +1 -1
- data/generated/activitysmith_openapi.rb +4 -0
- data/generated/openapi-source.json +2 -2
- data/lib/activitysmith/live_activities.rb +1 -0
- data/lib/activitysmith/notifications.rb +10 -4
- data/lib/activitysmith/push_interruption_level.rb +10 -0
- data/lib/activitysmith/version.rb +1 -1
- data/lib/activitysmith.rb +1 -0
- metadata +7 -2
|
@@ -29,6 +29,28 @@ module OpenapiClient
|
|
|
29
29
|
# Optional webhook payload body. Used only when type=webhook.
|
|
30
30
|
attr_accessor :body
|
|
31
31
|
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
32
54
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
55
|
def self.attribute_map
|
|
34
56
|
{
|
|
@@ -24,6 +24,12 @@ module OpenapiClient
|
|
|
24
24
|
|
|
25
25
|
attr_accessor :subtitle
|
|
26
26
|
|
|
27
|
+
# Optional HTTPS image URL without credentials for a custom notification icon. If the image cannot be loaded, the app icon is used. iOS may omit subtitle when displaying a custom icon.
|
|
28
|
+
attr_accessor :icon
|
|
29
|
+
|
|
30
|
+
# Optional. How urgently iOS presents the notification: `passive` (quiet, no sound or screen wake), `active` (default), or `time-sensitive` (can break through Focus and Scheduled Summary when allowed). Omit for normal delivery.
|
|
31
|
+
attr_accessor :interruption_level
|
|
32
|
+
|
|
27
33
|
# Optional HTTPS URL for an image, audio file, or video that users can preview or play when they expand the notification. If `redirection` is omitted, tapping the notification opens this URL. Cannot be combined with `actions`.
|
|
28
34
|
attr_accessor :media
|
|
29
35
|
|
|
@@ -44,6 +50,28 @@ module OpenapiClient
|
|
|
44
50
|
# Optional tags to organize and filter notification history.
|
|
45
51
|
attr_accessor :tags
|
|
46
52
|
|
|
53
|
+
class EnumAttributeValidator
|
|
54
|
+
attr_reader :datatype
|
|
55
|
+
attr_reader :allowable_values
|
|
56
|
+
|
|
57
|
+
def initialize(datatype, allowable_values)
|
|
58
|
+
@allowable_values = allowable_values.map do |value|
|
|
59
|
+
case datatype.to_s
|
|
60
|
+
when /Integer/i
|
|
61
|
+
value.to_i
|
|
62
|
+
when /Float/i
|
|
63
|
+
value.to_f
|
|
64
|
+
else
|
|
65
|
+
value
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def valid?(value)
|
|
71
|
+
!value || allowable_values.include?(value)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
47
75
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
48
76
|
def self.attribute_map
|
|
49
77
|
{
|
|
@@ -51,6 +79,8 @@ module OpenapiClient
|
|
|
51
79
|
:'title' => :'title',
|
|
52
80
|
:'message' => :'message',
|
|
53
81
|
:'subtitle' => :'subtitle',
|
|
82
|
+
:'icon' => :'icon',
|
|
83
|
+
:'interruption_level' => :'interruption_level',
|
|
54
84
|
:'media' => :'media',
|
|
55
85
|
:'redirection' => :'redirection',
|
|
56
86
|
:'actions' => :'actions',
|
|
@@ -74,6 +104,8 @@ module OpenapiClient
|
|
|
74
104
|
:'title' => :'String',
|
|
75
105
|
:'message' => :'String',
|
|
76
106
|
:'subtitle' => :'String',
|
|
107
|
+
:'icon' => :'String',
|
|
108
|
+
:'interruption_level' => :'PushInterruptionLevel',
|
|
77
109
|
:'media' => :'String',
|
|
78
110
|
:'redirection' => :'String',
|
|
79
111
|
:'actions' => :'Array<PushNotificationAction>',
|
|
@@ -126,6 +158,14 @@ module OpenapiClient
|
|
|
126
158
|
self.subtitle = attributes[:'subtitle']
|
|
127
159
|
end
|
|
128
160
|
|
|
161
|
+
if attributes.key?(:'icon')
|
|
162
|
+
self.icon = attributes[:'icon']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'interruption_level')
|
|
166
|
+
self.interruption_level = attributes[:'interruption_level']
|
|
167
|
+
end
|
|
168
|
+
|
|
129
169
|
if attributes.key?(:'media')
|
|
130
170
|
self.media = attributes[:'media']
|
|
131
171
|
end
|
|
@@ -176,6 +216,11 @@ module OpenapiClient
|
|
|
176
216
|
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
177
217
|
end
|
|
178
218
|
|
|
219
|
+
pattern = Regexp.new(/^https:\/\//)
|
|
220
|
+
if !@icon.nil? && @icon !~ pattern
|
|
221
|
+
invalid_properties.push("invalid value for \"icon\", must conform to the pattern #{pattern}.")
|
|
222
|
+
end
|
|
223
|
+
|
|
179
224
|
pattern = Regexp.new(/^https:\/\//)
|
|
180
225
|
if !@media.nil? && @media !~ pattern
|
|
181
226
|
invalid_properties.push("invalid value for \"media\", must conform to the pattern #{pattern}.")
|
|
@@ -203,6 +248,7 @@ module OpenapiClient
|
|
|
203
248
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
204
249
|
return false if !@metadata.nil? && @metadata.length > 50
|
|
205
250
|
return false if @title.nil?
|
|
251
|
+
return false if !@icon.nil? && @icon !~ Regexp.new(/^https:\/\//)
|
|
206
252
|
return false if !@media.nil? && @media !~ Regexp.new(/^https:\/\//)
|
|
207
253
|
return false if !@redirection.nil? && @redirection.to_s.length > 2048
|
|
208
254
|
return false if !@redirection.nil? && @redirection !~ Regexp.new(/^[A-Za-z][A-Za-z0-9+.-]*:/)
|
|
@@ -224,6 +270,21 @@ module OpenapiClient
|
|
|
224
270
|
@metadata = metadata
|
|
225
271
|
end
|
|
226
272
|
|
|
273
|
+
# Custom attribute writer method with validation
|
|
274
|
+
# @param [Object] icon Value to be assigned
|
|
275
|
+
def icon=(icon)
|
|
276
|
+
if icon.nil?
|
|
277
|
+
fail ArgumentError, 'icon cannot be nil'
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
pattern = Regexp.new(/^https:\/\//)
|
|
281
|
+
if icon !~ pattern
|
|
282
|
+
fail ArgumentError, "invalid value for \"icon\", must conform to the pattern #{pattern}."
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
@icon = icon
|
|
286
|
+
end
|
|
287
|
+
|
|
227
288
|
# Custom attribute writer method with validation
|
|
228
289
|
# @param [Object] media Value to be assigned
|
|
229
290
|
def media=(media)
|
|
@@ -281,6 +342,8 @@ module OpenapiClient
|
|
|
281
342
|
title == o.title &&
|
|
282
343
|
message == o.message &&
|
|
283
344
|
subtitle == o.subtitle &&
|
|
345
|
+
icon == o.icon &&
|
|
346
|
+
interruption_level == o.interruption_level &&
|
|
284
347
|
media == o.media &&
|
|
285
348
|
redirection == o.redirection &&
|
|
286
349
|
actions == o.actions &&
|
|
@@ -300,7 +363,7 @@ module OpenapiClient
|
|
|
300
363
|
# Calculates hash code according to all attributes.
|
|
301
364
|
# @return [Integer] Hash code
|
|
302
365
|
def hash
|
|
303
|
-
[metadata, title, message, subtitle, media, redirection, actions, payload, badge, sound, target, tags].hash
|
|
366
|
+
[metadata, title, message, subtitle, icon, interruption_level, media, redirection, actions, payload, badge, sound, target, tags].hash
|
|
304
367
|
end
|
|
305
368
|
|
|
306
369
|
# Builds the object from hash
|
|
@@ -14,9 +14,12 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
+
# Apple APNs acceptance result. Acceptance does not confirm device delivery or presentation. Alerts remain eligible for APNs delivery retries for 24 hours; device settings and APNs storage policies still apply.
|
|
17
18
|
class PushNotificationResponse
|
|
19
|
+
# True when APNs accepts the notification for at least one targeted device.
|
|
18
20
|
attr_accessor :success
|
|
19
21
|
|
|
22
|
+
# Number of device tokens for which APNs accepted the notification, without confirming on-device delivery.
|
|
20
23
|
attr_accessor :devices_notified
|
|
21
24
|
|
|
22
25
|
attr_accessor :users_notified
|
|
@@ -15,13 +15,38 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
17
|
class RateLimitError
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
18
20
|
attr_accessor :error
|
|
19
21
|
|
|
20
22
|
attr_accessor :message
|
|
21
23
|
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
22
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
47
|
def self.attribute_map
|
|
24
48
|
{
|
|
49
|
+
:'code' => :'code',
|
|
25
50
|
:'error' => :'error',
|
|
26
51
|
:'message' => :'message'
|
|
27
52
|
}
|
|
@@ -35,6 +60,7 @@ module OpenapiClient
|
|
|
35
60
|
# Attribute type mapping.
|
|
36
61
|
def self.openapi_types
|
|
37
62
|
{
|
|
63
|
+
:'code' => :'String',
|
|
38
64
|
:'error' => :'String',
|
|
39
65
|
:'message' => :'String'
|
|
40
66
|
}
|
|
@@ -61,6 +87,10 @@ module OpenapiClient
|
|
|
61
87
|
h[k.to_sym] = v
|
|
62
88
|
}
|
|
63
89
|
|
|
90
|
+
if attributes.key?(:'code')
|
|
91
|
+
self.code = attributes[:'code']
|
|
92
|
+
end
|
|
93
|
+
|
|
64
94
|
if attributes.key?(:'error')
|
|
65
95
|
self.error = attributes[:'error']
|
|
66
96
|
else
|
|
@@ -94,16 +124,29 @@ module OpenapiClient
|
|
|
94
124
|
# @return true if the model is valid
|
|
95
125
|
def valid?
|
|
96
126
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
127
|
+
code_validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
128
|
+
return false unless code_validator.valid?(@code)
|
|
97
129
|
return false if @error.nil?
|
|
98
130
|
return false if @message.nil?
|
|
99
131
|
true
|
|
100
132
|
end
|
|
101
133
|
|
|
134
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
135
|
+
# @param [Object] code Object to be assigned
|
|
136
|
+
def code=(code)
|
|
137
|
+
validator = EnumAttributeValidator.new('String', ["rate_limited"])
|
|
138
|
+
unless validator.valid?(code)
|
|
139
|
+
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
140
|
+
end
|
|
141
|
+
@code = code
|
|
142
|
+
end
|
|
143
|
+
|
|
102
144
|
# Checks equality by comparing each attribute.
|
|
103
145
|
# @param [Object] Object to be compared
|
|
104
146
|
def ==(o)
|
|
105
147
|
return true if self.equal?(o)
|
|
106
148
|
self.class == o.class &&
|
|
149
|
+
code == o.code &&
|
|
107
150
|
error == o.error &&
|
|
108
151
|
message == o.message
|
|
109
152
|
end
|
|
@@ -117,7 +160,7 @@ module OpenapiClient
|
|
|
117
160
|
# Calculates hash code according to all attributes.
|
|
118
161
|
# @return [Integer] Hash code
|
|
119
162
|
def hash
|
|
120
|
-
[error, message].hash
|
|
163
|
+
[code, error, message].hash
|
|
121
164
|
end
|
|
122
165
|
|
|
123
166
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
-
# Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, and
|
|
17
|
+
# Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window.
|
|
18
18
|
class StreamContentState
|
|
19
19
|
attr_accessor :title
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ module OpenapiClient
|
|
|
29
29
|
# Use for progress. Takes precedence over value/upper_limit if both are provided.
|
|
30
30
|
attr_accessor :percentage
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit.
|
|
33
33
|
attr_accessor :value
|
|
34
34
|
|
|
35
35
|
# Maximum progress value. Use with value for progress.
|
|
@@ -47,7 +47,7 @@ module OpenapiClient
|
|
|
47
47
|
# Required on the first PUT or whenever the stream cannot infer the current activity type.
|
|
48
48
|
attr_accessor :type
|
|
49
49
|
|
|
50
|
-
# Optional. Accent color for progress, segmented_progress, metrics, and
|
|
50
|
+
# Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
|
|
51
51
|
attr_accessor :color
|
|
52
52
|
|
|
53
53
|
# Optional. Overrides color for the current step. Only applies to segmented_progress.
|
|
@@ -62,10 +62,10 @@ module OpenapiClient
|
|
|
62
62
|
# Required for type=alert.
|
|
63
63
|
attr_accessor :message
|
|
64
64
|
|
|
65
|
-
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and
|
|
65
|
+
# Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
|
|
66
66
|
attr_accessor :icon
|
|
67
67
|
|
|
68
|
-
# Optional badge. Supported by alert, progress, and
|
|
68
|
+
# Optional badge. Supported by alert, progress, segmented_progress, and value.
|
|
69
69
|
attr_accessor :badge
|
|
70
70
|
|
|
71
71
|
# Optional. Seconds before the ended Live Activity is dismissed.
|
|
@@ -135,7 +135,7 @@ module OpenapiClient
|
|
|
135
135
|
:'number_of_steps' => :'Integer',
|
|
136
136
|
:'current_step' => :'Integer',
|
|
137
137
|
:'percentage' => :'Float',
|
|
138
|
-
:'value' => :'
|
|
138
|
+
:'value' => :'LiveActivityValue',
|
|
139
139
|
:'upper_limit' => :'Float',
|
|
140
140
|
:'duration_seconds' => :'Float',
|
|
141
141
|
:'counts_down' => :'Boolean',
|
|
@@ -322,7 +322,7 @@ module OpenapiClient
|
|
|
322
322
|
return false if !@current_step.nil? && @current_step < 0
|
|
323
323
|
return false if !@percentage.nil? && @percentage > 100
|
|
324
324
|
return false if !@percentage.nil? && @percentage < 0
|
|
325
|
-
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
325
|
+
type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
326
326
|
return false unless type_validator.valid?(@type)
|
|
327
327
|
color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
|
|
328
328
|
return false unless color_validator.valid?(@color)
|
|
@@ -385,7 +385,7 @@ module OpenapiClient
|
|
|
385
385
|
# Custom attribute writer method checking allowed values (enum).
|
|
386
386
|
# @param [Object] type Object to be assigned
|
|
387
387
|
def type=(type)
|
|
388
|
-
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
|
|
388
|
+
validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
|
|
389
389
|
unless validator.valid?(type)
|
|
390
390
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
391
391
|
end
|
|
@@ -24,6 +24,8 @@ require 'activitysmith_openapi/models/app_icon_badge_count_update_error'
|
|
|
24
24
|
require 'activitysmith_openapi/models/app_icon_badge_count_update_request'
|
|
25
25
|
require 'activitysmith_openapi/models/app_icon_badge_count_update_response'
|
|
26
26
|
require 'activitysmith_openapi/models/bad_request_error'
|
|
27
|
+
require 'activitysmith_openapi/models/billing_blocked_error'
|
|
28
|
+
require 'activitysmith_openapi/models/billing_blocked_error_trial_period'
|
|
27
29
|
require 'activitysmith_openapi/models/channel_target'
|
|
28
30
|
require 'activitysmith_openapi/models/content_state_end'
|
|
29
31
|
require 'activitysmith_openapi/models/content_state_start'
|
|
@@ -45,6 +47,7 @@ require 'activitysmith_openapi/models/live_activity_stream_put_response'
|
|
|
45
47
|
require 'activitysmith_openapi/models/live_activity_stream_request'
|
|
46
48
|
require 'activitysmith_openapi/models/live_activity_update_request'
|
|
47
49
|
require 'activitysmith_openapi/models/live_activity_update_response'
|
|
50
|
+
require 'activitysmith_openapi/models/live_activity_value'
|
|
48
51
|
require 'activitysmith_openapi/models/live_activity_webhook_method'
|
|
49
52
|
require 'activitysmith_openapi/models/metadata_value'
|
|
50
53
|
require 'activitysmith_openapi/models/metric_error'
|
|
@@ -53,6 +56,7 @@ require 'activitysmith_openapi/models/metric_value_update_request_value'
|
|
|
53
56
|
require 'activitysmith_openapi/models/metric_value_update_response'
|
|
54
57
|
require 'activitysmith_openapi/models/no_recipients_error'
|
|
55
58
|
require 'activitysmith_openapi/models/not_found_error'
|
|
59
|
+
require 'activitysmith_openapi/models/push_interruption_level'
|
|
56
60
|
require 'activitysmith_openapi/models/push_notification_action'
|
|
57
61
|
require 'activitysmith_openapi/models/push_notification_action_type'
|
|
58
62
|
require 'activitysmith_openapi/models/push_notification_request'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "ActivitySmithHQ/activitysmith-backend",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "ce15d69eeb25776a3ae395e77d8b907ff7ba0709",
|
|
4
4
|
"path": "openapi.json",
|
|
5
|
-
"sha256": "
|
|
5
|
+
"sha256": "b113d50e06d6581707d9472dda6e371b996441f58dceba87a88f79cb96508a7d"
|
|
6
6
|
}
|
|
@@ -8,6 +8,7 @@ module ActivitySmith
|
|
|
8
8
|
TYPE_STATS = "stats"
|
|
9
9
|
TYPE_ALERT = "alert"
|
|
10
10
|
TYPE_TIMER = "timer"
|
|
11
|
+
TYPE_VALUE = "value"
|
|
11
12
|
|
|
12
13
|
class << self
|
|
13
14
|
def content_state(title:, type: nil, subtitle: nil, message: nil, icon: nil, badge: nil, color: nil, duration_seconds: nil, counts_down: nil, **fields)
|
|
@@ -9,14 +9,13 @@ module ActivitySmith
|
|
|
9
9
|
def send(request = nil, opts = {}, tags: nil, **request_fields)
|
|
10
10
|
normalized = normalize_channels_target(with_tags(combine_request(request, request_fields), tags))
|
|
11
11
|
assert_valid_media_actions!(normalized)
|
|
12
|
+
assert_valid_interruption_level!(normalized)
|
|
12
13
|
@api.send_push_notification(normalized, opts)
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
# Backward-compatible alias.
|
|
16
|
-
def send_push_notification(push_notification_request, opts = {}, tags: nil)
|
|
17
|
-
|
|
18
|
-
assert_valid_media_actions!(normalized)
|
|
19
|
-
@api.send_push_notification(normalized, opts)
|
|
17
|
+
def send_push_notification(push_notification_request = nil, opts = {}, tags: nil, **request_fields)
|
|
18
|
+
send(push_notification_request, opts, tags: tags, **request_fields)
|
|
20
19
|
end
|
|
21
20
|
|
|
22
21
|
def method_missing(name, *args, &block)
|
|
@@ -80,6 +79,13 @@ module ActivitySmith
|
|
|
80
79
|
raise ArgumentError, "ActivitySmith: media cannot be combined with actions"
|
|
81
80
|
end
|
|
82
81
|
|
|
82
|
+
def assert_valid_interruption_level!(request)
|
|
83
|
+
level = request_value(request, :interruption_level)
|
|
84
|
+
return if level.nil? || PushInterruptionLevel::VALUES.include?(level.to_s)
|
|
85
|
+
|
|
86
|
+
raise ArgumentError, "ActivitySmith: interruption_level must be passive, active, or time-sensitive"
|
|
87
|
+
end
|
|
88
|
+
|
|
83
89
|
def request_value(request, key)
|
|
84
90
|
if request.is_a?(Hash)
|
|
85
91
|
return request[key] if request.key?(key)
|
data/lib/activitysmith.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "activitysmith/version"
|
|
4
4
|
require_relative "activitysmith/versioned_user_agent"
|
|
5
|
+
require_relative "activitysmith/push_interruption_level"
|
|
5
6
|
require_relative "activitysmith/notifications"
|
|
6
7
|
require_relative "activitysmith/live_activities"
|
|
7
8
|
require_relative "activitysmith/metrics"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activitysmith
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ActivitySmith
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09
|
|
11
|
+
date: 2026-10-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -90,6 +90,8 @@ files:
|
|
|
90
90
|
- generated/activitysmith_openapi/models/app_icon_badge_count_update_request.rb
|
|
91
91
|
- generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb
|
|
92
92
|
- generated/activitysmith_openapi/models/bad_request_error.rb
|
|
93
|
+
- generated/activitysmith_openapi/models/billing_blocked_error.rb
|
|
94
|
+
- generated/activitysmith_openapi/models/billing_blocked_error_trial_period.rb
|
|
93
95
|
- generated/activitysmith_openapi/models/channel_target.rb
|
|
94
96
|
- generated/activitysmith_openapi/models/content_state_end.rb
|
|
95
97
|
- generated/activitysmith_openapi/models/content_state_start.rb
|
|
@@ -111,6 +113,7 @@ files:
|
|
|
111
113
|
- generated/activitysmith_openapi/models/live_activity_stream_request.rb
|
|
112
114
|
- generated/activitysmith_openapi/models/live_activity_update_request.rb
|
|
113
115
|
- generated/activitysmith_openapi/models/live_activity_update_response.rb
|
|
116
|
+
- generated/activitysmith_openapi/models/live_activity_value.rb
|
|
114
117
|
- generated/activitysmith_openapi/models/live_activity_webhook_method.rb
|
|
115
118
|
- generated/activitysmith_openapi/models/metadata_value.rb
|
|
116
119
|
- generated/activitysmith_openapi/models/metric_error.rb
|
|
@@ -119,6 +122,7 @@ files:
|
|
|
119
122
|
- generated/activitysmith_openapi/models/metric_value_update_response.rb
|
|
120
123
|
- generated/activitysmith_openapi/models/no_recipients_error.rb
|
|
121
124
|
- generated/activitysmith_openapi/models/not_found_error.rb
|
|
125
|
+
- generated/activitysmith_openapi/models/push_interruption_level.rb
|
|
122
126
|
- generated/activitysmith_openapi/models/push_notification_action.rb
|
|
123
127
|
- generated/activitysmith_openapi/models/push_notification_action_type.rb
|
|
124
128
|
- generated/activitysmith_openapi/models/push_notification_request.rb
|
|
@@ -135,6 +139,7 @@ files:
|
|
|
135
139
|
- lib/activitysmith/live_activities.rb
|
|
136
140
|
- lib/activitysmith/metrics.rb
|
|
137
141
|
- lib/activitysmith/notifications.rb
|
|
142
|
+
- lib/activitysmith/push_interruption_level.rb
|
|
138
143
|
- lib/activitysmith/version.rb
|
|
139
144
|
- lib/activitysmith/versioned_user_agent.rb
|
|
140
145
|
homepage: https://activitysmith.com/docs/sdks/ruby
|