activitysmith 1.2.0 → 1.3.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.
@@ -15,12 +15,12 @@ require 'time'
15
15
 
16
16
  module OpenapiClient
17
17
  class MetricValueUpdateResponse
18
- attr_accessor :metric
18
+ attr_accessor :success
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :'metric' => :'metric'
23
+ :'success' => :'success'
24
24
  }
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ module OpenapiClient
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'metric' => :'WidgetMetric'
35
+ :'success' => :'Boolean'
36
36
  }
37
37
  end
38
38
 
@@ -57,10 +57,10 @@ module OpenapiClient
57
57
  h[k.to_sym] = v
58
58
  }
59
59
 
60
- if attributes.key?(:'metric')
61
- self.metric = attributes[:'metric']
60
+ if attributes.key?(:'success')
61
+ self.success = attributes[:'success']
62
62
  else
63
- self.metric = nil
63
+ self.success = nil
64
64
  end
65
65
  end
66
66
 
@@ -69,8 +69,8 @@ module OpenapiClient
69
69
  def list_invalid_properties
70
70
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
71
  invalid_properties = Array.new
72
- if @metric.nil?
73
- invalid_properties.push('invalid value for "metric", metric cannot be nil.')
72
+ if @success.nil?
73
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
74
74
  end
75
75
 
76
76
  invalid_properties
@@ -80,7 +80,7 @@ module OpenapiClient
80
80
  # @return true if the model is valid
81
81
  def valid?
82
82
  warn '[DEPRECATED] the `valid?` method is obsolete'
83
- return false if @metric.nil?
83
+ return false if @success.nil?
84
84
  true
85
85
  end
86
86
 
@@ -89,7 +89,7 @@ module OpenapiClient
89
89
  def ==(o)
90
90
  return true if self.equal?(o)
91
91
  self.class == o.class &&
92
- metric == o.metric
92
+ success == o.success
93
93
  end
94
94
 
95
95
  # @see the `==` method
@@ -101,7 +101,7 @@ module OpenapiClient
101
101
  # Calculates hash code according to all attributes.
102
102
  # @return [Integer] Hash code
103
103
  def hash
104
- [metric].hash
104
+ [success].hash
105
105
  end
106
106
 
107
107
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OpenapiClient
17
- # Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, and metrics types.
17
+ # Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, and stats types.
18
18
  class StreamContentState
19
19
  attr_accessor :title
20
20
 
@@ -47,7 +47,7 @@ module OpenapiClient
47
47
  # Optional. Colors for completed steps. When used with segmented_progress, the array length should match current_step.
48
48
  attr_accessor :step_colors
49
49
 
50
- # Use for metrics activities.
50
+ # Use for metrics and stats activities.
51
51
  attr_accessor :metrics
52
52
 
53
53
  # Optional. Seconds before the ended Live Activity is dismissed.
@@ -234,6 +234,10 @@ module OpenapiClient
234
234
  invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.')
235
235
  end
236
236
 
237
+ if !@metrics.nil? && @metrics.length > 8
238
+ invalid_properties.push('invalid value for "metrics", number of items must be less than or equal to 8.')
239
+ end
240
+
237
241
  if !@metrics.nil? && @metrics.length < 1
238
242
  invalid_properties.push('invalid value for "metrics", number of items must be greater than or equal to 1.')
239
243
  end
@@ -258,12 +262,13 @@ module OpenapiClient
258
262
  return false if !@current_step.nil? && @current_step < 1
259
263
  return false if !@percentage.nil? && @percentage > 100
260
264
  return false if !@percentage.nil? && @percentage < 0
261
- type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
265
+ type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats"])
262
266
  return false unless type_validator.valid?(@type)
263
267
  color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"])
264
268
  return false unless color_validator.valid?(@color)
265
269
  step_color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"])
266
270
  return false unless step_color_validator.valid?(@step_color)
271
+ return false if !@metrics.nil? && @metrics.length > 8
267
272
  return false if !@metrics.nil? && @metrics.length < 1
268
273
  return false if !@auto_dismiss_seconds.nil? && @auto_dismiss_seconds < 0
269
274
  return false if !@auto_dismiss_minutes.nil? && @auto_dismiss_minutes < 0
@@ -319,7 +324,7 @@ module OpenapiClient
319
324
  # Custom attribute writer method checking allowed values (enum).
320
325
  # @param [Object] type Object to be assigned
321
326
  def type=(type)
322
- validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics"])
327
+ validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress", "metrics", "stats"])
323
328
  unless validator.valid?(type)
324
329
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
325
330
  end
@@ -353,6 +358,10 @@ module OpenapiClient
353
358
  fail ArgumentError, 'metrics cannot be nil'
354
359
  end
355
360
 
361
+ if metrics.length > 8
362
+ fail ArgumentError, 'invalid value for "metrics", number of items must be less than or equal to 8.'
363
+ end
364
+
356
365
  if metrics.length < 1
357
366
  fail ArgumentError, 'invalid value for "metrics", number of items must be greater than or equal to 1.'
358
367
  end
@@ -11,5 +11,5 @@ Generator version: 7.7.0
11
11
  =end
12
12
 
13
13
  module OpenapiClient
14
- VERSION = '1.1.0'
14
+ VERSION = '1.3.0'
15
15
  end
@@ -18,6 +18,7 @@ require 'activitysmith_openapi/configuration'
18
18
 
19
19
  # Models
20
20
  require 'activitysmith_openapi/models/activity_metric'
21
+ require 'activitysmith_openapi/models/activity_metric_value'
21
22
  require 'activitysmith_openapi/models/alert_payload'
