activitysmith 1.13.0 → 1.15.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -9
  3. data/generated/activitysmith_openapi/api/app_icon_badges_api.rb +4 -4
  4. data/generated/activitysmith_openapi/api/devices_api.rb +100 -0
  5. data/generated/activitysmith_openapi/api/live_activities_api.rb +2 -2
  6. data/generated/activitysmith_openapi/api/metrics_api.rb +87 -4
  7. data/generated/activitysmith_openapi/api/push_notifications_api.rb +147 -2
  8. data/generated/activitysmith_openapi/models/account_device.rb +367 -0
  9. data/generated/activitysmith_openapi/models/account_device_list_response.rb +239 -0
  10. data/generated/activitysmith_openapi/models/account_device_list_response_meta.rb +299 -0
  11. data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +35 -5
  12. data/generated/activitysmith_openapi/models/live_activity_end_response.rb +64 -4
  13. data/generated/activitysmith_openapi/models/live_activity_start_response.rb +35 -4
  14. data/generated/activitysmith_openapi/models/live_activity_stream_delete_response.rb +64 -4
  15. data/generated/activitysmith_openapi/models/live_activity_stream_put_response.rb +54 -4
  16. data/generated/activitysmith_openapi/models/live_activity_update_response.rb +76 -4
  17. data/generated/activitysmith_openapi/models/metric.rb +411 -0
  18. data/generated/activitysmith_openapi/models/metric_response.rb +221 -0
  19. data/generated/activitysmith_openapi/models/metric_upsert_request.rb +370 -0
  20. data/generated/activitysmith_openapi/models/metric_value_update_response.rb +14 -4
  21. data/generated/activitysmith_openapi/models/no_recipients_error.rb +21 -1
  22. data/generated/activitysmith_openapi/models/push_notification_dismiss_response.rb +257 -0
  23. data/generated/activitysmith_openapi/models/push_notification_replace_request.rb +434 -0
  24. data/generated/activitysmith_openapi/models/push_notification_replace_response.rb +298 -0
  25. data/generated/activitysmith_openapi/models/push_notification_response.rb +63 -4
  26. data/generated/activitysmith_openapi/version.rb +1 -1
  27. data/generated/activitysmith_openapi.rb +10 -0
  28. data/generated/openapi-source.json +2 -2
  29. data/lib/activitysmith/client.rb +3 -1
  30. data/lib/activitysmith/devices.rb +30 -0
  31. data/lib/activitysmith/metrics.rb +15 -1
  32. data/lib/activitysmith/notifications.rb +23 -0
  33. data/lib/activitysmith/version.rb +1 -1
  34. data/lib/activitysmith.rb +1 -0
  35. metadata +13 -2
