activitysmith 1.10.0 → 1.12.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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +273 -254
  3. data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
  4. data/generated/activitysmith_openapi/api/metrics_api.rb +2 -2
  5. data/generated/activitysmith_openapi/configuration.rb +7 -0
  6. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_error.rb +386 -0
  7. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +33 -11
  8. data/generated/activitysmith_openapi/models/content_state_end.rb +8 -8
  9. data/generated/activitysmith_openapi/models/content_state_start.rb +8 -8
  10. data/generated/activitysmith_openapi/models/content_state_update.rb +8 -8
  11. data/generated/activitysmith_openapi/models/live_activity_action.rb +23 -1
  12. data/generated/activitysmith_openapi/models/live_activity_end_request.rb +64 -2
  13. data/generated/activitysmith_openapi/models/live_activity_limit_error.rb +25 -5
  14. data/generated/activitysmith_openapi/models/live_activity_start_request.rb +33 -2
  15. data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +45 -2
  16. data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +33 -2
  17. data/generated/activitysmith_openapi/models/live_activity_update_request.rb +64 -2
  18. data/generated/activitysmith_openapi/models/live_activity_value.rb +106 -0
  19. data/generated/activitysmith_openapi/models/metadata_value.rb +106 -0
  20. data/generated/activitysmith_openapi/models/push_notification_action.rb +23 -1
  21. data/generated/activitysmith_openapi/models/push_notification_request.rb +45 -5
  22. data/generated/activitysmith_openapi/models/rate_limit_error.rb +44 -1
  23. data/generated/activitysmith_openapi/models/stream_content_state.rb +8 -8
  24. data/generated/activitysmith_openapi/models/update_app_icon_badge_count422_response.rb +105 -0
  25. data/generated/activitysmith_openapi/version.rb +1 -1
  26. data/generated/activitysmith_openapi.rb +4 -0
  27. data/generated/openapi-source.json +6 -0
  28. data/lib/activitysmith/live_activities.rb +7 -6
  29. data/lib/activitysmith/version.rb +1 -1
  30. metadata +7 -2
@@ -20,7 +20,7 @@ module OpenapiClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # End a Live Activity (legacy manual lifecycle)
23
- # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
23
+ # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
24
24
  # @param live_activity_end_request [LiveActivityEndRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [LiveActivityEndResponse]
@@ -30,7 +30,7 @@ module OpenapiClient
30
30
  end
31
31
 
32
32
  # End a Live Activity (legacy manual lifecycle)
33
- # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
33
+ # Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
34
34
  # @param live_activity_end_request [LiveActivityEndRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(LiveActivityEndResponse, Integer, Hash)>] LiveActivityEndResponse data, response status code and response headers
@@ -88,7 +88,7 @@ module OpenapiClient
88
88
  end
89
89
 
90
90
  # End a stream
91
- # Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
91
+ # Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
92
92
  # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @option opts [LiveActivityStreamDeleteRequest] :live_activity_stream_delete_request
@@ -99,7 +99,7 @@ module OpenapiClient
99
99
  end
100
100
 
101
101
  # End a stream
102
- # Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
102
+ # Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
103
103
  # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
104
104
  # @param [Hash] opts the optional parameters
105
105
  # @option opts [LiveActivityStreamDeleteRequest] :live_activity_stream_delete_request
@@ -167,7 +167,7 @@ module OpenapiClient
167
167
  end
168
168
 
169
169
  # Start a new Live Activity or update an existing one
170
- # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
170
+ # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
171
171
  # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
172
172
  # @param live_activity_stream_request [LiveActivityStreamRequest]
173
173
  # @param [Hash] opts the optional parameters
@@ -178,7 +178,7 @@ module OpenapiClient
178
178
  end
179
179
 
180
180
  # Start a new Live Activity or update an existing one
181
- # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
181
+ # Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
182
182
  # @param stream_key [String] Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.
183
183
  # @param live_activity_stream_request [LiveActivityStreamRequest]
184
184
  # @param [Hash] opts the optional parameters
@@ -250,7 +250,7 @@ module OpenapiClient
250
250
  end
251
251
 
252
252
  # Start a Live Activity (legacy manual lifecycle)
