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
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # End 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 alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
17
+ # End 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 and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
18
18
  class ContentStateEnd
19
19
  attr_accessor :title
20
20
 
@@ -29,7 +29,7 @@ module OpenapiClient
29
29
  # Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
30
30
  attr_accessor :percentage
31
31
 
32
- # Current progress value. Use with upper_limit for type=progress.
32
+ # For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.
33
33
  attr_accessor :value
34
34
 
35
35
  # Maximum progress value. Use with value for type=progress.
@@ -50,16 +50,16 @@ module OpenapiClient
50
50
  # Alert message. Use for type=alert.
51
51
  attr_accessor :message
52
52
 
53
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
53
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
54
54
  attr_accessor :icon
55
55
 
56
- # Optional badge. Supported by alert, progress, and segmented_progress.
56
+ # Optional badge. Supported by alert, progress, segmented_progress, and value.
57
57
  attr_accessor :badge
58
58
 
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 action and secondary_action buttons when included.
62
+ # Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
63
63
  attr_accessor :color
64
64
 
65
65
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -131,7 +131,7 @@ module OpenapiClient
131
131
  :'number_of_steps' => :'Integer',
132
132
  :'current_step' => :'Integer',
133
133
  :'percentage' => :'Float',
134
- :'value' => :'Float',
134
+ :'value' => :'LiveActivityValue',
135
135
  :'upper_limit' => :'Float',
136
136
  :'duration_seconds' => :'Float',
137
137
  :'counts_down' => :'Boolean',
@@ -314,7 +314,7 @@ module OpenapiClient
314
314
  return false if !@metrics.nil? && @metrics.length > 8
315
315
  return false if !@metrics.nil? && @metrics.length < 1
316
316
  return false if !@message.nil? && @message.to_s.length < 1
317
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
317
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
318
318
  return false unless type_validator.valid?(@type)
319
319
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
320
320
  return false unless color_validator.valid?(@color)
@@ -405,7 +405,7 @@ module OpenapiClient
405
405
  # Custom attribute writer method checking allowed values (enum).
406
406
  # @param [Object] type Object to be assigned
407
407
  def type=(type)
408
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
408
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
409
409
  unless validator.valid?(type)
410
410
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
411
411
  end
@@ -14,7 +14,7 @@ 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 alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
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 duration_seconds for an open-ended elapsed timer. 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
19
  attr_accessor :title
20
20
 
@@ -29,7 +29,7 @@ module OpenapiClient
29
29
  # Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
30
30
  attr_accessor :percentage
31
31
 
32
- # Current progress value. Use with upper_limit for type=progress.
32
+ # For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.
33
33
  attr_accessor :value
34
34
 
35
35
  # Maximum progress value. Use with value for type=progress.
@@ -50,15 +50,15 @@ module OpenapiClient
50
50
  # Required for type=alert.
51
51
  attr_accessor :message
52
52
 
53
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
53
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
54
54
  attr_accessor :icon
55
55
 
56
- # Optional badge. Supported by alert, progress, and segmented_progress.
56
+ # Optional badge. Supported by alert, progress, segmented_progress, and value.
57
57
  attr_accessor :badge
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 action and secondary_action buttons when included.
61
+ # Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
62
62
  attr_accessor :color
63
63
 
64
64
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -126,7 +126,7 @@ module OpenapiClient
126
126
  :'number_of_steps' => :'Integer',
127
127
  :'current_step' => :'Integer',
128
128
  :'percentage' => :'Float',
129
- :'value' => :'Float',
129
+ :'value' => :'LiveActivityValue',
130
130
  :'upper_limit' => :'Float',
131
131
  :'duration_seconds' => :'Float',
132
132
  :'counts_down' => :'Boolean',
@@ -305,7 +305,7 @@ module OpenapiClient
305
305
  return false if !@metrics.nil? && @metrics.length < 1
306
306
  return false if !@message.nil? && @message.to_s.length < 1
307
307
  return false if @type.nil?
308
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
308
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
309
309
  return false unless type_validator.valid?(@type)
310
310
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
311
311
  return false unless color_validator.valid?(@color)
@@ -395,7 +395,7 @@ module OpenapiClient
395
395
  # Custom attribute writer method checking allowed values (enum).
396
396
  # @param [Object] type Object to be assigned
397
397
  def type=(type)
398
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
398
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
399
399
  unless validator.valid?(type)
400
400
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
401
401
  end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
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 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, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
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
19
  attr_accessor :title