@@ -0,0 +1,221 @@
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 MetricResponse
18
+ attr_accessor :metric
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'metric' => :'metric'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'metric' => :'Metric'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::MetricResponse` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::MetricResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'metric')
61
+ self.metric = attributes[:'metric']
62
+ else
63
+ self.metric = nil
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ if @metric.nil?
73
+ invalid_properties.push('invalid value for "metric", metric cannot be nil.')
74
+ end
75
+
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ return false if @metric.nil?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ metric == o.metric
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [metric].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def self._deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = OpenapiClient.const_get(type)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,370 @@
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
+ # Metric definition. Omitted fields keep their current values, or use defaults for a new metric: a label made from the key and the number format.
18
+ class MetricUpsertRequest
19
+ # Name shown on the widget.
20
+ attr_accessor :label
21
+
22
+ # How widgets display the value: number (1,234), currency (requires currency_code), percent (send 99.9 to show 99.9%), unit (a number with a unit suffix, such as 120 ms), or string (text up to 64 characters). Defaults to number for a new metric.
23
+ attr_accessor :format
24
+
25
+ # 3-letter ISO 4217 currency code, such as USD. Required for the currency format.
26
+ attr_accessor :currency_code
27
+
28
+ # Unit suffix for the unit format, such as ms or GB.
29
+ attr_accessor :unit
30
+
31
+ # For the unit format: none shows 120ms, space shows 120 ms.
32
+ attr_accessor :unit_spacing
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'label' => :'label',
60
+ :'format' => :'format',
61
+ :'currency_code' => :'currency_code',
62
+ :'unit' => :'unit',
63
+ :'unit_spacing' => :'unit_spacing'
64
+ }
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'label' => :'String',
76
+ :'format' => :'String',
77
+ :'currency_code' => :'String',
78
+ :'unit' => :'String',
79
+ :'unit_spacing' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::MetricUpsertRequest` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!self.class.attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::MetricUpsertRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'label')
105
+ self.label = attributes[:'label']
106
+ end
107
+
108
+ if attributes.key?(:'format')
109
+ self.format = attributes[:'format']
110
+ end
111
+
112
+ if attributes.key?(:'currency_code')
113
+ self.currency_code = attributes[:'currency_code']
114
+ end
115
+
116
+ if attributes.key?(:'unit')
117
+ self.unit = attributes[:'unit']
118
+ end
119
+
120
+ if attributes.key?(:'unit_spacing')
121
+ self.unit_spacing = attributes[:'unit_spacing']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if !@label.nil? && @label.to_s.length > 80
131
+ invalid_properties.push('invalid value for "label", the character length must be smaller than or equal to 80.')
132
+ end
133
+
134
+ if !@label.nil? && @label.to_s.length < 1
135
+ invalid_properties.push('invalid value for "label", the character length must be great than or equal to 1.')
136
+ end
137
+
138
+ pattern = Regexp.new(/^[A-Za-z]{3}$/)
139
+ if !@currency_code.nil? && @currency_code !~ pattern
140
+ invalid_properties.push("invalid value for \"currency_code\", must conform to the pattern #{pattern}.")
141
+ end
142
+
143
+ if !@unit.nil? && @unit.to_s.length > 16
144
+ invalid_properties.push('invalid value for "unit", the character length must be smaller than or equal to 16.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if !@label.nil? && @label.to_s.length > 80
155
+ return false if !@label.nil? && @label.to_s.length < 1
156
+ format_validator = EnumAttributeValidator.new('String', ["number", "currency", "percent", "unit", "string"])
157
+ return false unless format_validator.valid?(@format)
158
+ return false if !@currency_code.nil? && @currency_code !~ Regexp.new(/^[A-Za-z]{3}$/)
159
+ return false if !@unit.nil? && @unit.to_s.length > 16
160
+ unit_spacing_validator = EnumAttributeValidator.new('String', ["none", "space"])
161
+ return false unless unit_spacing_validator.valid?(@unit_spacing)
162
+ true
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] label Value to be assigned
167
+ def label=(label)
168
+ if label.nil?
169
+ fail ArgumentError, 'label cannot be nil'
170
+ end
171
+
172
+ if label.to_s.length > 80
173
+ fail ArgumentError, 'invalid value for "label", the character length must be smaller than or equal to 80.'
174
+ end
175
+
176
+ if label.to_s.length < 1
177
+ fail ArgumentError, 'invalid value for "label", the character length must be great than or equal to 1.'
178
+ end
179
+
180
+ @label = label
181
+ end
182
+
183
+ # Custom attribute writer method checking allowed values (enum).
184
+ # @param [Object] format Object to be assigned
185
+ def format=(format)
186
+ validator = EnumAttributeValidator.new('String', ["number", "currency", "percent", "unit", "string"])
187
+ unless validator.valid?(format)
188
+ fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
189
+ end
190
+ @format = format
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] currency_code Value to be assigned
195
+ def currency_code=(currency_code)
196
+ if currency_code.nil?
197
+ fail ArgumentError, 'currency_code cannot be nil'
198
+ end
199
+
200
+ pattern = Regexp.new(/^[A-Za-z]{3}$/)
201
+ if currency_code !~ pattern
202
+ fail ArgumentError, "invalid value for \"currency_code\", must conform to the pattern #{pattern}."
203
+ end
204
+
205
+ @currency_code = currency_code
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param [Object] unit Value to be assigned
210
+ def unit=(unit)
211
+ if unit.nil?
212
+ fail ArgumentError, 'unit cannot be nil'
213
+ end
214
+
215
+ if unit.to_s.length > 16
216
+ fail ArgumentError, 'invalid value for "unit", the character length must be smaller than or equal to 16.'
217
+ end
218
+
219
+ @unit = unit
220
+ end
221
+
222
+ # Custom attribute writer method checking allowed values (enum).
223
+ # @param [Object] unit_spacing Object to be assigned
224
+ def unit_spacing=(unit_spacing)
225
+ validator = EnumAttributeValidator.new('String', ["none", "space"])
226
+ unless validator.valid?(unit_spacing)
227
+ fail ArgumentError, "invalid value for \"unit_spacing\", must be one of #{validator.allowable_values}."
228
+ end
229
+ @unit_spacing = unit_spacing
230
+ end
231
+
232
+ # Checks equality by comparing each attribute.
233
+ # @param [Object] Object to be compared
234
+ def ==(o)
235
+ return true if self.equal?(o)
236
+ self.class == o.class &&
237
+ label == o.label &&
238
+ format == o.format &&
239
+ currency_code == o.currency_code &&
240
+ unit == o.unit &&
241
+ unit_spacing == o.unit_spacing
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(o)
247
+ self == o
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Integer] Hash code
252
+ def hash
253
+ [label, format, currency_code, unit, unit_spacing].hash
254
+ end
255
+
256
+ # Builds the object from hash
257
+ # @param [Hash] attributes Model attributes in the form of hash
258
+ # @return [Object] Returns the model itself
259
+ def self.build_from_hash(attributes)
260
+ return nil unless attributes.is_a?(Hash)
261
+ attributes = attributes.transform_keys(&:to_sym)
262
+ transformed_hash = {}
263
+ openapi_types.each_pair do |key, type|
264
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
265
+ transformed_hash["#{key}"] = nil
266
+ elsif type =~ /\AArray<(.*)>/i
267
+ # check to ensure the input is an array given that the attribute
268
+ # is documented as an array but the input is not
269
+ if attributes[attribute_map[key]].is_a?(Array)
270
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
271
+ end
272
+ elsif !attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
274
+ end
275
+ end
276
+ new(transformed_hash)
277
+ end
278
+
279
+ # Deserializes the data based on type
280
+ # @param string type Data type
281
+ # @param string value Value to be deserialized
282
+ # @return [Object] Deserialized data
283
+ def self._deserialize(type, value)
284
+ case type.to_sym
285
+ when :Time
286
+ Time.parse(value)
287
+ when :Date
288
+ Date.parse(value)
289
+ when :String
290
+ value.to_s
291
+ when :Integer
292
+ value.to_i
293
+ when :Float
294
+ value.to_f
295
+ when :Boolean
296
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
297
+ true
298
+ else
299
+ false
300
+ end
301
+ when :Object
302
+ # generic object (usually a Hash), return directly
303
+ value
304
+ when /\AArray<(?<inner_type>.+)>\z/
305
+ inner_type = Regexp.last_match[:inner_type]
306
+ value.map { |v| _deserialize(inner_type, v) }
307
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
308
+ k_type = Regexp.last_match[:k_type]
309
+ v_type = Regexp.last_match[:v_type]
310
+ {}.tap do |hash|
311
+ value.each do |k, v|
312
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
313
+ end
314
+ end
315
+ else # model
316
+ # models (e.g. Pet) or oneOf
317
+ klass = OpenapiClient.const_get(type)
318
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
319
+ end
320
+ end
321
+
322
+ # Returns the string representation of the object
323
+ # @return [String] String presentation of the object
324
+ def to_s
325
+ to_hash.to_s
326
+ end
327
+
328
+ # to_body is an alias to to_hash (backward compatibility)
329
+ # @return [Hash] Returns the object in the form of hash
330
+ def to_body
331
+ to_hash
332
+ end
333
+
334
+ # Returns the object in the form of hash
335
+ # @return [Hash] Returns the object in the form of hash
336
+ def to_hash
337
+ hash = {}
338
+ self.class.attribute_map.each_pair do |attr, param|
339
+ value = self.send(attr)
340
+ if value.nil?
341
+ is_nullable = self.class.openapi_nullable.include?(attr)
342
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
343
+ end
344
+
345
+ hash[param] = _to_hash(value)
346
+ end
347
+ hash
348
+ end
349
+
350
+ # Outputs non-array value in the form of hash
351
+ # For object, use to_hash. Otherwise, just return the value
352
+ # @param [Object] value Any valid value
353
+ # @return [Hash] Returns the value in the form of hash
354
+ def _to_hash(value)
355
+ if value.is_a?(Array)
356
+ value.compact.map { |v| _to_hash(v) }
357
+ elsif value.is_a?(Hash)
358
+ {}.tap do |hash|
359
+ value.each { |k, v| hash[k] = _to_hash(v) }
360
+ end
361
+ elsif value.respond_to? :to_hash
362
+ value.to_hash
363
+ else
364
+ value
365
+ end
366
+ end
367
+
368
+ end
369
+
370
+ end
@@ -17,10 +17,14 @@ module OpenapiClient
17
17
  class MetricValueUpdateResponse