253
- # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history.
253
+ # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history.
254
254
  # @param live_activity_start_request [LiveActivityStartRequest]
255
255
  # @param [Hash] opts the optional parameters
256
256
  # @return [LiveActivityStartResponse]
@@ -260,7 +260,7 @@ module OpenapiClient
260
260
  end
261
261
 
262
262
  # Start a Live Activity (legacy manual lifecycle)
263
- # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history.
263
+ # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history.
264
264
  # @param live_activity_start_request [LiveActivityStartRequest]
265
265
  # @param [Hash] opts the optional parameters
266
266
  # @return [Array<(LiveActivityStartResponse, Integer, Hash)>] LiveActivityStartResponse data, response status code and response headers
@@ -318,7 +318,7 @@ module OpenapiClient
318
318
  end
319
319
 
320
320
  # Update a Live Activity (legacy manual lifecycle)
321
- # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
321
+ # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
322
322
  # @param live_activity_update_request [LiveActivityUpdateRequest]
323
323
  # @param [Hash] opts the optional parameters
324
324
  # @return [LiveActivityUpdateResponse]
@@ -328,7 +328,7 @@ module OpenapiClient
328
328
  end
329
329
 
330
330
  # Update a Live Activity (legacy manual lifecycle)
331
- # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities.
331
+ # Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.
332
332
  # @param live_activity_update_request [LiveActivityUpdateRequest]
333
333
  # @param [Hash] opts the optional parameters
334
334
  # @return [Array<(LiveActivityUpdateResponse, Integer, Hash)>] LiveActivityUpdateResponse data, response status code and response headers
@@ -20,7 +20,7 @@ module OpenapiClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Update a widget metric value
23
- # Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
23
+ # Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
24
24
  # @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
25
25
  # @param metric_value_update_request [MetricValueUpdateRequest]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module OpenapiClient
31
31
  end
32
32
 
33
33
  # Update a widget metric value
34
- # Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key.
34
+ # Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances.
35
35
  # @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
36
36
  # @param metric_value_update_request [MetricValueUpdateRequest]
37
37
  # @param [Hash] opts the optional parameters
@@ -252,6 +252,13 @@ module OpenapiClient
252
252
  key: 'Authorization',
253
253
  value: "Bearer #{access_token_with_refresh}"
254
254
  },
255
+ 'mcpOAuth' =>
256
+ {
257
+ type: 'oauth2',
258
+ in: 'header',
259
+ key: 'Authorization',
260
+ value: "Bearer #{access_token_with_refresh}"
261
+ },
255
262
  }
256
263
  end
257
264
 
