From 65f36195d6b284799731c85a5e34d1542d63b888 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Sun, 3 May 2026 12:17:53 +0000 Subject: [PATCH] chore: regenerate SDK --- generated/activitysmith_openapi.rb | 4 - .../activitysmith_openapi/api/metrics_api.rb | 4 +- .../models/metric_format.rb | 43 -- .../models/metric_unit_spacing.rb | 40 -- .../models/metric_value_update_response.rb | 22 +- .../models/widget_metric.rb | 507 ------------------ .../models/widget_metric_latest_value.rb | 105 ---- generated/activitysmith_openapi/version.rb | 2 +- 8 files changed, 14 insertions(+), 713 deletions(-) delete mode 100644 generated/activitysmith_openapi/models/metric_format.rb delete mode 100644 generated/activitysmith_openapi/models/metric_unit_spacing.rb delete mode 100644 generated/activitysmith_openapi/models/widget_metric.rb delete mode 100644 generated/activitysmith_openapi/models/widget_metric_latest_value.rb diff --git a/generated/activitysmith_openapi.rb b/generated/activitysmith_openapi.rb index 664f7d0..99e50ad 100644 --- a/generated/activitysmith_openapi.rb +++ b/generated/activitysmith_openapi.rb @@ -40,8 +40,6 @@ require 'activitysmith_openapi/models/live_activity_update_response' require 'activitysmith_openapi/models/live_activity_webhook_method' require 'activitysmith_openapi/models/metric_error' -require 'activitysmith_openapi/models/metric_format' -require 'activitysmith_openapi/models/metric_unit_spacing' require 'activitysmith_openapi/models/metric_value_update_request' require 'activitysmith_openapi/models/metric_value_update_request_value' require 'activitysmith_openapi/models/metric_value_update_response' @@ -55,8 +53,6 @@ require 'activitysmith_openapi/models/rate_limit_error' 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' diff --git a/generated/activitysmith_openapi/api/metrics_api.rb b/generated/activitysmith_openapi/api/metrics_api.rb index 0814897..e625768 100644 --- a/generated/activitysmith_openapi/api/metrics_api.rb +++ b/generated/activitysmith_openapi/api/metrics_api.rb @@ -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 @@ -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 diff --git a/generated/activitysmith_openapi/models/metric_format.rb b/generated/activitysmith_openapi/models/metric_format.rb deleted file mode 100644 index 07eda90..0000000 --- a/generated/activitysmith_openapi/models/metric_format.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#ActivitySmith API - -#Send push notifications and Live Activities to your own devices via a single API key. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.7.0 - -=end - -require 'date' -require 'time' - -module OpenapiClient - class MetricFormat - NUMBER = "number".freeze - CURRENCY = "currency".freeze - PERCENT = "percent".freeze - UNIT = "unit".freeze - STRING = "string".freeze - - def self.all_vars - @all_vars ||= [NUMBER, CURRENCY, PERCENT, UNIT, STRING].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if MetricFormat.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #MetricFormat" - end - end -end diff --git a/generated/activitysmith_openapi/models/metric_unit_spacing.rb b/generated/activitysmith_openapi/models/metric_unit_spacing.rb deleted file mode 100644 index 2df2d02..0000000 --- a/generated/activitysmith_openapi/models/metric_unit_spacing.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#ActivitySmith API - -#Send push notifications and Live Activities to your own devices via a single API key. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.7.0 - -=end - -require 'date' -require 'time' - -module OpenapiClient - class MetricUnitSpacing - NONE = "none".freeze - SPACE = "space".freeze - - def self.all_vars - @all_vars ||= [NONE, SPACE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if MetricUnitSpacing.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #MetricUnitSpacing" - end - end -end diff --git a/generated/activitysmith_openapi/models/metric_value_update_response.rb b/generated/activitysmith_openapi/models/metric_value_update_response.rb index 1a400d2..daab4cd 100644 --- a/generated/activitysmith_openapi/models/metric_value_update_response.rb +++ b/generated/activitysmith_openapi/models/metric_value_update_response.rb @@ -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 @@ -32,7 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'metric' => :'WidgetMetric' + :'success' => :'Boolean' } end @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/generated/activitysmith_openapi/models/widget_metric.rb b/generated/activitysmith_openapi/models/widget_metric.rb deleted file mode 100644 index 0826b04..0000000 --- a/generated/activitysmith_openapi/models/widget_metric.rb +++ /dev/null @@ -1,507 +0,0 @@ -=begin -#ActivitySmith API - -#Send push notifications and Live Activities to your own devices via a single API key. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.7.0 - -=end - -require 'date' -require 'time' - -module OpenapiClient - # A metric configured for ActivitySmith widgets. - class WidgetMetric - attr_accessor :public_id - - attr_accessor :key - - attr_accessor :label - - # Present when format is currency. - attr_accessor :currency_code - - # Present when format is unit. - attr_accessor :unit - - attr_accessor :unit_spacing - - attr_accessor :format - - attr_accessor :latest_value - - attr_accessor :latest_value_at - - attr_accessor :created_at - - attr_accessor :updated_at - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'public_id' => :'public_id', - :'key' => :'key', - :'label' => :'label', - :'currency_code' => :'currency_code', - :'unit' => :'unit', - :'unit_spacing' => :'unit_spacing', - :'format' => :'format', - :'latest_value' => :'latest_value', - :'latest_value_at' => :'latest_value_at', - :'created_at' => :'created_at', - :'updated_at' => :'updated_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'public_id' => :'String', - :'key' => :'String', - :'label' => :'String', - :'currency_code' => :'String', - :'unit' => :'String', - :'unit_spacing' => :'MetricUnitSpacing', - :'format' => :'MetricFormat', - :'latest_value' => :'WidgetMetricLatestValue', - :'latest_value_at' => :'Time', - :'created_at' => :'Time', - :'updated_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'currency_code', - :'unit', - :'latest_value', - :'latest_value_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::WidgetMetric` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::WidgetMetric`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'public_id') - self.public_id = attributes[:'public_id'] - else - self.public_id = nil - end - - if attributes.key?(:'key') - self.key = attributes[:'key'] - else - self.key = nil - end - - if attributes.key?(:'label') - self.label = attributes[:'label'] - else - self.label = nil - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - else - self.currency_code = nil - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - else - self.unit = nil - end - - if attributes.key?(:'unit_spacing') - self.unit_spacing = attributes[:'unit_spacing'] - else - self.unit_spacing = nil - end - - if attributes.key?(:'format') - self.format = attributes[:'format'] - else - self.format = nil - end - - if attributes.key?(:'latest_value') - self.latest_value = attributes[:'latest_value'] - else - self.latest_value = nil - end - - if attributes.key?(:'latest_value_at') - self.latest_value_at = attributes[:'latest_value_at'] - else - self.latest_value_at = nil - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - else - self.created_at = nil - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - else - self.updated_at = nil - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @public_id.nil? - invalid_properties.push('invalid value for "public_id", public_id cannot be nil.') - end - - if @key.nil? - invalid_properties.push('invalid value for "key", key cannot be nil.') - end - - if @key.to_s.length > 64 - invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 64.') - end - - if @key.to_s.length < 1 - invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.') - end - - pattern = Regexp.new(/^[a-z0-9][a-z0-9_.-]{0,63}$/) - if @key !~ pattern - invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.") - end - - if @label.nil? - invalid_properties.push('invalid value for "label", label cannot be nil.') - end - - if @label.to_s.length > 80 - invalid_properties.push('invalid value for "label", the character length must be smaller than or equal to 80.') - end - - if @label.to_s.length < 1 - invalid_properties.push('invalid value for "label", the character length must be great than or equal to 1.') - 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 - - if @currency_code.to_s.length < 3 - invalid_properties.push('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 !~ pattern - invalid_properties.push("invalid value for \"currency_code\", must conform to the pattern #{pattern}.") - 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 - - if @unit_spacing.nil? - invalid_properties.push('invalid value for "unit_spacing", unit_spacing cannot be nil.') - end - - if @format.nil? - invalid_properties.push('invalid value for "format", format cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @updated_at.nil? - invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @public_id.nil? - return false if @key.nil? - return false if @key.to_s.length > 64 - return false if @key.to_s.length < 1 - return false if @key !~ Regexp.new(/^[a-z0-9][a-z0-9_.-]{0,63}$/) - 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.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.to_s.length > 16 - return false if @unit_spacing.nil? - return false if @format.nil? - return false if @created_at.nil? - return false if @updated_at.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] key Value to be assigned - def key=(key) - if key.nil? - fail ArgumentError, 'key cannot be nil' - end - - if key.to_s.length > 64 - fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 64.' - end - - if key.to_s.length < 1 - fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.' - end - - pattern = Regexp.new(/^[a-z0-9][a-z0-9_.-]{0,63}$/) - if key !~ pattern - fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}." - end - - @key = key - end - - # Custom attribute writer method with validation - # @param [Object] label Value to be assigned - def label=(label) - if label.nil? - fail ArgumentError, 'label cannot be nil' - end - - if label.to_s.length > 80 - fail ArgumentError, 'invalid value for "label", the character length must be smaller than or equal to 80.' - end - - if label.to_s.length < 1 - fail ArgumentError, 'invalid value for "label", the character length must be great than or equal to 1.' - end - - @label = label - end - - # 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 - 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 - 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 - fail ArgumentError, "invalid value for \"currency_code\", must conform to the pattern #{pattern}." - end - - @currency_code = currency_code - end - - # Custom attribute writer method with validation - # @param [Object] unit Value to be assigned - def unit=(unit) - if !unit.nil? && unit.to_s.length > 16 - fail ArgumentError, 'invalid value for "unit", the character length must be smaller than or equal to 16.' - end - - @unit = unit - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - public_id == o.public_id && - key == o.key && - label == o.label && - currency_code == o.currency_code && - unit == o.unit && - unit_spacing == o.unit_spacing && - format == o.format && - latest_value == o.latest_value && - latest_value_at == o.latest_value_at && - created_at == o.created_at && - updated_at == o.updated_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [public_id, key, label, currency_code, unit, unit_spacing, format, latest_value, latest_value_at, created_at, updated_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = OpenapiClient.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/generated/activitysmith_openapi/models/widget_metric_latest_value.rb b/generated/activitysmith_openapi/models/widget_metric_latest_value.rb deleted file mode 100644 index 3d8b002..0000000 --- a/generated/activitysmith_openapi/models/widget_metric_latest_value.rb +++ /dev/null @@ -1,105 +0,0 @@ -=begin -#ActivitySmith API - -#Send push notifications and Live Activities to your own devices via a single API key. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.7.0 - -=end - -require 'date' -require 'time' - -module OpenapiClient - # Latest metric value. Numeric formats return a number. String metrics return text. - module WidgetMetricLatestValue - class << self - # List of class defined in anyOf (OpenAPI v3) - def openapi_any_of - [ - :'Float', - :'String' - ] - end - - # Builds the object - # @param [Mixed] Data to be matched against the list of anyOf items - # @return [Object] Returns the model or the data itself - def build(data) - # Go through the list of anyOf items and attempt to identify the appropriate one. - # Note: - # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) - # due to the way the deserialization is made in the base_object template (it just casts without verifying). - # - TODO: scalar values are de facto behaving as if they were nullable. - # - TODO: logging when debugging is set. - openapi_any_of.each do |klass| - begin - next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - return typed_data if typed_data - rescue # rescue all errors so we keep iterating even if the current item lookup raises - end - end - - openapi_any_of.include?(:AnyType) ? data : nil - end - - private - - SchemaMismatchError = Class.new(StandardError) - - # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. - def find_and_cast_into_type(klass, data) - return if data.nil? - - case klass.to_s - when 'Boolean' - return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) - when 'Float' - return data if data.instance_of?(Float) - when 'Integer' - return data if data.instance_of?(Integer) - when 'Time' - return Time.parse(data) - when 'Date' - return Date.parse(data) - when 'String' - return data if data.instance_of?(String) - when 'Object' # "type: object" - return data if data.instance_of?(Hash) - when /\AArray<(?.+)>\z/ # "type: array" - if data.instance_of?(Array) - sub_type = Regexp.last_match[:sub_type] - return data.map { |item| find_and_cast_into_type(sub_type, item) } - end - when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" - if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } - sub_type = Regexp.last_match[:sub_type] - return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } - end - else # model - const = OpenapiClient.const_get(klass) - if const - if const.respond_to?(:openapi_any_of) # nested anyOf model - model = const.build(data) - return model if model - else - # raise if data contains keys that are not known to the model - raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? - model = const.build_from_hash(data) - return model if model - end - end - end - - raise # if no match by now, raise - rescue - raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" - end - end - end - -end diff --git a/generated/activitysmith_openapi/version.rb b/generated/activitysmith_openapi/version.rb index 39d83db..6522a57 100644 --- a/generated/activitysmith_openapi/version.rb +++ b/generated/activitysmith_openapi/version.rb @@ -11,5 +11,5 @@ =end module OpenapiClient - VERSION = '1.1.0' + VERSION = '1.2.0' end