activitysmith 1.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f86e85308bf6c8e023bd259ab6eba591f133b374f3f7ac1e15b82bac6be9048
4
- data.tar.gz: 513d68dbcb7fd304985455cae2402a164e06fb37f2a78b80388ff24f70d531a4
3
+ metadata.gz: a34b4cbdf040d39ac1a0ffbce791601bfb02037c65200e601c69cc3b25483014
4
+ data.tar.gz: 50c856c221b5027091facf351b5f29b5e95c57e0db869eaea87aad5d06b628eb
5
5
  SHA512:
6
- metadata.gz: 7dbbe2d1bb79c686e17d2e366a0ee37eb72122b0f0767fb1fa38aaade1e7f1ae18a4094634e99bc18f92f9e33d37dfe5f1612e848f8cfd43193b467cb5066d71
7
- data.tar.gz: 7b9163d87d7d3e7207233880cbeb7a45fd577725d7f6753d92d1acf70d778374962a2f63b9c0ddb652aeb130833a1939cd5f7e4da6370b2585d1d8dfdad67e0e
6
+ metadata.gz: c7ae076e9a17173a9aca6901be21bf2d4b600a80fd2f897b646ac1ead519eccf001fc72adc69aebccdda471679a8d81606f0ab54e0ceb8e7931b420705ef72f5
7
+ data.tar.gz: fcf3e1e4d7fb15faa8fdfaeefe7062ecd16f94d60e1b737cdf2a1904911354c65db6a60c620aba8bc980dbabc80ae17310fde700b4b3b948bd40a19ff5aeb4a0
data/README.md CHANGED
@@ -40,6 +40,22 @@ activitysmith.notifications.send(
40
40
  )
41
41
  ```
42
42
 
43
+ ### Custom Push Notification Icons
44
+
45
+ ![Push Notifications with custom icons](https://cdn.activitysmith.com/features/push-notifications-with-custom-icons.png)
46
+
47
+ Set `icon` to a publicly accessible HTTPS image URL to show an avatar or service logo alongside a smaller ActivitySmith app icon. With a custom icon, iOS may omit the subtitle from the notification.
48
+
49
+ ```ruby
50
+ activitysmith.notifications.send(
51
+ {
52
+ title: "MRR just crossed $10,000 🎉",
53
+ message: "Up 18% this month from 31 new subscriptions.",
54
+ icon: "https://cdn.activitysmith.com/integrations/icons/stripe.png"
55
+ }
56
+ )
57
+ ```
58
+
43
59
  ### Rich Push Notifications with Media
44
60
 
45
61
  ![Rich Push Notification with image](https://cdn.activitysmith.com/features/rich-push-notification-with-image.png)
@@ -136,23 +152,91 @@ activitysmith.notifications.send(
136
152
  )
137
153
  ```
138
154
 
155
+ ### Push Notification Interruption Levels
156
+
157
+ ![Time Sensitive Push Notification](https://cdn.activitysmith.com/features/time-sensitive-push-notifications.png)
158
+
159
+ Use `interruption_level` to choose how urgently iOS presents a Push Notification. Omit it for normal delivery. Explicit `active` has the same behavior as the default.
160
+
161
+ | Value | Behavior |
162
+ | --- | --- |
163
+ | `passive` | Appears quietly in the notification list, without sound or waking the screen. |
164
+ | `active` | Normal delivery, subject to the device's notification settings and Focus. This is the default. |
165
+ | `time-sensitive` | Can bypass Scheduled Summary and Focus when the user allows Time Sensitive Notifications for ActivitySmith. |
166
+
167
+ See Apple's [interruption levels](https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel) for the system behavior.
168
+
169
+ The SDK also exports these values as `ActivitySmith::PushInterruptionLevel::PASSIVE`, `ACTIVE`, and `TIME_SENSITIVE`.
170
+
171
+ #### Passive
172
+
173
+ ```ruby
174
+ activitysmith.notifications.send(
175
+ {
176
+ title: "Daily summary",
177
+ message: "All scheduled jobs completed successfully.",
178
+ interruption_level: "passive"
179
+ }
180
+ )
181
+ ```
182
+
183
+ #### Active (default)
184
+
185
+ ```ruby
186
+ activitysmith.notifications.send(
187
+ {
188
+ title: "Deployment complete",
189
+ message: "Your latest changes are live.",
190
+ interruption_level: "active"
191
+ }
192
+ )
193
+ ```
194
+
195
+ Removing the interruption level from this example produces the same delivery behavior.
196
+
197
+ #### Time Sensitive
198
+
199
+ ```ruby
200
+ activitysmith.notifications.send(
201
+ {
202
+ title: "🚨 checkout-api is down",
203
+ message: "500 errors on 62% of requests. Customers can't complete payments.",
204
+ interruption_level: "time-sensitive"
205
+ }
206
+ )
207
+ ```
208
+
139
209
  ## Live Activities
140
210
 
141
211
  Choose the Live Activity type that matches what you want to show:
142
212
 
143
- - ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png) **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature.
213
+ ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png)
214
+
215
+ **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature.
216
+
217
+ ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png)
218
+
219
+ **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
220
+
221
+ ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png)
222
+
223
+ **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
224
+
225
+ ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
226
+
227
+ **Metrics**: Track two related values with segmented bars, such as CPU and memory.
144
228
 