20
20
 
@@ -29,7 +29,7 @@ module OpenapiClient
29
29
  # Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
30
30
  attr_accessor :percentage
31
31
 
32
- # Current progress value. Use with upper_limit for type=progress.
32
+ # For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit.
33
33
  attr_accessor :value
34
34
 
35
35
  # Maximum progress value. Use with value for type=progress.
@@ -50,16 +50,16 @@ module OpenapiClient
50
50
  # Alert message. Use for type=alert.
51
51
  attr_accessor :message
52
52
 
53
- # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
53
+ # Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value.
54
54
  attr_accessor :icon
55
55
 
56
- # Optional badge. Supported by alert, progress, and segmented_progress.
56
+ # Optional badge. Supported by alert, progress, segmented_progress, and value.
57
57
  attr_accessor :badge
58
58
 
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 action and secondary_action buttons when included.
62
+ # Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
63
63
  attr_accessor :color
64
64
 
65
65
  # Optional. Overrides color for the current step. Only applies to type=segmented_progress.
@@ -127,7 +127,7 @@ module OpenapiClient
127
127
  :'number_of_steps' => :'Integer',
128
128
  :'current_step' => :'Integer',
129
129
  :'percentage' => :'Float',
130
- :'value' => :'Float',
130
+ :'value' => :'LiveActivityValue',
131
131
  :'upper_limit' => :'Float',
132
132
  :'duration_seconds' => :'Float',
133
133
  :'counts_down' => :'Boolean',
@@ -299,7 +299,7 @@ module OpenapiClient
299
299
  return false if !@metrics.nil? && @metrics.length > 8
300
300
  return false if !@metrics.nil? && @metrics.length < 1
301
301
  return false if !@message.nil? && @message.to_s.length < 1
302
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
302
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
303
303
  return false unless type_validator.valid?(@type)
304
304
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow", "gray"])
305
305
  return false unless color_validator.valid?(@color)
@@ -389,7 +389,7 @@ module OpenapiClient
389
389
  # Custom attribute writer method checking allowed values (enum).
390
390
  # @param [Object] type Object to be assigned
391
391
  def type=(type)
392
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer"])
392
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats", "alert", "timer", "value"])
393
393
  unless validator.valid?(type)
394
394
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
395
395
  end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
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.
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, segmented_progress, and value Live Activities.
18
18
  class LiveActivityAction
19
19
  # Button title displayed in the Live Activity UI.
20
20
  attr_accessor :title
@@ -30,6 +30,28 @@ module OpenapiClient
30
30
  # Optional webhook payload body. Used only when type=webhook.
31
31
  attr_accessor :body
32
32
 
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
33
55
  # Attribute mapping from ruby-style variable name to JSON key.
34
56
  def self.attribute_map