18
18
  attr_accessor :success
19
19
 
20
+ # true when this request created the metric because no metric used the key yet.
21
+ attr_accessor :created
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
- :'success' => :'success'
26
+ :'success' => :'success',
27
+ :'created' => :'created'
24
28
  }
25
29
  end
26
30
 
@@ -32,7 +36,8 @@ module OpenapiClient
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
35
- :'success' => :'Boolean'
39
+ :'success' => :'Boolean',
40
+ :'created' => :'Boolean'
36
41
  }
37
42
  end
38
43
 
@@ -62,6 +67,10 @@ module OpenapiClient
62
67
  else
63
68
  self.success = nil
64
69
  end
70
+
71
+ if attributes.key?(:'created')
72
+ self.created = attributes[:'created']
73
+ end
65
74
  end
66
75
 
67
76
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -89,7 +98,8 @@ module OpenapiClient
89
98
  def ==(o)
90
99
  return true if self.equal?(o)
91
100
  self.class == o.class &&
92
- success == o.success
101
+ success == o.success &&
102
+ created == o.created
93
103
  end
94
104
 
95
105
  # @see the `==` method
@@ -101,7 +111,7 @@ module OpenapiClient
101
111
  # Calculates hash code according to all attributes.
102
112
  # @return [Integer] Hash code
103
113
  def hash
104
- [success].hash
114
+ [success, created].hash
105
115
  end
106
116
 
107
117
  # Builds the object from hash