activitysmith 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +113 -18
  3. data/generated/activitysmith_openapi/api/app_icon_badges_api.rb +90 -0
  4. data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
  5. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_request.rb +260 -0
  6. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +331 -0
  7. data/generated/activitysmith_openapi/models/content_state_end.rb +1 -1
  8. data/generated/activitysmith_openapi/models/content_state_start.rb +1 -1
  9. data/generated/activitysmith_openapi/models/content_state_update.rb +1 -1
  10. data/generated/activitysmith_openapi/models/live_activity_action.rb +3 -5
  11. data/generated/activitysmith_openapi/models/live_activity_end_request.rb +14 -4
  12. data/generated/activitysmith_openapi/models/live_activity_start_request.rb +11 -1
  13. data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +11 -1
  14. data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +11 -1
  15. data/generated/activitysmith_openapi/models/live_activity_update_request.rb +14 -4
  16. data/generated/activitysmith_openapi/models/push_notification_action.rb +2 -4
  17. data/generated/activitysmith_openapi/models/push_notification_request.rb +2 -4
  18. data/generated/activitysmith_openapi/models/stream_content_state.rb +1 -1
  19. data/generated/activitysmith_openapi/version.rb +1 -1
  20. data/generated/activitysmith_openapi.rb +3 -0
  21. data/lib/activitysmith/client.rb +15 -1
  22. data/lib/activitysmith/version.rb +1 -1
  23. metadata +5 -2