@@ -0,0 +1,386 @@
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 AppIconBadgeCountUpdateError
18
+ attr_accessor :error
19
+
20
+ attr_accessor :code
21
+
22
+ attr_accessor :message
23
+
24
+ attr_accessor :badge
25
+
26
+ attr_accessor :devices_targeted
27
+
28
+ attr_accessor :devices_updated
29
+
30
+ attr_accessor :users_updated
31
+
32
+ # Deprecated compatibility alias for devices_updated.
33
+ attr_accessor :devices_notified
34
+
35
+ attr_accessor :effective_channel_slugs
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'error' => :'error',
63
+ :'code' => :'code',
64
+ :'message' => :'message',
65
+ :'badge' => :'badge',
66
+ :'devices_targeted' => :'devices_targeted',
67
+ :'devices_updated' => :'devices_updated',
68
+ :'users_updated' => :'users_updated',
69
+ :'devices_notified' => :'devices_notified',
70
+ :'effective_channel_slugs' => :'effective_channel_slugs'
71
+ }
72
+ end
73
+
74
+ # Returns all the JSON keys this model knows about
75
+ def self.acceptable_attributes
76
+ attribute_map.values
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.openapi_types
81
+ {
82
+ :'error' => :'String',
83
+ :'code' => :'String',
84
+ :'message' => :'String',
85
+ :'badge' => :'Integer',
86
+ :'devices_targeted' => :'Integer',
87
+ :'devices_updated' => :'Integer',
88
+ :'users_updated' => :'Integer',
89
+ :'devices_notified' => :'Integer',
90
+ :'effective_channel_slugs' => :'Array<String>'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AppIconBadgeCountUpdateError` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!self.class.attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AppIconBadgeCountUpdateError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'error')
116
+ self.error = attributes[:'error']
117
+ else
118
+ self.error = nil
119
+ end
120
+
121
+ if attributes.key?(:'code')
122
+ self.code = attributes[:'code']
123
+ else
124
+ self.code = nil
125
+ end
126
+
127
+ if attributes.key?(:'message')
128
+ self.message = attributes[:'message']
129
+ else
130
+ self.message = nil
131
+ end
132
+
133
+ if attributes.key?(:'badge')
134
+ self.badge = attributes[:'badge']
135
+ else
136
+ self.badge = nil
137
+ end
138
+
139
+ if attributes.key?(:'devices_targeted')
140
+ self.devices_targeted = attributes[:'devices_targeted']
141
+ end
142
+
143
+ if attributes.key?(:'devices_updated')
144
+ self.devices_updated = attributes[:'devices_updated']
145
+ else
146
+ self.devices_updated = nil
147
+ end
148
+
149
+ if attributes.key?(:'users_updated')
150
+ self.users_updated = attributes[:'users_updated']
151
+ end
152
+
153
+ if attributes.key?(:'devices_notified')
154
+ self.devices_notified = attributes[:'devices_notified']
155
+ end
156
+
157
+ if attributes.key?(:'effective_channel_slugs')
158
+ if (value = attributes[:'effective_channel_slugs']).is_a?(Array)
159
+ self.effective_channel_slugs = value
160
+ end
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @error.nil?
170
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
171
+ end
172
+
173
+ if @code.nil?
174
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
175
+ end
176
+
177
+ if @message.nil?
178
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
179
+ end
180
+
181
+ if @badge.nil?
182
+ invalid_properties.push('invalid value for "badge", badge cannot be nil.')
183
+ end
184
+
185
+ if @badge > 2147483647
186
+ invalid_properties.push('invalid value for "badge", must be smaller than or equal to 2147483647.')
187
+ end
188
+
189
+ if @badge < 0
190
+ invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.')
191
+ end
192
+
193
+ if @devices_updated.nil?
194
+ invalid_properties.push('invalid value for "devices_updated", devices_updated cannot be nil.')
195
+ end
196
+
197
+ invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ warn '[DEPRECATED] the `valid?` method is obsolete'
204
+ return false if @error.nil?
205
+ return false if @code.nil?
206
+ code_validator = EnumAttributeValidator.new('String', ["badge_device_disconnected", "badge_update_failed"])
207
+ return false unless code_validator.valid?(@code)
208
+ return false if @message.nil?
209
+ return false if @badge.nil?
210
+ return false if @badge > 2147483647
211
+ return false if @badge < 0
212
+ return false if @devices_updated.nil?
213
+ true
214
+ end
215
+
216
+ # Custom attribute writer method checking allowed values (enum).
217
+ # @param [Object] code Object to be assigned
218
+ def code=(code)
219
+ validator = EnumAttributeValidator.new('String', ["badge_device_disconnected", "badge_update_failed"])
220
+ unless validator.valid?(code)
221
+ fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
222
+ end
223
+ @code = code
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] badge Value to be assigned
228
+ def badge=(badge)
229
+ if badge.nil?
230
+ fail ArgumentError, 'badge cannot be nil'
231
+ end
232
+
233
+ if badge > 2147483647
234
+ fail ArgumentError, 'invalid value for "badge", must be smaller than or equal to 2147483647.'
235
+ end
236
+
237
+ if badge < 0
238
+ fail ArgumentError, 'invalid value for "badge", must be greater than or equal to 0.'
239
+ end
240
+
241
+ @badge = badge
242
+ end
243
+
244
+ # Checks equality by comparing each attribute.
245
+ # @param [Object] Object to be compared
246
+ def ==(o)
247
+ return true if self.equal?(o)
248
+ self.class == o.class &&
249
+ error == o.error &&
250
+ code == o.code &&
251
+ message == o.message &&
252
+ badge == o.badge &&
253
+ devices_targeted == o.devices_targeted &&
254
+ devices_updated == o.devices_updated &&
255
+ users_updated == o.users_updated &&
256
+ devices_notified == o.devices_notified &&
257
+ effective_channel_slugs == o.effective_channel_slugs
258
+ end
259
+
260
+ # @see the `==` method
261
+ # @param [Object] Object to be compared
262
+ def eql?(o)
263
+ self == o
264
+ end
265
+
266
+ # Calculates hash code according to all attributes.
267
+ # @return [Integer] Hash code
268
+ def hash
269
+ [error, code, message, badge, devices_targeted, devices_updated, users_updated, devices_notified, effective_channel_slugs].hash
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def self.build_from_hash(attributes)
276
+ return nil unless attributes.is_a?(Hash)
277
+ attributes = attributes.transform_keys(&:to_sym)
278
+ transformed_hash = {}
279
+ openapi_types.each_pair do |key, type|
280
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
281
+ transformed_hash["#{key}"] = nil
282
+ elsif type =~ /\AArray<(.*)>/i
283
+ # check to ensure the input is an array given that the attribute
284
+ # is documented as an array but the input is not
285
+ if attributes[attribute_map[key]].is_a?(Array)
286
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
287
+ end
288
+ elsif !attributes[attribute_map[key]].nil?
289
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
290
+ end
291
+ end
292
+ new(transformed_hash)
293
+ end
294
+
295
+ # Deserializes the data based on type
296
+ # @param string type Data type
297
+ # @param string value Value to be deserialized
298
+ # @return [Object] Deserialized data
299
+ def self._deserialize(type, value)
300
+ case type.to_sym
301
+ when :Time
302
+ Time.parse(value)
303
+ when :Date
304
+ Date.parse(value)
305
+ when :String
306
+ value.to_s
307
+ when :Integer
308
+ value.to_i
309
+ when :Float
310
+ value.to_f
311
+ when :Boolean
312
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
313
+ true
314
+ else
315
+ false
316
+ end
317
+ when :Object
318
+ # generic object (usually a Hash), return directly
319
+ value
320
+ when /\AArray<(?<inner_type>.+)>\z/
321
+ inner_type = Regexp.last_match[:inner_type]
322
+ value.map { |v| _deserialize(inner_type, v) }
323
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
324
+ k_type = Regexp.last_match[:k_type]
325
+ v_type = Regexp.last_match[:v_type]
326
+ {}.tap do |hash|
327
+ value.each do |k, v|
328
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
329
+ end
330
+ end
331
+ else # model
332
+ # models (e.g. Pet) or oneOf
333
+ klass = OpenapiClient.const_get(type)
334
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
335
+ end
336
+ end
337
+
338
+ # Returns the string representation of the object
339
+ # @return [String] String presentation of the object
340
+ def to_s
341
+ to_hash.to_s
342
+ end
343
+
344
+ # to_body is an alias to to_hash (backward compatibility)
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_body
347
+ to_hash
348
+ end
349
+
350
+ # Returns the object in the form of hash
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_hash
353
+ hash = {}
354
+ self.class.attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ if value.nil?
357
+ is_nullable = self.class.openapi_nullable.include?(attr)
358
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
359
+ end
360
+
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ # Outputs non-array value in the form of hash
367
+ # For object, use to_hash. Otherwise, just return the value
368
+ # @param [Object] value Any valid value
369
+ # @return [Hash] Returns the value in the form of hash
370
+ def _to_hash(value)
371
+ if value.is_a?(Array)
372
+ value.compact.map { |v| _to_hash(v) }
373
+ elsif value.is_a?(Hash)
374
+ {}.tap do |hash|
375
+ value.each { |k, v| hash[k] = _to_hash(v) }
376
+ end
377
+ elsif value.respond_to? :to_hash
378
+ value.to_hash
379
+ else
380
+ value
381
+ end
382
+ end
383
+
384
+ end
385
+
386
+ end
@@ -19,8 +19,16 @@ module OpenapiClient
19
19
 
20
20
  attr_accessor :badge
21
21
 
22
+ # Number of devices whose App Icon Badge Count was updated.
23
+ attr_accessor :devices_updated
24
+
25
+ # Number of account users with at least one updated device.
26
+ attr_accessor :users_updated
27
+
28
+ # Deprecated compatibility alias for devices_updated.
22
29
  attr_accessor :devices_notified
23
30
 
31
+ # Deprecated compatibility alias for users_updated.
24
32
  attr_accessor :users_notified
25
33
 
26
34
  attr_accessor :effective_channel_slugs
@@ -32,6 +40,8 @@ module OpenapiClient
32
40
  {
33
41
  :'success' => :'success',
34
42
  :'badge' => :'badge',
43
+ :'devices_updated' => :'devices_updated',
44
+ :'users_updated' => :'users_updated',
35
45
  :'devices_notified' => :'devices_notified',
36
46
  :'users_notified' => :'users_notified',
37
47
  :'effective_channel_slugs' => :'effective_channel_slugs',
@@ -49,6 +59,8 @@ module OpenapiClient
49
59
  {
50
60
  :'success' => :'Boolean',
51
61
  :'badge' => :'Integer',
62
+ :'devices_updated' => :'Integer',
63
+ :'users_updated' => :'Integer',
52
64
  :'devices_notified' => :'Integer',
53
65
  :'users_notified' => :'Integer',
54
66
  :'effective_channel_slugs' => :'Array<String>',
@@ -89,16 +101,24 @@ module OpenapiClient
89
101
  self.badge = nil
90
102
  end
91
103
 
104
+ if attributes.key?(:'devices_updated')
105
+ self.devices_updated = attributes[:'devices_updated']
106
+ else
107
+ self.devices_updated = nil
108
+ end
109
+
110
+ if attributes.key?(:'users_updated')
111
+ self.users_updated = attributes[:'users_updated']
112
+ else
113
+ self.users_updated = nil
114
+ end
115
+
92
116
  if attributes.key?(:'devices_notified')
93
117
  self.devices_notified = attributes[:'devices_notified']
94
- else
95
- self.devices_notified = nil
96
118
  end
97
119
 
98
120
  if attributes.key?(:'users_notified')
99
121
  self.users_notified = attributes[:'users_notified']
100
- else
101
- self.users_notified = nil
102
122
  end
103
123
 
104
124
  if attributes.key?(:'effective_channel_slugs')
@@ -137,12 +157,12 @@ module OpenapiClient
137
157
  invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.')
138
158
  end
139
159
 
140
- if @devices_notified.nil?
141
- invalid_properties.push('invalid value for "devices_notified", devices_notified cannot be nil.')
160
+ if @devices_updated.nil?
161
+ invalid_properties.push('invalid value for "devices_updated", devices_updated cannot be nil.')
142
162
  end
143
163
 
144
- if @users_notified.nil?
145
- invalid_properties.push('invalid value for "users_notified", users_notified cannot be nil.')
164
+ if @users_updated.nil?
165
+ invalid_properties.push('invalid value for "users_updated", users_updated cannot be nil.')
146
166
  end
147
167
 
148
168
  if @effective_channel_slugs.nil?
@@ -164,8 +184,8 @@ module OpenapiClient
164
184
  return false if @badge.nil?
165
185
  return false if @badge > 2147483647
166
186
  return false if @badge < 0
167
- return false if @devices_notified.nil?
168
- return false if @users_notified.nil?
187
+ return false if @devices_updated.nil?
188
+ return false if @users_updated.nil?
169
189
  return false if @effective_channel_slugs.nil?
170
190
  return false if @timestamp.nil?
171
191
  true
@@ -196,6 +216,8 @@ module OpenapiClient
196
216
  self.class == o.class &&
197
217
  success == o.success &&
198
218
  badge == o.badge &&
219
+ devices_updated == o.devices_updated &&
220
+ users_updated == o.users_updated &&
199
221
  devices_notified == o.devices_notified &&
200
222
  users_notified == o.users_notified &&
201
223
  effective_channel_slugs == o.effective_channel_slugs &&
@@ -211,7 +233,7 @@ module OpenapiClient
211
233
  # Calculates hash code according to all attributes.
212
234
  # @return [Integer] Hash code
213
235
  def hash
214
- [success, badge, devices_notified, users_notified, effective_channel_slugs, timestamp].hash
236
+ [success, badge, devices_updated, users_updated, devices_notified, users_notified, effective_channel_slugs, timestamp].hash
215
237
  end
216
238
 
217
239
  # Builds the object from hash