145
- - ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
229
+ ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png)
146
230
 
147
- - ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
231
+ **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.
148
232
 
149
- - ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory.
233
+ ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png)
150
234
 
151
- - ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.
235
+ **Progress**: Show percentage progress for jobs that move continuously toward completion.
152
236
 
153
- - ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion.
237
+ ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png)
154
238
 
155
- - ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs.
239
+ **Timer**: Count down from a duration, or count up from 00:00 while a job runs.
156
240
 
157
241
  ### Start & Update Live Activity
158
242
 
@@ -20,7 +20,7 @@ module OpenapiClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Send a push notification
23
- # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history.
23
+ # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
24
24
  # @param push_notification_request [PushNotificationRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [PushNotificationResponse]
@@ -30,7 +30,7 @@ module OpenapiClient
30
30
  end
31
31
 
32
32
  # Send a push notification
33
- # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history.
33
+ # Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional `icon` shows a custom image, such as a service logo or avatar, next to a smaller app icon. Optional `interruption_level` sets how urgently iOS presents the notification. Optional tags to organize and filter notification history.
34
34
  # @param push_notification_request [PushNotificationRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(PushNotificationResponse, Integer, Hash)>] PushNotificationResponse data, response status code and response headers
@@ -0,0 +1,296 @@
1
+ =begin
2
+ #ActivitySmith API
3
+
4
+ #Send push notifications and Live Activities to your own devices via a single API key.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenapiClient
17
+ class BillingBlockedError
18
+ attr_accessor :error
19
+
20
+ attr_accessor :message
21
+
22
+ attr_accessor :trial_period
23
+
24
+ attr_accessor :upgrade_url
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'error' => :'error',
52
+ :'message' => :'message',
53
+ :'trial_period' => :'trial_period',
54
+ :'upgrade_url' => :'upgrade_url'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'error' => :'String',
67
+ :'message' => :'String',
68
+ :'trial_period' => :'BillingBlockedErrorTrialPeriod',
69
+ :'upgrade_url' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::BillingBlockedError` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::BillingBlockedError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'error')
95
+ self.error = attributes[:'error']
96
+ else
97
+ self.error = nil
98
+ end
99
+
100
+ if attributes.key?(:'message')
101
+ self.message = attributes[:'message']
102
+ else
103
+ self.message = nil
104
+ end
105
+
106
+ if attributes.key?(:'trial_period')
107
+ self.trial_period = attributes[:'trial_period']
108
+ end
109
+
110
+ if attributes.key?(:'upgrade_url')
111
+ self.upgrade_url = attributes[:'upgrade_url']
112
+ else
113
+ self.upgrade_url = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @error.nil?
123
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
124
+ end
125
+
126
+ if @message.nil?
127
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
128
+ end
129
+
130
+ if @upgrade_url.nil?
131
+ invalid_properties.push('invalid value for "upgrade_url", upgrade_url cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @error.nil?
142
+ error_validator = EnumAttributeValidator.new('String', ["trial_expired", "trial_exhausted", "billing_overage_cap_reached"])
143
+ return false unless error_validator.valid?(@error)
144
+ return false if @message.nil?
145
+ return false if @upgrade_url.nil?
146
+ true
147
+ end
148
+
149
+ # Custom attribute writer method checking allowed values (enum).
150
+ # @param [Object] error Object to be assigned
151
+ def error=(error)
152
+ validator = EnumAttributeValidator.new('String', ["trial_expired", "trial_exhausted", "billing_overage_cap_reached"])
153
+ unless validator.valid?(error)
154
+ fail ArgumentError, "invalid value for \"error\", must be one of #{validator.allowable_values}."
155
+ end
156
+ @error = error
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ error == o.error &&
165
+ message == o.message &&
166
+ trial_period == o.trial_period &&
167
+ upgrade_url == o.upgrade_url
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [error, message, trial_period, upgrade_url].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ transformed_hash = {}
189
+ openapi_types.each_pair do |key, type|
190
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = nil
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[attribute_map[key]].is_a?(Array)
196
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
+ end
198
+ elsif !attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
+ end
201
+ end
202
+ new(transformed_hash)
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def self._deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = OpenapiClient.const_get(type)
244
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ end
@@ -0,0 +1,237 @@
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 BillingBlockedErrorTrialPeriod
18
+ attr_accessor :started_at
19
+
20
+ attr_accessor :ends_at
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'started_at' => :'started_at',
26
+ :'ends_at' => :'ends_at'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'started_at' => :'Time',
39
+ :'ends_at' => :'Time'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::BillingBlockedErrorTrialPeriod` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::BillingBlockedErrorTrialPeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'started_at')
65
+ self.started_at = attributes[:'started_at']
66
+ else
67
+ self.started_at = nil
68
+ end
69
+
70
+ if attributes.key?(:'ends_at')
71
+ self.ends_at = attributes[:'ends_at']
72
+ else
73
+ self.ends_at = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @started_at.nil?
83
+ invalid_properties.push('invalid value for "started_at", started_at cannot be nil.')
84
+ end
85
+
86
+ if @ends_at.nil?
87
+ invalid_properties.push('invalid value for "ends_at", ends_at cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @started_at.nil?
98
+ return false if @ends_at.nil?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ started_at == o.started_at &&
108
+ ends_at == o.ends_at
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [started_at, ends_at].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def self._deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = OpenapiClient.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -0,0 +1,41 @@
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 PushInterruptionLevel
18
+ PASSIVE = "passive".freeze
19
+ ACTIVE = "active".freeze
20
+ TIME_SENSITIVE = "time-sensitive".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [PASSIVE, ACTIVE, TIME_SENSITIVE].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if PushInterruptionLevel.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #PushInterruptionLevel"
39
+ end
40
+ end
41
+ end
@@ -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
@@ -11,5 +11,5 @@ Generator version: 7.7.0
11
11
  =end
12
12
 
13
13
  module OpenapiClient
14
- VERSION = '1.12.0'
14
+ VERSION = '1.13.0'
15
15
  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'
@@ -54,6 +56,7 @@ require 'activitysmith_openapi/models/metric_value_update_request_value'
54
56
  require 'activitysmith_openapi/models/metric_value_update_response'
55
57
  require 'activitysmith_openapi/models/no_recipients_error'
56
58
  require 'activitysmith_openapi/models/not_found_error'
59
+ require 'activitysmith_openapi/models/push_interruption_level'
57
60
  require 'activitysmith_openapi/models/push_notification_action'
58
61
  require 'activitysmith_openapi/models/push_notification_action_type'
59
62
  require 'activitysmith_openapi/models/push_notification_request'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "repository": "ActivitySmithHQ/activitysmith-backend",
3
- "commit": "6832df646de7de8a6aaf0110960c37074b513c48",
3
+ "commit": "ce15d69eeb25776a3ae395e77d8b907ff7ba0709",
4
4
  "path": "openapi.json",
5
- "sha256": "9ae85ad6127cfa2d50c33261459f5f9e85e011939d01ac4a9d507fa6ed11aa61"
5
+ "sha256": "b113d50e06d6581707d9472dda6e371b996441f58dceba87a88f79cb96508a7d"
6
6
  }