22
23
  require 'activitysmith_openapi/models/bad_request_error'
23
24
  require 'activitysmith_openapi/models/channel_target'
@@ -40,8 +41,6 @@ require 'activitysmith_openapi/models/live_activity_update_request'
40
41
  require 'activitysmith_openapi/models/live_activity_update_response'
41
42
  require 'activitysmith_openapi/models/live_activity_webhook_method'
42
43
  require 'activitysmith_openapi/models/metric_error'
43
- require 'activitysmith_openapi/models/metric_format'
44
- require 'activitysmith_openapi/models/metric_unit_spacing'
45
44
  require 'activitysmith_openapi/models/metric_value_update_request'
46
45
  require 'activitysmith_openapi/models/metric_value_update_request_value'
47
46
  require 'activitysmith_openapi/models/metric_value_update_response'
@@ -55,8 +54,6 @@ require 'activitysmith_openapi/models/push_notification_webhook_method'
55
54
  require 'activitysmith_openapi/models/rate_limit_error'
56
55
  require 'activitysmith_openapi/models/send_push_notification429_response'
57
56
  require 'activitysmith_openapi/models/stream_content_state'
58
- require 'activitysmith_openapi/models/widget_metric'
59
- require 'activitysmith_openapi/models/widget_metric_latest_value'
60
57
 
61
58
  # APIs
62
59
  require 'activitysmith_openapi/api/live_activities_api'
@@ -2,6 +2,11 @@
2
2
 
3
3
  module ActivitySmith
4
4
  class LiveActivities
5
+ TYPE_SEGMENTED_PROGRESS = "segmented_progress"
6
+ TYPE_PROGRESS = "progress"
7
+ TYPE_METRICS = "metrics"
8
+ TYPE_STATS = "stats"
9
+
5
10
  def initialize(api)
6
11
  @api = api
7
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivitySmith
4
- VERSION = "1.2.0"
4
+ VERSION = "1.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activitysmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ActivitySmith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-03 00:00:00.000000000 Z
11
+ date: 2026-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -83,6 +83,7 @@ files:
83
83
  - generated/activitysmith_openapi/api_error.rb
84
84
  - generated/activitysmith_openapi/configuration.rb
85
85
  - generated/activitysmith_openapi/models/activity_metric.rb
86
+ - generated/activitysmith_openapi/models/activity_metric_value.rb
86
87
  - generated/activitysmith_openapi/models/alert_payload.rb
87
88
  - generated/activitysmith_openapi/models/bad_request_error.rb
88
89
  - generated/activitysmith_openapi/models/channel_target.rb
@@ -105,8 +106,6 @@ files:
105
106
  - generated/activitysmith_openapi/models/live_activity_update_response.rb
106
107
  - generated/activitysmith_openapi/models/live_activity_webhook_method.rb
107
108
  - generated/activitysmith_openapi/models/metric_error.rb
108
- - generated/activitysmith_openapi/models/metric_format.rb
109
- - generated/activitysmith_openapi/models/metric_unit_spacing.rb
110
109
  - generated/activitysmith_openapi/models/metric_value_update_request.rb
111
110
  - generated/activitysmith_openapi/models/metric_value_update_request_value.rb
112
111
  - generated/activitysmith_openapi/models/metric_value_update_response.rb
@@ -120,8 +119,6 @@ files:
120
119
  - generated/activitysmith_openapi/models/rate_limit_error.rb
121
120
  - generated/activitysmith_openapi/models/send_push_notification429_response.rb
122
121
  - generated/activitysmith_openapi/models/stream_content_state.rb
123
- - generated/activitysmith_openapi/models/widget_metric.rb
124
- - generated/activitysmith_openapi/models/widget_metric_latest_value.rb
125
122
  - generated/activitysmith_openapi/version.rb
126
123
  - lib/activitysmith.rb
127
124
  - lib/activitysmith/client.rb
@@ -1,43 +0,0 @@
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 MetricFormat
18
- NUMBER = "number".freeze
19
- CURRENCY = "currency".freeze
20
- PERCENT = "percent".freeze
21
- UNIT = "unit".freeze
22
- STRING = "string".freeze
23
-
24
- def self.all_vars
25
- @all_vars ||= [NUMBER, CURRENCY, PERCENT, UNIT, STRING].freeze
26
- end
27
-
28
- # Builds the enum from string
29
- # @param [String] The enum value in the form of the string
30
- # @return [String] The enum value
31
- def self.build_from_hash(value)
32
- new.build_from_hash(value)
33
- end
34
-
35
- # Builds the enum from string
36
- # @param [String] The enum value in the form of the string
37
- # @return [String] The enum value
38
- def build_from_hash(value)
39
- return value if MetricFormat.all_vars.include?(value)
40
- raise "Invalid ENUM value #{value} for class #MetricFormat"
41
- end
42
- end
43
- end
@@ -1,40 +0,0 @@
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 MetricUnitSpacing
18
- NONE = "none".freeze
19
- SPACE = "space".freeze
20
-
21
- def self.all_vars
22
- @all_vars ||= [NONE, SPACE].freeze
23
- end
24
-
25
- # Builds the enum from string
26
- # @param [String] The enum value in the form of the string
27
- # @return [String] The enum value
28
- def self.build_from_hash(value)
29
- new.build_from_hash(value)
30
- end
31
-
32
- # Builds the enum from string
33
- # @param [String] The enum value in the form of the string
34
- # @return [String] The enum value
35
- def build_from_hash(value)
36
- return value if MetricUnitSpacing.all_vars.include?(value)
37
- raise "Invalid ENUM value #{value} for class #MetricUnitSpacing"
38
- end
39
- end
40
- end