35
57
  {
@@ -16,19 +16,27 @@ require 'time'
16
16
  module OpenapiClient
17
17
  # End an existing Live Activity by activity_id.
18
18
  class LiveActivityEndRequest
19
+ # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it.
20
+ attr_accessor :metadata
21
+
19
22
  attr_accessor :activity_id
20
23
 
24
+ # Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them.
25
+ attr_accessor :tags
26
+
21
27
  attr_accessor :content_state
22
28
 
23
29
  attr_accessor :action
24
30
 
25
- # Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
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.
26
32
  attr_accessor :secondary_action
27
33
 
28
34
  # Attribute mapping from ruby-style variable name to JSON key.
29
35
  def self.attribute_map
30
36
  {
37
+ :'metadata' => :'metadata',
31
38
  :'activity_id' => :'activity_id',
39
+ :'tags' => :'tags',
32
40
  :'content_state' => :'content_state',
33
41
  :'action' => :'action',
34
42
  :'secondary_action' => :'secondary_action'
@@ -43,7 +51,9 @@ module OpenapiClient
43
51
  # Attribute type mapping.
44
52
  def self.openapi_types
45
53
  {
54
+ :'metadata' => :'Hash<String, MetadataValue>',
46
55
  :'activity_id' => :'String',
56
+ :'tags' => :'Array<String>',
47
57
  :'content_state' => :'ContentStateEnd',
48
58
  :'action' => :'LiveActivityAction',
49
59
  :'secondary_action' => :'LiveActivityAction'
@@ -71,12 +81,24 @@ module OpenapiClient
71
81
  h[k.to_sym] = v
72
82
  }
73
83
 
84
+ if attributes.key?(:'metadata')
85
+ if (value = attributes[:'metadata']).is_a?(Hash)
86
+ self.metadata = value
87
+ end
88
+ end
89
+
74
90
  if attributes.key?(:'activity_id')
75
91
  self.activity_id = attributes[:'activity_id']
76
92
  else
77
93
  self.activity_id = nil
78
94
  end
79
95
 
96
+ if attributes.key?(:'tags')
97
+ if (value = attributes[:'tags']).is_a?(Array)
98
+ self.tags = value
99
+ end
100
+ end
101
+
80
102
  if attributes.key?(:'content_state')
81
103
  self.content_state = attributes[:'content_state']
82
104
  else
@@ -97,10 +119,18 @@ module OpenapiClient
97
119
  def list_invalid_properties
98
120
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
121
  invalid_properties = Array.new
122
+ if !@metadata.nil? && @metadata.length > 50
123
+ invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.')
124
+ end
125
+
100
126
  if @activity_id.nil?
101
127
  invalid_properties.push('invalid value for "activity_id", activity_id cannot be nil.')
102
128
  end
103
129
 
130
+ if !@tags.nil? && @tags.length > 20
131
+ invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 20.')
132
+ end
133
+
104
134
  if @content_state.nil?
105
135
  invalid_properties.push('invalid value for "content_state", content_state cannot be nil.')
106
136
  end
@@ -112,17 +142,49 @@ module OpenapiClient
112
142
  # @return true if the model is valid
113
143
  def valid?
114
144
  warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ return false if !@metadata.nil? && @metadata.length > 50
115
146
  return false if @activity_id.nil?
147
+ return false if !@tags.nil? && @tags.length > 20
116
148
  return false if @content_state.nil?
117
149
  true
118
150
  end
119
151
 
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] metadata Value to be assigned
154
+ def metadata=(metadata)
155
+ if metadata.nil?
156
+ fail ArgumentError, 'metadata cannot be nil'
157
+ end
158
+
159
+ if metadata.length > 50
160
+ fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.'
161
+ end
162
+
163
+ @metadata = metadata
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] tags Value to be assigned
168
+ def tags=(tags)
169
+ if tags.nil?
170
+ fail ArgumentError, 'tags cannot be nil'
171
+ end
172
+
173
+ if tags.length > 20
174
+ fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 20.'
175
+ end
176
+
177
+ @tags = tags
178
+ end
179
+
120
180
  # Checks equality by comparing each attribute.
121
181
  # @param [Object] Object to be compared
122
182
  def ==(o)
123
183
  return true if self.equal?(o)
124
184
  self.class == o.class &&
185
+ metadata == o.metadata &&
125
186
  activity_id == o.activity_id &&
187
+ tags == o.tags &&
126
188
  content_state == o.content_state &&
127
189
  action == o.action &&
128
190
  secondary_action == o.secondary_action
@@ -137,7 +199,7 @@ module OpenapiClient
137
199
  # Calculates hash code according to all attributes.
138
200
  # @return [Integer] Hash code
139
201
  def hash
140
- [activity_id, content_state, action, secondary_action].hash
202
+ [metadata, activity_id, tags, content_state, action, secondary_action].hash
141
203
  end
142
204
 
143
205
  # Builds the object from hash
@@ -21,16 +21,24 @@ module OpenapiClient
21
21
 
22
22
  attr_accessor :limit
23
23
 
24
- # Current number of active Live Activities.
24
+ # Highest number of active Live Activities among the targeted devices.
25
25
  attr_accessor :active
26
26
 
27
+ # Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity.
28
+ attr_accessor :blocked_devices
29
+
30
+ # Total number of targeted devices. Included only when targeted devices have mixed capacity.
31
+ attr_accessor :targeted_devices
32
+
27
33
  # Attribute mapping from ruby-style variable name to JSON key.
28
34
  def self.attribute_map
29
35
  {
30
36
  :'error' => :'error',
31
37
  :'message' => :'message',
32
38
  :'limit' => :'limit',
33
- :'active' => :'active'
39
+ :'active' => :'active',
40
+ :'blocked_devices' => :'blocked_devices',
41
+ :'targeted_devices' => :'targeted_devices'
34
42
  }
35
43
  end
36
44
 
@@ -45,7 +53,9 @@ module OpenapiClient
45
53
  :'error' => :'String',
46
54
  :'message' => :'String',
47
55
  :'limit' => :'Integer',