@@ -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
- normalized = normalize_channels_target(with_tags(push_notification_request, tags))
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)
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActivitySmith
4
+ module PushInterruptionLevel
5
+ PASSIVE = "passive"
6
+ ACTIVE = "active"
7
+ TIME_SENSITIVE = "time-sensitive"
8
+ VALUES = [PASSIVE, ACTIVE, TIME_SENSITIVE].freeze
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivitySmith
4
- VERSION = "1.12.0"
4
+ VERSION = "1.13.0"
5
5
  end
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.12.0
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-20 00:00:00.000000000 Z
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
@@ -120,6 +122,7 @@ files:
120
122
  - generated/activitysmith_openapi/models/metric_value_update_response.rb
121
123
  - generated/activitysmith_openapi/models/no_recipients_error.rb
122
124
  - generated/activitysmith_openapi/models/not_found_error.rb
125
+ - generated/activitysmith_openapi/models/push_interruption_level.rb
123
126
  - generated/activitysmith_openapi/models/push_notification_action.rb
124
127
  - generated/activitysmith_openapi/models/push_notification_action_type.rb
125
128
  - generated/activitysmith_openapi/models/push_notification_request.rb
@@ -136,6 +139,7 @@ files:
136
139
  - lib/activitysmith/live_activities.rb
137
140
  - lib/activitysmith/metrics.rb
138
141
  - lib/activitysmith/notifications.rb
142
+ - lib/activitysmith/push_interruption_level.rb
139
143
  - lib/activitysmith/version.rb
140
144
  - lib/activitysmith/versioned_user_agent.rb
141
145
  homepage: https://activitysmith.com/docs/sdks/ruby