@@ -0,0 +1,331 @@
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 AppIconBadgeCountUpdateResponse
18
+ attr_accessor :success
19
+
20
+ attr_accessor :badge
21
+
22
+ attr_accessor :devices_notified
23
+
24
+ attr_accessor :users_notified
25
+
26
+ attr_accessor :effective_channel_slugs
27
+
28
+ attr_accessor :timestamp
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'success' => :'success',
34
+ :'badge' => :'badge',
35
+ :'devices_notified' => :'devices_notified',
36
+ :'users_notified' => :'users_notified',
37
+ :'effective_channel_slugs' => :'effective_channel_slugs',
38
+ :'timestamp' => :'timestamp'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'success' => :'Boolean',
51
+ :'badge' => :'Integer',
52
+ :'devices_notified' => :'Integer',
53
+ :'users_notified' => :'Integer',
54
+ :'effective_channel_slugs' => :'Array<String>',
55
+ :'timestamp' => :'Time'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AppIconBadgeCountUpdateResponse` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AppIconBadgeCountUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'success')
81
+ self.success = attributes[:'success']
82
+ else
83
+ self.success = nil
84
+ end
85
+
86
+ if attributes.key?(:'badge')
87
+ self.badge = attributes[:'badge']
88
+ else
89
+ self.badge = nil
90
+ end
91
+
92
+ if attributes.key?(:'devices_notified')
93
+ self.devices_notified = attributes[:'devices_notified']
94
+ else
95
+ self.devices_notified = nil
96
+ end
97
+
98
+ if attributes.key?(:'users_notified')
99
+ self.users_notified = attributes[:'users_notified']
100
+ else
101
+ self.users_notified = nil
102
+ end
103
+
104
+ if attributes.key?(:'effective_channel_slugs')
105
+ if (value = attributes[:'effective_channel_slugs']).is_a?(Array)
106
+ self.effective_channel_slugs = value
107
+ end
108
+ else
109
+ self.effective_channel_slugs = nil
110
+ end
111
+
112
+ if attributes.key?(:'timestamp')
113
+ self.timestamp = attributes[:'timestamp']
114
+ else
115
+ self.timestamp = nil
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ if @success.nil?
125
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
126
+ end
127
+
128
+ if @badge.nil?
129
+ invalid_properties.push('invalid value for "badge", badge cannot be nil.')
130
+ end
131
+
132
+ if @badge > 2147483647
133
+ invalid_properties.push('invalid value for "badge", must be smaller than or equal to 2147483647.')
134
+ end
135
+
136
+ if @badge < 0
137
+ invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.')
138
+ end
139
+
140
+ if @devices_notified.nil?
141
+ invalid_properties.push('invalid value for "devices_notified", devices_notified cannot be nil.')
142
+ end
143
+
144
+ if @users_notified.nil?
145
+ invalid_properties.push('invalid value for "users_notified", users_notified cannot be nil.')
146
+ end
147
+
148
+ if @effective_channel_slugs.nil?
149
+ invalid_properties.push('invalid value for "effective_channel_slugs", effective_channel_slugs cannot be nil.')
150
+ end
151
+
152
+ if @timestamp.nil?
153
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
154
+ end
155
+
156
+ invalid_properties
157
+ end
158
+
159
+ # Check to see if the all the properties in the model are valid
160
+ # @return true if the model is valid
161
+ def valid?
162
+ warn '[DEPRECATED] the `valid?` method is obsolete'
163
+ return false if @success.nil?
164
+ return false if @badge.nil?
165
+ return false if @badge > 2147483647
166
+ return false if @badge < 0
167
+ return false if @devices_notified.nil?
168
+ return false if @users_notified.nil?
169
+ return false if @effective_channel_slugs.nil?
170
+ return false if @timestamp.nil?
171
+ true
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] badge Value to be assigned
176
+ def badge=(badge)
177
+ if badge.nil?
178
+ fail ArgumentError, 'badge cannot be nil'
179
+ end
180
+
181
+ if badge > 2147483647
182
+ fail ArgumentError, 'invalid value for "badge", must be smaller than or equal to 2147483647.'
183
+ end
184
+
185
+ if badge < 0
186
+ fail ArgumentError, 'invalid value for "badge", must be greater than or equal to 0.'
187
+ end
188
+
189
+ @badge = badge
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(o)
195
+ return true if self.equal?(o)
196
+ self.class == o.class &&
197
+ success == o.success &&
198
+ badge == o.badge &&
199
+ devices_notified == o.devices_notified &&
200
+ users_notified == o.users_notified &&
201
+ effective_channel_slugs == o.effective_channel_slugs &&
202
+ timestamp == o.timestamp
203
+ end
204
+
205
+ # @see the `==` method
206
+ # @param [Object] Object to be compared
207
+ def eql?(o)
208
+ self == o
209
+ end
210
+
211
+ # Calculates hash code according to all attributes.
212
+ # @return [Integer] Hash code
213
+ def hash
214
+ [success, badge, devices_notified, users_notified, effective_channel_slugs, timestamp].hash
215
+ end
216
+
217
+ # Builds the object from hash
218
+ # @param [Hash] attributes Model attributes in the form of hash
219
+ # @return [Object] Returns the model itself
220
+ def self.build_from_hash(attributes)
221
+ return nil unless attributes.is_a?(Hash)
222
+ attributes = attributes.transform_keys(&:to_sym)
223
+ transformed_hash = {}
224
+ openapi_types.each_pair do |key, type|
225
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
226
+ transformed_hash["#{key}"] = nil
227
+ elsif type =~ /\AArray<(.*)>/i
228
+ # check to ensure the input is an array given that the attribute
229
+ # is documented as an array but the input is not
230
+ if attributes[attribute_map[key]].is_a?(Array)
231
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
232
+ end
233
+ elsif !attributes[attribute_map[key]].nil?
234
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
235
+ end
236
+ end
237
+ new(transformed_hash)
238
+ end
239
+
240
+ # Deserializes the data based on type
241
+ # @param string type Data type
242
+ # @param string value Value to be deserialized
243
+ # @return [Object] Deserialized data
244
+ def self._deserialize(type, value)
245
+ case type.to_sym
246
+ when :Time
247
+ Time.parse(value)
248
+ when :Date
249
+ Date.parse(value)
250
+ when :String
251
+ value.to_s
252
+ when :Integer
253
+ value.to_i
254
+ when :Float
255
+ value.to_f
256
+ when :Boolean
257
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
258
+ true
259
+ else
260
+ false
261
+ end
262
+ when :Object
263
+ # generic object (usually a Hash), return directly
264
+ value
265
+ when /\AArray<(?<inner_type>.+)>\z/
266
+ inner_type = Regexp.last_match[:inner_type]
267
+ value.map { |v| _deserialize(inner_type, v) }
268
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
269
+ k_type = Regexp.last_match[:k_type]
270
+ v_type = Regexp.last_match[:v_type]
271
+ {}.tap do |hash|
272
+ value.each do |k, v|
273
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
274
+ end
275
+ end
276
+ else # model
277
+ # models (e.g. Pet) or oneOf
278
+ klass = OpenapiClient.const_get(type)
279
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
280
+ end
281
+ end
282
+
283
+ # Returns the string representation of the object
284
+ # @return [String] String presentation of the object
285
+ def to_s
286
+ to_hash.to_s
287
+ end
288
+
289
+ # to_body is an alias to to_hash (backward compatibility)
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_body
292
+ to_hash
293
+ end
294
+
295
+ # Returns the object in the form of hash
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_hash
298
+ hash = {}
299
+ self.class.attribute_map.each_pair do |attr, param|
300
+ value = self.send(attr)
301
+ if value.nil?
302
+ is_nullable = self.class.openapi_nullable.include?(attr)
303
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
304
+ end
305
+
306
+ hash[param] = _to_hash(value)
307
+ end
308
+ hash
309
+ end
310
+
311
+ # Outputs non-array value in the form of hash
312
+ # For object, use to_hash. Otherwise, just return the value
313
+ # @param [Object] value Any valid value
314
+ # @return [Hash] Returns the value in the form of hash
315
+ def _to_hash(value)
316
+ if value.is_a?(Array)
317
+ value.compact.map { |v| _to_hash(v) }
318
+ elsif value.is_a?(Hash)
319
+ {}.tap do |hash|
320
+ value.each { |k, v| hash[k] = _to_hash(v) }
321
+ end
322
+ elsif value.respond_to? :to_hash
323
+ value.to_hash
324
+ else
325
+ value
326
+ end
327
+ end
328
+
329
+ end
330
+
331
+ end
@@ -59,7 +59,7 @@ module OpenapiClient
59
59
  # Optional. When omitted, the API uses the existing Live Activity type.
60
60
  attr_accessor :type
61
61
 
62
- # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
62
+ # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
63
63
  attr_accessor :color
64
64
 
65
65
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -58,7 +58,7 @@ module OpenapiClient
58
58
 
59
59
  attr_accessor :type
60
60
 
61
- # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
61
+ # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
62
62
  attr_accessor :color
63
63
 
64
64
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -59,7 +59,7 @@ module OpenapiClient
59
59
  # Optional. When omitted, the API uses the existing Live Activity type.
60
60
  attr_accessor :type
61
61
 
62
- # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
62
+ # Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
63
63
  attr_accessor :color
64
64
 
65
65
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # Optional single action button shown in the Live Activity UI.
17
+ # Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, and segmented_progress Live Activities.
18
18
  class LiveActivityAction
19
19
  # Button title displayed in the Live Activity UI.
20
20
  attr_accessor :title
@@ -53,7 +53,7 @@ module OpenapiClient
53
53
  :'type' => :'LiveActivityActionType',
54
54
  :'url' => :'String',
55
55
  :'method' => :'LiveActivityWebhookMethod',
56
- :'body' => :'Hash<String, Object>'
56
+ :'body' => :'Object'
57
57
  }
58
58
  end
59
59
 
@@ -103,9 +103,7 @@ module OpenapiClient
103
103
  end
104
104
 
105
105
  if attributes.key?(:'body')
106
- if (value = attributes[:'body']).is_a?(Hash)
107
- self.body = value
108
- end
106
+ self.body = attributes[:'body']
109
107
  end
110
108
  end
111
109
 
@@ -22,12 +22,16 @@ module OpenapiClient
22
22
 
23
23
  attr_accessor :action
24
24
 
25
+ # Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
26
+ attr_accessor :secondary_action
27
+
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
26
29
  def self.attribute_map
27
30
  {
28
31
  :'activity_id' => :'activity_id',
29
32
  :'content_state' => :'content_state',
30
- :'action' => :'action'
33
+ :'action' => :'action',
34
+ :'secondary_action' => :'secondary_action'
31
35
  }
32
36
  end
33
37
 
@@ -41,7 +45,8 @@ module OpenapiClient
41
45
  {
42
46
  :'activity_id' => :'String',
43
47
  :'content_state' => :'ContentStateEnd',
44
- :'action' => :'LiveActivityAction'
48
+ :'action' => :'LiveActivityAction',
49
+ :'secondary_action' => :'LiveActivityAction'
45
50
  }
46
51
  end
47
52
 
@@ -81,6 +86,10 @@ module OpenapiClient
81
86
  if attributes.key?(:'action')
82
87
  self.action = attributes[:'action']
83
88
  end
89
+
90
+ if attributes.key?(:'secondary_action')
91
+ self.secondary_action = attributes[:'secondary_action']
92
+ end
84
93
  end
85
94
 
86
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -115,7 +124,8 @@ module OpenapiClient
115
124
  self.class == o.class &&
116
125
  activity_id == o.activity_id &&
117
126
  content_state == o.content_state &&
118
- action == o.action
127
+ action == o.action &&
128
+ secondary_action == o.secondary_action
119
129
  end
120
130
 
121
131
  # @see the `==` method
@@ -127,7 +137,7 @@ module OpenapiClient
127
137
  # Calculates hash code according to all attributes.
128
138
  # @return [Integer] Hash code
129
139
  def hash
130
- [activity_id, content_state, action].hash
140
+ [activity_id, content_state, action, secondary_action].hash
131
141
  end
132
142
 
133
143
  # Builds the object from hash
@@ -20,6 +20,9 @@ module OpenapiClient
20
20
 
21
21
  attr_accessor :action
22
22
 
23
+ # Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
24
+ attr_accessor :secondary_action
25
+
23
26
  attr_accessor :alert
24
27
 
25
28
  attr_accessor :target
@@ -29,6 +32,7 @@ module OpenapiClient
29
32
  {
30
33
  :'content_state' => :'content_state',
31
34
  :'action' => :'action',
35
+ :'secondary_action' => :'secondary_action',
32
36
  :'alert' => :'alert',
33
37
  :'target' => :'target'
34
38
  }
@@ -44,6 +48,7 @@ module OpenapiClient
44
48
  {
45
49
  :'content_state' => :'ContentStateStart',
46
50
  :'action' => :'LiveActivityAction',
51
+ :'secondary_action' => :'LiveActivityAction',
47
52
  :'alert' => :'AlertPayload',
48
53
  :'target' => :'ChannelTarget'
49
54
  }
@@ -80,6 +85,10 @@ module OpenapiClient
80
85
  self.action = attributes[:'action']
81
86
  end
82
87
 
88
+ if attributes.key?(:'secondary_action')
89
+ self.secondary_action = attributes[:'secondary_action']
90
+ end
91
+
83
92
  if attributes.key?(:'alert')
84
93
  self.alert = attributes[:'alert']
85
94
  end
@@ -116,6 +125,7 @@ module OpenapiClient
116
125
  self.class == o.class &&
117
126
  content_state == o.content_state &&
118
127
  action == o.action &&
128
+ secondary_action == o.secondary_action &&
119
129
  alert == o.alert &&
120
130
  target == o.target
121
131
  end
@@ -129,7 +139,7 @@ module OpenapiClient
129
139
  # Calculates hash code according to all attributes.
130
140
  # @return [Integer] Hash code
131
141
  def hash
132
- [content_state, action, alert, target].hash
142
+ [content_state, action, secondary_action, alert, target].hash
133
143
  end
134
144
 
135
145
  # Builds the object from hash
@@ -20,6 +20,9 @@ module OpenapiClient
20
20
 
21
21
  attr_accessor :action
22
22
 
23
+ # Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
24
+ attr_accessor :secondary_action
25
+
23
26
  attr_accessor :alert
24
27
 
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -27,6 +30,7 @@ module OpenapiClient
27
30
  {
28
31
  :'content_state' => :'content_state',
29
32
  :'action' => :'action',
33
+ :'secondary_action' => :'secondary_action',
30
34
  :'alert' => :'alert'
31
35
  }
32
36
  end
@@ -41,6 +45,7 @@ module OpenapiClient
41
45
  {
42
46
  :'content_state' => :'StreamContentState',
43
47
  :'action' => :'LiveActivityAction',
48
+ :'secondary_action' => :'LiveActivityAction',
44
49
  :'alert' => :'AlertPayload'
45
50
  }
46
51
  end
@@ -74,6 +79,10 @@ module OpenapiClient
74
79
  self.action = attributes[:'action']
75
80
  end
76
81
 
82
+ if attributes.key?(:'secondary_action')
83
+ self.secondary_action = attributes[:'secondary_action']
84
+ end
85
+
77
86
  if attributes.key?(:'alert')
78
87
  self.alert = attributes[:'alert']
79
88
  end
@@ -101,6 +110,7 @@ module OpenapiClient
101
110
  self.class == o.class &&
102
111
  content_state == o.content_state &&
103
112
  action == o.action &&
113
+ secondary_action == o.secondary_action &&
104
114
  alert == o.alert
105
115
  end
106
116
 
@@ -113,7 +123,7 @@ module OpenapiClient
113
123
  # Calculates hash code according to all attributes.
114
124
  # @return [Integer] Hash code
115
125
  def hash
116
- [content_state, action, alert].hash
126
+ [content_state, action, secondary_action, alert].hash
117
127
  end
118
128
 
119
129
  # Builds the object from hash
@@ -20,6 +20,9 @@ module OpenapiClient
20
20
 
21
21
  attr_accessor :action
22
22
 
23
+ # Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
24
+ attr_accessor :secondary_action
25
+
23
26
  attr_accessor :alert
24
27
 
25
28
  # Channel slugs. When omitted, API key scope determines recipients.
@@ -32,6 +35,7 @@ module OpenapiClient
32
35
  {
33
36
  :'content_state' => :'content_state',
34
37
  :'action' => :'action',
38
+ :'secondary_action' => :'secondary_action',
35
39
  :'alert' => :'alert',
36
40
  :'channels' => :'channels',
37
41
  :'target' => :'target'
@@ -48,6 +52,7 @@ module OpenapiClient
48
52
  {
49
53
  :'content_state' => :'StreamContentState',
50
54
  :'action' => :'LiveActivityAction',
55
+ :'secondary_action' => :'LiveActivityAction',
51
56
  :'alert' => :'AlertPayload',
52
57
  :'channels' => :'Array<String>',
53
58
  :'target' => :'ChannelTarget'
@@ -85,6 +90,10 @@ module OpenapiClient
85
90
  self.action = attributes[:'action']
86
91
  end
87
92
 
93
+ if attributes.key?(:'secondary_action')
94
+ self.secondary_action = attributes[:'secondary_action']
95
+ end
96
+
88
97
  if attributes.key?(:'alert')
89
98
  self.alert = attributes[:'alert']
90
99
  end
@@ -146,6 +155,7 @@ module OpenapiClient
146
155
  self.class == o.class &&
147
156
  content_state == o.content_state &&
148
157
  action == o.action &&
158
+ secondary_action == o.secondary_action &&
149
159
  alert == o.alert &&
150
160
  channels == o.channels &&
151
161
  target == o.target
@@ -160,7 +170,7 @@ module OpenapiClient
160
170
  # Calculates hash code according to all attributes.
161
171
  # @return [Integer] Hash code
162
172
  def hash
163
- [content_state, action, alert, channels, target].hash
173
+ [content_state, action, secondary_action, alert, channels, target].hash
164
174
  end
165
175
 
166
176
  # Builds the object from hash
@@ -22,12 +22,16 @@ module OpenapiClient
22
22
 
23
23
  attr_accessor :action
24
24
 
25
+ # Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
26
+ attr_accessor :secondary_action
27
+
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
26
29
  def self.attribute_map
27
30
  {
28
31
  :'activity_id' => :'activity_id',
29
32
  :'content_state' => :'content_state',
30
- :'action' => :'action'
33
+ :'action' => :'action',
34
+ :'secondary_action' => :'secondary_action'
31
35
  }
32
36
  end
33
37
 
@@ -41,7 +45,8 @@ module OpenapiClient
41
45
  {
42
46
  :'activity_id' => :'String',
43
47
  :'content_state' => :'ContentStateUpdate',
44
- :'action' => :'LiveActivityAction'
48
+ :'action' => :'LiveActivityAction',
49
+ :'secondary_action' => :'LiveActivityAction'
45
50
  }
46
51
  end
47
52
 
@@ -81,6 +86,10 @@ module OpenapiClient
81
86
  if attributes.key?(:'action')
82
87
  self.action = attributes[:'action']
83
88
  end
89
+
90
+ if attributes.key?(:'secondary_action')
91
+ self.secondary_action = attributes[:'secondary_action']
92
+ end
84
93
  end
85
94
 
86
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -115,7 +124,8 @@ module OpenapiClient
115
124
  self.class == o.class &&
116
125
  activity_id == o.activity_id &&
117
126
  content_state == o.content_state &&
118
- action == o.action
127
+ action == o.action &&
128
+ secondary_action == o.secondary_action
119
129
  end
120
130
 
121
131
  # @see the `==` method
@@ -127,7 +137,7 @@ module OpenapiClient
127
137
  # Calculates hash code according to all attributes.
128
138
  # @return [Integer] Hash code
129
139
  def hash
130
- [activity_id, content_state, action].hash
140
+ [activity_id, content_state, action, secondary_action].hash
131
141
  end
132
142
 
133
143
  # Builds the object from hash
@@ -52,7 +52,7 @@ module OpenapiClient
52
52
  :'type' => :'PushNotificationActionType',
53
53
  :'url' => :'String',
54
54
  :'method' => :'PushNotificationWebhookMethod',
55
- :'body' => :'Hash<String, Object>'
55
+ :'body' => :'Object'
56
56
  }
57
57
  end
58
58
 
@@ -102,9 +102,7 @@ module OpenapiClient
102
102
  end
103
103
 
104
104
  if attributes.key?(:'body')
105
- if (value = attributes[:'body']).is_a?(Hash)
106
- self.body = value
107
- end
105
+ self.body = attributes[:'body']
108
106
  end
109
107
  end
110
108