48
- :'active' => :'Integer'
56
+ :'active' => :'Integer',
57
+ :'blocked_devices' => :'Integer',
58
+ :'targeted_devices' => :'Integer'
49
59
  }
50
60
  end
51
61
 
@@ -93,6 +103,14 @@ module OpenapiClient
93
103
  else
94
104
  self.active = nil
95
105
  end
106
+
107
+ if attributes.key?(:'blocked_devices')
108
+ self.blocked_devices = attributes[:'blocked_devices']
109
+ end
110
+
111
+ if attributes.key?(:'targeted_devices')
112
+ self.targeted_devices = attributes[:'targeted_devices']
113
+ end
96
114
  end
97
115
 
98
116
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -138,7 +156,9 @@ module OpenapiClient
138
156
  error == o.error &&
139
157
  message == o.message &&
140
158
  limit == o.limit &&
141
- active == o.active
159
+ active == o.active &&
160
+ blocked_devices == o.blocked_devices &&
161
+ targeted_devices == o.targeted_devices
142
162
  end
143
163
 
144
164
  # @see the `==` method
@@ -150,7 +170,7 @@ module OpenapiClient
150
170
  # Calculates hash code according to all attributes.
151
171
  # @return [Integer] Hash code
152
172
  def hash
153
- [error, message, limit, active].hash
173
+ [error, message, limit, active, blocked_devices, targeted_devices].hash
154
174
  end
155
175
 
156
176
  # Builds the object from hash
@@ -16,11 +16,14 @@ require 'time'
16
16
  module OpenapiClient
17
17
  # Start a new Live Activity. The response includes activity_id for later update and end calls.
18
18
  class LiveActivityStartRequest
19
+ # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it.
20
+ attr_accessor :metadata
21
+
19
22
  attr_accessor :content_state
20
23
 
21
24
  attr_accessor :action
22
25
 
23
- # Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
26
+ # 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.
24
27
  attr_accessor :secondary_action
25
28
 
26
29
  attr_accessor :alert
@@ -33,6 +36,7 @@ module OpenapiClient
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  def self.attribute_map
35
38
  {
39
+ :'metadata' => :'metadata',
36
40
  :'content_state' => :'content_state',
37
41
  :'action' => :'action',
38
42
  :'secondary_action' => :'secondary_action',
@@ -50,6 +54,7 @@ module OpenapiClient
50
54
  # Attribute type mapping.
51
55
  def self.openapi_types
52
56
  {
57
+ :'metadata' => :'Hash<String, MetadataValue>',
53
58
  :'content_state' => :'ContentStateStart',
54
59
  :'action' => :'LiveActivityAction',
55
60
  :'secondary_action' => :'LiveActivityAction',
@@ -80,6 +85,12 @@ module OpenapiClient
80
85
  h[k.to_sym] = v
81
86
  }
82
87
 
88
+ if attributes.key?(:'metadata')
89
+ if (value = attributes[:'metadata']).is_a?(Hash)
90
+ self.metadata = value
91
+ end
92
+ end
93
+
83
94
  if attributes.key?(:'content_state')
84
95
  self.content_state = attributes[:'content_state']
85
96
  else
@@ -114,6 +125,10 @@ module OpenapiClient
114
125
  def list_invalid_properties
115
126
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
127
  invalid_properties = Array.new
128
+ if !@metadata.nil? && @metadata.length > 50
129
+ invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.')
130
+ end
131
+
117
132
  if @content_state.nil?
118
133
  invalid_properties.push('invalid value for "content_state", content_state cannot be nil.')
119
134
  end
@@ -125,15 +140,31 @@ module OpenapiClient
125
140
  # @return true if the model is valid
126
141
  def valid?
127
142
  warn '[DEPRECATED] the `valid?` method is obsolete'
143
+ return false if !@metadata.nil? && @metadata.length > 50
128
144
  return false if @content_state.nil?
129
145
  true
130
146
  end
131
147
 
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] metadata Value to be assigned
150
+ def metadata=(metadata)
151
+ if metadata.nil?
152
+ fail ArgumentError, 'metadata cannot be nil'
153
+ end
154
+
155
+ if metadata.length > 50
156
+ fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.'
157
+ end
158
+
159
+ @metadata = metadata
160
+ end
161
+
132
162
  # Checks equality by comparing each attribute.
133
163
  # @param [Object] Object to be compared
134
164
  def ==(o)
135
165
  return true if self.equal?(o)
136
166
  self.class == o.class &&
