Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion generated/activitysmith_openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
require 'activitysmith_openapi/models/send_push_notification429_response'
require 'activitysmith_openapi/models/stream_content_state'
require 'activitysmith_openapi/models/widget_metric'
require 'activitysmith_openapi/models/widget_metric_latest_value'

# APIs
require 'activitysmith_openapi/api/live_activities_api'
Expand Down
4 changes: 2 additions & 2 deletions generated/activitysmith_openapi/api/metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Update a widget metric value
# Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
# 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.
# @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
# @param metric_value_update_request [MetricValueUpdateRequest]
# @param [Hash] opts the optional parameters
Expand All @@ -31,7 +31,7 @@ def update_metric_value(key, metric_value_update_request, opts = {})
end

# Update a widget metric value
# Updates the latest value for a metric configured in ActivitySmith widgets. Create the metric in the web app first, then write values using its key. Numeric metric formats accept finite numbers. String metrics accept non-empty text up to 64 characters.
# 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.
# @param key [String] Metric key configured in the web app. Lowercase letters, numbers, dots, underscores, and dashes are allowed.
# @param metric_value_update_request [MetricValueUpdateRequest]
# @param [Hash] opts the optional parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

module OpenapiClient
class MetricValueUpdateResponse
attr_accessor :metric
attr_accessor :success

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'metric' => :'metric'
:'success' => :'success'
}
end

Expand All @@ -32,7 +32,7 @@ def self.acceptable_attributes
# Attribute type mapping.
def self.openapi_types
{
:'metric' => :'WidgetMetric'
:'success' => :'Boolean'
}
end

Expand All @@ -57,10 +57,10 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'metric')
self.metric = attributes[:'metric']
if attributes.key?(:'success')
self.success = attributes[:'success']
else
self.metric = nil
self.success = nil
end
end

Expand All @@ -69,8 +69,8 @@ def initialize(attributes = {})
def list_invalid_properties
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
invalid_properties = Array.new
if @metric.nil?
invalid_properties.push('invalid value for "metric", metric cannot be nil.')
if @success.nil?
invalid_properties.push('invalid value for "success", success cannot be nil.')
end

invalid_properties
Expand All @@ -80,7 +80,7 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
warn '[DEPRECATED] the `valid?` method is obsolete'
return false if @metric.nil?
return false if @success.nil?
true
end

Expand All @@ -89,7 +89,7 @@ def valid?
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
metric == o.metric
success == o.success
end

# @see the `==` method
Expand All @@ -101,7 +101,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[metric].hash
[success].hash
end

# Builds the object from hash
Expand Down
43 changes: 34 additions & 9 deletions generated/activitysmith_openapi/models/widget_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class WidgetMetric

attr_accessor :format

# Latest metric value. Numeric formats return a number. String metrics return text.
attr_accessor :latest_value

attr_accessor :latest_value_at
Expand Down Expand Up @@ -94,7 +95,7 @@ def self.openapi_types
:'unit' => :'String',
:'unit_spacing' => :'MetricUnitSpacing',
:'format' => :'MetricFormat',
:'latest_value' => :'WidgetMetricLatestValue',
:'latest_value' => :'Float',
:'latest_value_at' => :'Time',
:'created_at' => :'Time',
:'updated_at' => :'Time'
Expand All @@ -104,10 +105,6 @@ def self.openapi_types
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
:'currency_code',
:'unit',
:'latest_value',
:'latest_value_at',
])
end

Expand Down Expand Up @@ -231,6 +228,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "label", the character length must be great than or equal to 1.')
end

if @currency_code.nil?
invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
end

if @currency_code.to_s.length > 3
invalid_properties.push('invalid value for "currency_code", the character length must be smaller than or equal to 3.')
end
Expand All @@ -244,6 +245,10 @@ def list_invalid_properties
invalid_properties.push("invalid value for \"currency_code\", must conform to the pattern #{pattern}.")
end

if @unit.nil?
invalid_properties.push('invalid value for "unit", unit cannot be nil.')
end

if @unit.to_s.length > 16
invalid_properties.push('invalid value for "unit", the character length must be smaller than or equal to 16.')
end
Expand All @@ -256,6 +261,14 @@ def list_invalid_properties
invalid_properties.push('invalid value for "format", format cannot be nil.')
end

if @latest_value.nil?
invalid_properties.push('invalid value for "latest_value", latest_value cannot be nil.')
end

if @latest_value_at.nil?
invalid_properties.push('invalid value for "latest_value_at", latest_value_at cannot be nil.')
end

if @created_at.nil?
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
end
Expand All @@ -279,12 +292,16 @@ def valid?
return false if @label.nil?
return false if @label.to_s.length > 80
return false if @label.to_s.length < 1
return false if @currency_code.nil?
return false if @currency_code.to_s.length > 3
return false if @currency_code.to_s.length < 3
return false if @currency_code !~ Regexp.new(/^[A-Z]{3}$/)
return false if @unit.nil?
return false if @unit.to_s.length > 16
return false if @unit_spacing.nil?
return false if @format.nil?
return false if @latest_value.nil?
return false if @latest_value_at.nil?
return false if @created_at.nil?
return false if @updated_at.nil?
true
Expand Down Expand Up @@ -334,16 +351,20 @@ def label=(label)
# Custom attribute writer method with validation
# @param [Object] currency_code Value to be assigned
def currency_code=(currency_code)
if !currency_code.nil? && currency_code.to_s.length > 3
if currency_code.nil?
fail ArgumentError, 'currency_code cannot be nil'
end

if currency_code.to_s.length > 3
fail ArgumentError, 'invalid value for "currency_code", the character length must be smaller than or equal to 3.'
end

if !currency_code.nil? && currency_code.to_s.length < 3
if currency_code.to_s.length < 3
fail ArgumentError, 'invalid value for "currency_code", the character length must be great than or equal to 3.'
end

pattern = Regexp.new(/^[A-Z]{3}$/)
if !currency_code.nil? && currency_code !~ pattern
if currency_code !~ pattern
fail ArgumentError, "invalid value for \"currency_code\", must conform to the pattern #{pattern}."
end

Expand All @@ -353,7 +374,11 @@ def currency_code=(currency_code)
# Custom attribute writer method with validation
# @param [Object] unit Value to be assigned
def unit=(unit)
if !unit.nil? && unit.to_s.length > 16
if unit.nil?
fail ArgumentError, 'unit cannot be nil'
end

if unit.to_s.length > 16
fail ArgumentError, 'invalid value for "unit", the character length must be smaller than or equal to 16.'
end

Expand Down
105 changes: 0 additions & 105 deletions generated/activitysmith_openapi/models/widget_metric_latest_value.rb

This file was deleted.

2 changes: 1 addition & 1 deletion generated/activitysmith_openapi/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module OpenapiClient
VERSION = '1.1.0'
VERSION = '1.2.0'
end