activitysmith 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +130 -12
- data/generated/activitysmith_openapi/api/app_icon_badges_api.rb +4 -4
- data/generated/activitysmith_openapi/api/devices_api.rb +100 -0
- data/generated/activitysmith_openapi/api/live_activities_api.rb +4 -4
- data/generated/activitysmith_openapi/api/metrics_api.rb +87 -4
- data/generated/activitysmith_openapi/api/push_notifications_api.rb +67 -0
- data/generated/activitysmith_openapi/models/account_device.rb +367 -0
- data/generated/activitysmith_openapi/models/account_device_list_response.rb +239 -0
- data/generated/activitysmith_openapi/models/account_device_list_response_meta.rb +299 -0
- data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +1 -1
- data/generated/activitysmith_openapi/models/content_state_start.rb +24 -3
- data/generated/activitysmith_openapi/models/content_state_update.rb +23 -2
- data/generated/activitysmith_openapi/models/live_activity_end_request.rb +42 -4
- data/generated/activitysmith_openapi/models/live_activity_start_request.rb +42 -4
- data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +42 -4
- data/generated/activitysmith_openapi/models/live_activity_stream_delete_response.rb +12 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +42 -4
- data/generated/activitysmith_openapi/models/live_activity_update_request.rb +42 -4
- data/generated/activitysmith_openapi/models/metric.rb +411 -0
- data/generated/activitysmith_openapi/models/metric_response.rb +221 -0
- data/generated/activitysmith_openapi/models/metric_upsert_request.rb +370 -0
- data/generated/activitysmith_openapi/models/metric_value_update_response.rb +14 -4
- data/generated/activitysmith_openapi/models/no_recipients_error.rb +21 -1
- data/generated/activitysmith_openapi/models/push_notification_action.rb +1 -1
- data/generated/activitysmith_openapi/models/push_notification_dismiss_response.rb +257 -0
- data/generated/activitysmith_openapi/models/push_notification_replace_request.rb +1 -1
- data/generated/activitysmith_openapi/models/push_notification_request.rb +30 -1
- data/generated/activitysmith_openapi/models/stream_content_state.rb +24 -3
- data/generated/activitysmith_openapi/version.rb +1 -1
- data/generated/activitysmith_openapi.rb +8 -0
- data/generated/openapi-source.json +2 -2
- data/lib/activitysmith/client.rb +3 -1
- data/lib/activitysmith/devices.rb +30 -0
- data/lib/activitysmith/metrics.rb +15 -1
- data/lib/activitysmith/notifications.rb +11 -0
- data/lib/activitysmith/version.rb +1 -1
- data/lib/activitysmith.rb +1 -0
- metadata +11 -2
|
@@ -0,0 +1,299 @@
|
|
|
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 AccountDeviceListResponseMeta
|
|
18
|
+
# Devices matching the filter.
|
|
19
|
+
attr_accessor :total
|
|
20
|
+
|
|
21
|
+
attr_accessor :limit
|
|
22
|
+
|
|
23
|
+
attr_accessor :offset
|
|
24
|
+
|
|
25
|
+
attr_accessor :has_more
|
|
26
|
+
|
|
27
|
+
# Offset for the next page, or null on the last page.
|
|
28
|
+
attr_accessor :next_offset
|
|
29
|
+
|
|
30
|
+
attr_accessor :include_inactive
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'total' => :'total',
|
|
36
|
+
:'limit' => :'limit',
|
|
37
|
+
:'offset' => :'offset',
|
|
38
|
+
:'has_more' => :'has_more',
|
|
39
|
+
:'next_offset' => :'next_offset',
|
|
40
|
+
:'include_inactive' => :'include_inactive'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'total' => :'Integer',
|
|
53
|
+
:'limit' => :'Integer',
|
|
54
|
+
:'offset' => :'Integer',
|
|
55
|
+
:'has_more' => :'Boolean',
|
|
56
|
+
:'next_offset' => :'Integer',
|
|
57
|
+
:'include_inactive' => :'Boolean'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
:'next_offset',
|
|
65
|
+
])
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Initializes the object
|
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
70
|
+
def initialize(attributes = {})
|
|
71
|
+
if (!attributes.is_a?(Hash))
|
|
72
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AccountDeviceListResponseMeta` initialize method"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AccountDeviceListResponseMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'total')
|
|
84
|
+
self.total = attributes[:'total']
|
|
85
|
+
else
|
|
86
|
+
self.total = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'limit')
|
|
90
|
+
self.limit = attributes[:'limit']
|
|
91
|
+
else
|
|
92
|
+
self.limit = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'offset')
|
|
96
|
+
self.offset = attributes[:'offset']
|
|
97
|
+
else
|
|
98
|
+
self.offset = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'has_more')
|
|
102
|
+
self.has_more = attributes[:'has_more']
|
|
103
|
+
else
|
|
104
|
+
self.has_more = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'next_offset')
|
|
108
|
+
self.next_offset = attributes[:'next_offset']
|
|
109
|
+
else
|
|
110
|
+
self.next_offset = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'include_inactive')
|
|
114
|
+
self.include_inactive = attributes[:'include_inactive']
|
|
115
|
+
else
|
|
116
|
+
self.include_inactive = nil
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
+
# @return Array for valid properties with the reasons
|
|
122
|
+
def list_invalid_properties
|
|
123
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
124
|
+
invalid_properties = Array.new
|
|
125
|
+
if @total.nil?
|
|
126
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if @limit.nil?
|
|
130
|
+
invalid_properties.push('invalid value for "limit", limit cannot be nil.')
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if @offset.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "offset", offset cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if @has_more.nil?
|
|
138
|
+
invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if @include_inactive.nil?
|
|
142
|
+
invalid_properties.push('invalid value for "include_inactive", include_inactive cannot be nil.')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
invalid_properties
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Check to see if the all the properties in the model are valid
|
|
149
|
+
# @return true if the model is valid
|
|
150
|
+
def valid?
|
|
151
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
152
|
+
return false if @total.nil?
|
|
153
|
+
return false if @limit.nil?
|
|
154
|
+
return false if @offset.nil?
|
|
155
|
+
return false if @has_more.nil?
|
|
156
|
+
return false if @include_inactive.nil?
|
|
157
|
+
true
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Checks equality by comparing each attribute.
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def ==(o)
|
|
163
|
+
return true if self.equal?(o)
|
|
164
|
+
self.class == o.class &&
|
|
165
|
+
total == o.total &&
|
|
166
|
+
limit == o.limit &&
|
|
167
|
+
offset == o.offset &&
|
|
168
|
+
has_more == o.has_more &&
|
|
169
|
+
next_offset == o.next_offset &&
|
|
170
|
+
include_inactive == o.include_inactive
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# @see the `==` method
|
|
174
|
+
# @param [Object] Object to be compared
|
|
175
|
+
def eql?(o)
|
|
176
|
+
self == o
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Calculates hash code according to all attributes.
|
|
180
|
+
# @return [Integer] Hash code
|
|
181
|
+
def hash
|
|
182
|
+
[total, limit, offset, has_more, next_offset, include_inactive].hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Builds the object from hash
|
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
187
|
+
# @return [Object] Returns the model itself
|
|
188
|
+
def self.build_from_hash(attributes)
|
|
189
|
+
return nil unless attributes.is_a?(Hash)
|
|
190
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
191
|
+
transformed_hash = {}
|
|
192
|
+
openapi_types.each_pair do |key, type|
|
|
193
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = nil
|
|
195
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
196
|
+
# check to ensure the input is an array given that the attribute
|
|
197
|
+
# is documented as an array but the input is not
|
|
198
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
199
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
200
|
+
end
|
|
201
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
202
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
new(transformed_hash)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Deserializes the data based on type
|
|
209
|
+
# @param string type Data type
|
|
210
|
+
# @param string value Value to be deserialized
|
|
211
|
+
# @return [Object] Deserialized data
|
|
212
|
+
def self._deserialize(type, value)
|
|
213
|
+
case type.to_sym
|
|
214
|
+
when :Time
|
|
215
|
+
Time.parse(value)
|
|
216
|
+
when :Date
|
|
217
|
+
Date.parse(value)
|
|
218
|
+
when :String
|
|
219
|
+
value.to_s
|
|
220
|
+
when :Integer
|
|
221
|
+
value.to_i
|
|
222
|
+
when :Float
|
|
223
|
+
value.to_f
|
|
224
|
+
when :Boolean
|
|
225
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
226
|
+
true
|
|
227
|
+
else
|
|
228
|
+
false
|
|
229
|
+
end
|
|
230
|
+
when :Object
|
|
231
|
+
# generic object (usually a Hash), return directly
|
|
232
|
+
value
|
|
233
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
234
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
235
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
236
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
237
|
+
k_type = Regexp.last_match[:k_type]
|
|
238
|
+
v_type = Regexp.last_match[:v_type]
|
|
239
|
+
{}.tap do |hash|
|
|
240
|
+
value.each do |k, v|
|
|
241
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
else # model
|
|
245
|
+
# models (e.g. Pet) or oneOf
|
|
246
|
+
klass = OpenapiClient.const_get(type)
|
|
247
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Returns the string representation of the object
|
|
252
|
+
# @return [String] String presentation of the object
|
|
253
|
+
def to_s
|
|
254
|
+
to_hash.to_s
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
|
259
|
+
def to_body
|
|
260
|
+
to_hash
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Returns the object in the form of hash
|
|
264
|
+
# @return [Hash] Returns the object in the form of hash
|
|
265
|
+
def to_hash
|
|
266
|
+
hash = {}
|
|
267
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
268
|
+
value = self.send(attr)
|
|
269
|
+
if value.nil?
|
|
270
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
271
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
hash[param] = _to_hash(value)
|
|
275
|
+
end
|
|
276
|
+
hash
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Outputs non-array value in the form of hash
|
|
280
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
281
|
+
# @param [Object] value Any valid value
|
|
282
|
+
# @return [Hash] Returns the value in the form of hash
|
|
283
|
+
def _to_hash(value)
|
|
284
|
+
if value.is_a?(Array)
|
|
285
|
+
value.compact.map { |v| _to_hash(v) }
|
|
286
|
+
elsif value.is_a?(Hash)
|
|
287
|
+
{}.tap do |hash|
|
|
288
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
289
|
+
end
|
|
290
|
+
elsif value.respond_to? :to_hash
|
|
291
|
+
value.to_hash
|
|
292
|
+
else
|
|
293
|
+
value
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
end
|
|
@@ -19,7 +19,7 @@ module OpenapiClient
|
|
|
19
19
|
|
|
20
20
|
attr_accessor :badge
|
|
21
21
|
|
|
22
|
-
# Number of devices whose App Icon Badge
|
|
22
|
+
# Number of devices whose App Icon Badge was updated.
|
|
23
23
|
attr_accessor :devices_updated
|
|
24
24
|
|
|
25
25
|
# Number of account users with at least one updated device.
|
|
@@ -14,8 +14,9 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module OpenapiClient
|
|
17
|
-
# Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without
|
|
17
|
+
# Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds or timer_end_at for countdowns, or set counts_down false without them for an open-ended elapsed timer. Add timer_start_at for a timer that started earlier. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
18
18
|
class ContentStateStart
|
|
19
|
+
# Title shown on the Live Activity. Send an empty string to show no title.
|
|
19
20
|
attr_accessor :title
|
|
20
21
|
|
|
21
22
|
attr_accessor :subtitle
|
|
@@ -35,9 +36,15 @@ module OpenapiClient
|
|
|
35
36
|
# Maximum progress value. Use with value for type=progress.
|
|
36
37
|
attr_accessor :upper_limit
|
|
37
38
|
|
|
38
|
-
# Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.
|
|
39
|
+
# Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted, unless you send timer_end_at. Counts from timer_start_at when you send it.
|
|
39
40
|
attr_accessor :duration_seconds
|
|
40
41
|
|
|
42
|
+
# Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
|
|
43
|
+
attr_accessor :timer_start_at
|
|
44
|
+
|
|
45
|
+
# Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both.
|
|
46
|
+
attr_accessor :timer_end_at
|
|
47
|
+
|
|
41
48
|
# Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
|
|
42
49
|
attr_accessor :counts_down
|
|
43
50
|
|
|
@@ -100,6 +107,8 @@ module OpenapiClient
|
|
|
100
107
|
:'value' => :'value',
|
|
101
108
|
:'upper_limit' => :'upper_limit',
|
|
102
109
|
:'duration_seconds' => :'duration_seconds',
|
|
110
|
+
:'timer_start_at' => :'timer_start_at',
|
|
111
|
+
:'timer_end_at' => :'timer_end_at',
|
|
103
112
|
:'counts_down' => :'counts_down',
|
|
104
113
|
:'is_running' => :'is_running',
|
|
105
114
|
:'metrics' => :'metrics',
|
|
@@ -129,6 +138,8 @@ module OpenapiClient
|
|
|
129
138
|
:'value' => :'LiveActivityValue',
|
|
130
139
|
:'upper_limit' => :'Float',
|
|
131
140
|
:'duration_seconds' => :'Float',
|
|
141
|
+
:'timer_start_at' => :'Time',
|
|
142
|
+
:'timer_end_at' => :'Time',
|
|
132
143
|
:'counts_down' => :'Boolean',
|
|
133
144
|
:'is_running' => :'Boolean',
|
|
134
145
|
:'metrics' => :'Array<ActivityMetric>',
|
|
@@ -197,6 +208,14 @@ module OpenapiClient
|
|
|
197
208
|
self.duration_seconds = attributes[:'duration_seconds']
|
|
198
209
|
end
|
|
199
210
|
|
|
211
|
+
if attributes.key?(:'timer_start_at')
|
|
212
|
+
self.timer_start_at = attributes[:'timer_start_at']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'timer_end_at')
|
|
216
|
+
self.timer_end_at = attributes[:'timer_end_at']
|
|
217
|
+
end
|
|
218
|
+
|
|
200
219
|
if attributes.key?(:'counts_down')
|
|
201
220
|
self.counts_down = attributes[:'counts_down']
|
|
202
221
|
else
|
|
@@ -435,6 +454,8 @@ module OpenapiClient
|
|
|
435
454
|
value == o.value &&
|
|
436
455
|
upper_limit == o.upper_limit &&
|
|
437
456
|
duration_seconds == o.duration_seconds &&
|
|
457
|
+
timer_start_at == o.timer_start_at &&
|
|
458
|
+
timer_end_at == o.timer_end_at &&
|
|
438
459
|
counts_down == o.counts_down &&
|
|
439
460
|
is_running == o.is_running &&
|
|
440
461
|
metrics == o.metrics &&
|
|
@@ -456,7 +477,7 @@ module OpenapiClient
|
|
|
456
477
|
# Calculates hash code according to all attributes.
|
|
457
478
|
# @return [Integer] Hash code
|
|
458
479
|
def hash
|
|
459
|
-
[title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors].hash
|
|
480
|
+
[title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, timer_start_at, timer_end_at, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors].hash
|
|
460
481
|
end
|
|
461
482
|
|
|
462
483
|
# Builds the object from hash
|
|
@@ -16,6 +16,7 @@ require 'time'
|
|
|
16
16
|
module OpenapiClient
|
|
17
17
|
# Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
|
|
18
18
|
class ContentStateUpdate
|
|
19
|
+
# Title shown on the Live Activity. Send an empty string to show no title.
|
|
19
20
|
attr_accessor :title
|
|
20
21
|
|
|
21
22
|
attr_accessor :subtitle
|
|
@@ -35,9 +36,15 @@ module OpenapiClient
|
|
|
35
36
|
# Maximum progress value. Use with value for type=progress.
|
|
36
37
|
attr_accessor :upper_limit
|
|
37
38
|
|
|
38
|
-
# Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time
|
|
39
|
+
# Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time, or from timer_start_at when you send it. Omit it to preserve the existing timer window.
|
|
39
40
|
attr_accessor :duration_seconds
|
|
40
41
|
|
|
42
|
+
# Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
|
|
43
|
+
attr_accessor :timer_start_at
|
|
44
|
+
|
|
45
|
+
# Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. Send timer_end_at alone to move the end and keep the current start.
|
|
46
|
+
attr_accessor :timer_end_at
|
|
47
|
+
|
|
41
48
|
# Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
|
|
42
49
|
attr_accessor :counts_down
|
|
43
50
|
|
|
@@ -101,6 +108,8 @@ module OpenapiClient
|
|
|
101
108
|
:'value' => :'value',
|
|
102
109
|
:'upper_limit' => :'upper_limit',
|
|
103
110
|
:'duration_seconds' => :'duration_seconds',
|
|
111
|
+
:'timer_start_at' => :'timer_start_at',
|
|
112
|
+
:'timer_end_at' => :'timer_end_at',
|
|
104
113
|
:'counts_down' => :'counts_down',
|
|
105
114
|
:'is_running' => :'is_running',
|
|
106
115
|
:'metrics' => :'metrics',
|
|
@@ -130,6 +139,8 @@ module OpenapiClient
|
|
|
130
139
|
:'value' => :'LiveActivityValue',
|
|
131
140
|
:'upper_limit' => :'Float',
|
|
132
141
|
:'duration_seconds' => :'Float',
|
|
142
|
+
:'timer_start_at' => :'Time',
|
|
143
|
+
:'timer_end_at' => :'Time',
|
|
133
144
|
:'counts_down' => :'Boolean',
|
|
134
145
|
:'is_running' => :'Boolean',
|
|
135
146
|
:'metrics' => :'Array<ActivityMetric>',
|
|
@@ -198,6 +209,14 @@ module OpenapiClient
|
|
|
198
209
|
self.duration_seconds = attributes[:'duration_seconds']
|
|
199
210
|
end
|
|
200
211
|
|
|
212
|
+
if attributes.key?(:'timer_start_at')
|
|
213
|
+
self.timer_start_at = attributes[:'timer_start_at']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if attributes.key?(:'timer_end_at')
|
|
217
|
+
self.timer_end_at = attributes[:'timer_end_at']
|
|
218
|
+
end
|
|
219
|
+
|
|
201
220
|
if attributes.key?(:'counts_down')
|
|
202
221
|
self.counts_down = attributes[:'counts_down']
|
|
203
222
|
else
|
|
@@ -429,6 +448,8 @@ module OpenapiClient
|
|
|
429
448
|
value == o.value &&
|
|
430
449
|
upper_limit == o.upper_limit &&
|
|
431
450
|
duration_seconds == o.duration_seconds &&
|
|
451
|
+
timer_start_at == o.timer_start_at &&
|
|
452
|
+
timer_end_at == o.timer_end_at &&
|
|
432
453
|
counts_down == o.counts_down &&
|
|
433
454
|
is_running == o.is_running &&
|
|
434
455
|
metrics == o.metrics &&
|
|
@@ -450,7 +471,7 @@ module OpenapiClient
|
|
|
450
471
|
# Calculates hash code according to all attributes.
|
|
451
472
|
# @return [Integer] Hash code
|
|
452
473
|
def hash
|
|
453
|
-
[title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors].hash
|
|
474
|
+
[title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, duration_seconds, timer_start_at, timer_end_at, counts_down, is_running, metrics, message, icon, badge, type, color, step_color, step_colors].hash
|
|
454
475
|
end
|
|
455
476
|
|
|
456
477
|
# Builds the object from hash
|
|
@@ -31,6 +31,9 @@ module OpenapiClient
|
|
|
31
31
|
# Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
|
|
32
32
|
attr_accessor :secondary_action
|
|
33
33
|
|
|
34
|
+
# Optional sound for the end. Ends are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
35
|
+
attr_accessor :sound
|
|
36
|
+
|
|
34
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
38
|
def self.attribute_map
|
|
36
39
|
{
|
|
@@ -39,7 +42,8 @@ module OpenapiClient
|
|
|
39
42
|
:'tags' => :'tags',
|
|
40
43
|
:'content_state' => :'content_state',
|
|
41
44
|
:'action' => :'action',
|
|
42
|
-
:'secondary_action' => :'secondary_action'
|
|
45
|
+
:'secondary_action' => :'secondary_action',
|
|
46
|
+
:'sound' => :'sound'
|
|
43
47
|
}
|
|
44
48
|
end
|
|
45
49
|
|
|
@@ -56,7 +60,8 @@ module OpenapiClient
|
|
|
56
60
|
:'tags' => :'Array<String>',
|
|
57
61
|
:'content_state' => :'ContentStateEnd',
|
|
58
62
|
:'action' => :'LiveActivityAction',
|
|
59
|
-
:'secondary_action' => :'LiveActivityAction'
|
|
63
|
+
:'secondary_action' => :'LiveActivityAction',
|
|
64
|
+
:'sound' => :'String'
|
|
60
65
|
}
|
|
61
66
|
end
|
|
62
67
|
|
|
@@ -112,6 +117,10 @@ module OpenapiClient
|
|
|
112
117
|
if attributes.key?(:'secondary_action')
|
|
113
118
|
self.secondary_action = attributes[:'secondary_action']
|
|
114
119
|
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'sound')
|
|
122
|
+
self.sound = attributes[:'sound']
|
|
123
|
+
end
|
|
115
124
|
end
|
|
116
125
|
|
|
117
126
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -135,6 +144,14 @@ module OpenapiClient
|
|
|
135
144
|
invalid_properties.push('invalid value for "content_state", content_state cannot be nil.')
|
|
136
145
|
end
|
|
137
146
|
|
|
147
|
+
if !@sound.nil? && @sound.to_s.length > 50
|
|
148
|
+
invalid_properties.push('invalid value for "sound", the character length must be smaller than or equal to 50.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if !@sound.nil? && @sound.to_s.length < 1
|
|
152
|
+
invalid_properties.push('invalid value for "sound", the character length must be great than or equal to 1.')
|
|
153
|
+
end
|
|
154
|
+
|
|
138
155
|
invalid_properties
|
|
139
156
|
end
|
|
140
157
|
|
|
@@ -146,6 +163,8 @@ module OpenapiClient
|
|
|
146
163
|
return false if @activity_id.nil?
|
|
147
164
|
return false if !@tags.nil? && @tags.length > 20
|
|
148
165
|
return false if @content_state.nil?
|
|
166
|
+
return false if !@sound.nil? && @sound.to_s.length > 50
|
|
167
|
+
return false if !@sound.nil? && @sound.to_s.length < 1
|
|
149
168
|
true
|
|
150
169
|
end
|
|
151
170
|
|
|
@@ -177,6 +196,24 @@ module OpenapiClient
|
|
|
177
196
|
@tags = tags
|
|
178
197
|
end
|
|
179
198
|
|
|
199
|
+
# Custom attribute writer method with validation
|
|
200
|
+
# @param [Object] sound Value to be assigned
|
|
201
|
+
def sound=(sound)
|
|
202
|
+
if sound.nil?
|
|
203
|
+
fail ArgumentError, 'sound cannot be nil'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if sound.to_s.length > 50
|
|
207
|
+
fail ArgumentError, 'invalid value for "sound", the character length must be smaller than or equal to 50.'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if sound.to_s.length < 1
|
|
211
|
+
fail ArgumentError, 'invalid value for "sound", the character length must be great than or equal to 1.'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@sound = sound
|
|
215
|
+
end
|
|
216
|
+
|
|
180
217
|
# Checks equality by comparing each attribute.
|
|
181
218
|
# @param [Object] Object to be compared
|
|
182
219
|
def ==(o)
|
|
@@ -187,7 +224,8 @@ module OpenapiClient
|
|
|
187
224
|
tags == o.tags &&
|
|
188
225
|
content_state == o.content_state &&
|
|
189
226
|
action == o.action &&
|
|
190
|
-
secondary_action == o.secondary_action
|
|
227
|
+
secondary_action == o.secondary_action &&
|
|
228
|
+
sound == o.sound
|
|
191
229
|
end
|
|
192
230
|
|
|
193
231
|
# @see the `==` method
|
|
@@ -199,7 +237,7 @@ module OpenapiClient
|
|
|
199
237
|
# Calculates hash code according to all attributes.
|
|
200
238
|
# @return [Integer] Hash code
|
|
201
239
|
def hash
|
|
202
|
-
[metadata, activity_id, tags, content_state, action, secondary_action].hash
|
|
240
|
+
[metadata, activity_id, tags, content_state, action, secondary_action, sound].hash
|
|
203
241
|
end
|
|
204
242
|
|
|
205
243
|
# Builds the object from hash
|
|
@@ -33,6 +33,9 @@ module OpenapiClient
|
|
|
33
33
|
# Optional tags to organize and filter notification history.
|
|
34
34
|
attr_accessor :tags
|
|
35
35
|
|
|
36
|
+
# Optional sound for the start. Omit it to play the Live Activities sound picked on the device. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
37
|
+
attr_accessor :sound
|
|
38
|
+
|
|
36
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
40
|
def self.attribute_map
|
|
38
41
|
{
|
|
@@ -42,7 +45,8 @@ module OpenapiClient
|
|
|
42
45
|
:'secondary_action' => :'secondary_action',
|
|
43
46
|
:'alert' => :'alert',
|
|
44
47
|
:'target' => :'target',
|
|
45
|
-
:'tags' => :'tags'
|
|
48
|
+
:'tags' => :'tags',
|
|
49
|
+
:'sound' => :'sound'
|
|
46
50
|
}
|
|
47
51
|
end
|
|
48
52
|
|
|
@@ -60,7 +64,8 @@ module OpenapiClient
|
|
|
60
64
|
:'secondary_action' => :'LiveActivityAction',
|
|
61
65
|
:'alert' => :'AlertPayload',
|
|
62
66
|
:'target' => :'ChannelTarget',
|
|
63
|
-
:'tags' => :'Array<String>'
|
|
67
|
+
:'tags' => :'Array<String>',
|
|
68
|
+
:'sound' => :'String'
|
|
64
69
|
}
|
|
65
70
|
end
|
|
66
71
|
|
|
@@ -118,6 +123,10 @@ module OpenapiClient
|
|
|
118
123
|
self.tags = value
|
|
119
124
|
end
|
|
120
125
|
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'sound')
|
|
128
|
+
self.sound = attributes[:'sound']
|
|
129
|
+
end
|
|
121
130
|
end
|
|
122
131
|
|
|
123
132
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -133,6 +142,14 @@ module OpenapiClient
|
|
|
133
142
|
invalid_properties.push('invalid value for "content_state", content_state cannot be nil.')
|
|
134
143
|
end
|
|
135
144
|
|
|
145
|
+
if !@sound.nil? && @sound.to_s.length > 50
|
|
146
|
+
invalid_properties.push('invalid value for "sound", the character length must be smaller than or equal to 50.')
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if !@sound.nil? && @sound.to_s.length < 1
|
|
150
|
+
invalid_properties.push('invalid value for "sound", the character length must be great than or equal to 1.')
|
|
151
|
+
end
|
|
152
|
+
|
|
136
153
|
invalid_properties
|
|
137
154
|
end
|
|
138
155
|
|
|
@@ -142,6 +159,8 @@ module OpenapiClient
|
|
|
142
159
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
143
160
|
return false if !@metadata.nil? && @metadata.length > 50
|
|
144
161
|
return false if @content_state.nil?
|
|
162
|
+
return false if !@sound.nil? && @sound.to_s.length > 50
|
|
163
|
+
return false if !@sound.nil? && @sound.to_s.length < 1
|
|
145
164
|
true
|
|
146
165
|
end
|
|
147
166
|
|
|
@@ -159,6 +178,24 @@ module OpenapiClient
|
|
|
159
178
|
@metadata = metadata
|
|
160
179
|
end
|
|
161
180
|
|
|
181
|
+
# Custom attribute writer method with validation
|
|
182
|
+
# @param [Object] sound Value to be assigned
|
|
183
|
+
def sound=(sound)
|
|
184
|
+
if sound.nil?
|
|
185
|
+
fail ArgumentError, 'sound cannot be nil'
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if sound.to_s.length > 50
|
|
189
|
+
fail ArgumentError, 'invalid value for "sound", the character length must be smaller than or equal to 50.'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if sound.to_s.length < 1
|
|
193
|
+
fail ArgumentError, 'invalid value for "sound", the character length must be great than or equal to 1.'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@sound = sound
|
|
197
|
+
end
|
|
198
|
+
|
|
162
199
|
# Checks equality by comparing each attribute.
|
|
163
200
|
# @param [Object] Object to be compared
|
|
164
201
|
def ==(o)
|
|
@@ -170,7 +207,8 @@ module OpenapiClient
|
|
|
170
207
|
secondary_action == o.secondary_action &&
|
|
171
208
|
alert == o.alert &&
|
|
172
209
|
target == o.target &&
|
|
173
|
-
tags == o.tags
|
|
210
|
+
tags == o.tags &&
|
|
211
|
+
sound == o.sound
|
|
174
212
|
end
|
|
175
213
|
|
|
176
214
|
# @see the `==` method
|
|
@@ -182,7 +220,7 @@ module OpenapiClient
|
|
|
182
220
|
# Calculates hash code according to all attributes.
|
|
183
221
|
# @return [Integer] Hash code
|
|
184
222
|
def hash
|
|
185
|
-
[metadata, content_state, action, secondary_action, alert, target, tags].hash
|
|
223
|
+
[metadata, content_state, action, secondary_action, alert, target, tags, sound].hash
|
|
186
224
|
end
|
|
187
225
|
|
|
188
226
|
# Builds the object from hash
|