167
+ metadata == o.metadata &&
137
168
  content_state == o.content_state &&
138
169
  action == o.action &&
139
170
  secondary_action == o.secondary_action &&
@@ -151,7 +182,7 @@ module OpenapiClient
151
182
  # Calculates hash code according to all attributes.
152
183
  # @return [Integer] Hash code
153
184
  def hash
154
- [content_state, action, secondary_action, alert, target, tags].hash
185
+ [metadata, content_state, action, secondary_action, alert, target, tags].hash
155
186
  end
156
187
 
157
188
  # Builds the object from hash
@@ -16,11 +16,17 @@ require 'time'
16
16
  module OpenapiClient
17
17
  # Optional payload for ending a managed stream. When omitted, ActivitySmith ends the stream using the latest known state when possible.
18
18
  class LiveActivityStreamDeleteRequest
19
+ # Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it.
20
+ attr_accessor :metadata
21
+
22
+ # Optional tags to organize and filter notification history.
23
+ attr_accessor :tags
24
+
19
25
  attr_accessor :content_state
20
26
 
21
27
  attr_accessor :action
22
28
 
23
- # Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
29
+ # 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.
24
30
  attr_accessor :secondary_action
25
31
 
26
32
  attr_accessor :alert
@@ -28,6 +34,8 @@ module OpenapiClient
28
34
  # Attribute mapping from ruby-style variable name to JSON key.
29
35
  def self.attribute_map
30
36
  {
37
+ :'metadata' => :'metadata',
38
+ :'tags' => :'tags',
31
39
  :'content_state' => :'content_state',
32
40
  :'action' => :'action',
33
41
  :'secondary_action' => :'secondary_action',
@@ -43,6 +51,8 @@ module OpenapiClient
43
51
  # Attribute type mapping.
44
52
  def self.openapi_types
45
53
  {
54
+ :'metadata' => :'Hash<String, MetadataValue>',
55
+ :'tags' => :'Array<String>',
46
56
  :'content_state' => :'StreamContentState',
47
57
  :'action' => :'LiveActivityAction',
48
58
  :'secondary_action' => :'LiveActivityAction',
@@ -71,6 +81,18 @@ module OpenapiClient
71
81
  h[k.to_sym] = v
72
82
  }
73
83
 
84
+ if attributes.key?(:'metadata')
85
+ if (value = attributes[:'metadata']).is_a?(Hash)
86
+ self.metadata = value
87
+ end
88
+ end
89
+
90
+ if attributes.key?(:'tags')
91
+ if (value = attributes[:'tags']).is_a?(Array)
92
+ self.tags = value
93
+ end
94
+ end
95
+
74
96
  if attributes.key?(:'content_state')
75
97
  self.content_state = attributes[:'content_state']
76
98
  end
@@ -93,6 +115,10 @@ module OpenapiClient
93
115
  def list_invalid_properties
94
116
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
117
  invalid_properties = Array.new
118
+ if !@metadata.nil? && @metadata.length > 50
119
+ invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 50.')
120
+ end
121
+
96
122
  invalid_properties
97
123
  end
98
124
 
@@ -100,14 +126,31 @@ module OpenapiClient
100
126
  # @return true if the model is valid
101
127
  def valid?
102
128
  warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ return false if !@metadata.nil? && @metadata.length > 50
103
130
  true
104
131
  end
105
132
 
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] metadata Value to be assigned
135
+ def metadata=(metadata)
136
+ if metadata.nil?
137
+ fail ArgumentError, 'metadata cannot be nil'
138
+ end
139
+
140
+ if metadata.length > 50
141
+ fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 50.'
142
+ end
143
+
144
+ @metadata = metadata
145
+ end
146
+
106
147
  # Checks equality by comparing each attribute.
107
148
  # @param [Object] Object to be compared
108
149
  def ==(o)
109
150
  return true if self.equal?(o)
110
151
  self.class == o.class &&
152
+ metadata == o.metadata &&
153
+ tags == o.tags &&
111
154
  content_state == o.content_state &&
112
155
  action == o.action &&
113
156
  secondary_action == o.secondary_action &&
@@ -123,7 +166,7 @@ module OpenapiClient
123
166
  # Calculates hash code according to all attributes.
124
167
  # @return [Integer] Hash code
125
168
  def hash
126
- [content_state, action, secondary_action, alert].hash
169
+ [metadata, tags, content_state, action, secondary_action, alert].hash
127
170
  end
128
171
 
129
172
  # Builds the object from hash