diff --git a/generated/.regen-branch.txt b/generated/.regen-branch.txt deleted file mode 100644 index 6b9961e..0000000 --- a/generated/.regen-branch.txt +++ /dev/null @@ -1 +0,0 @@ -regen/openapi-13a315d7312968827894bc81e8925cabf13db62a diff --git a/generated/activitysmith_openapi/models/content_state_end.rb b/generated/activitysmith_openapi/models/content_state_end.rb index 4957722..d3420ef 100644 --- a/generated/activitysmith_openapi/models/content_state_end.rb +++ b/generated/activitysmith_openapi/models/content_state_end.rb @@ -14,20 +14,34 @@ require 'time' module OpenapiClient - # End payload. Required fields are title and current_step. number_of_steps is optional. + # End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. Type is optional when ending an existing activity. class ContentStateEnd attr_accessor :title attr_accessor :subtitle + # Total number of steps. Use for type=segmented_progress. attr_accessor :number_of_steps + # Current step. Use for type=segmented_progress. attr_accessor :current_step + # Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. + attr_accessor :percentage + + # Current progress value. Use with upper_limit for type=progress. + attr_accessor :value + + # Maximum progress value. Use with value for type=progress. + attr_accessor :upper_limit + + # Optional. When omitted, the API uses the existing Live Activity type. + attr_accessor :type + # Optional. Accent color for the Live Activity. Defaults to blue. attr_accessor :color - # Optional. Overrides color for the current step. + # Optional. Overrides color for the current step. Only applies to type=segmented_progress. attr_accessor :step_color # Optional. Minutes before the ended Live Activity is dismissed. Default 3. Set 0 for immediate dismissal. iOS will dismiss ended Live Activities after ~4 hours max. @@ -62,6 +76,10 @@ def self.attribute_map :'subtitle' => :'subtitle', :'number_of_steps' => :'number_of_steps', :'current_step' => :'current_step', + :'percentage' => :'percentage', + :'value' => :'value', + :'upper_limit' => :'upper_limit', + :'type' => :'type', :'color' => :'color', :'step_color' => :'step_color', :'auto_dismiss_minutes' => :'auto_dismiss_minutes' @@ -80,6 +98,10 @@ def self.openapi_types :'subtitle' => :'String', :'number_of_steps' => :'Integer', :'current_step' => :'Integer', + :'percentage' => :'Float', + :'value' => :'Float', + :'upper_limit' => :'Float', + :'type' => :'String', :'color' => :'String', :'step_color' => :'String', :'auto_dismiss_minutes' => :'Integer' @@ -123,8 +145,22 @@ def initialize(attributes = {}) if attributes.key?(:'current_step') self.current_step = attributes[:'current_step'] - else - self.current_step = nil + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'upper_limit') + self.upper_limit = attributes[:'upper_limit'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] end if attributes.key?(:'color') @@ -157,12 +193,16 @@ def list_invalid_properties invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.') end - if @current_step.nil? - invalid_properties.push('invalid value for "current_step", current_step cannot be nil.') + if !@current_step.nil? && @current_step < 1 + invalid_properties.push('invalid value for "current_step", must be greater than or equal to 1.') end - if @current_step < 1 - invalid_properties.push('invalid value for "current_step", must be greater than or equal to 1.') + if !@percentage.nil? && @percentage > 100 + invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.') + end + + if !@percentage.nil? && @percentage < 0 + invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.') end if !@auto_dismiss_minutes.nil? && @auto_dismiss_minutes < 0 @@ -178,8 +218,11 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @title.nil? return false if !@number_of_steps.nil? && @number_of_steps < 1 - return false if @current_step.nil? - return false if @current_step < 1 + return false if !@current_step.nil? && @current_step < 1 + return false if !@percentage.nil? && @percentage > 100 + return false if !@percentage.nil? && @percentage < 0 + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress"]) + return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"]) return false unless color_validator.valid?(@color) step_color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"]) @@ -216,6 +259,34 @@ def current_step=(current_step) @current_step = current_step end + # Custom attribute writer method with validation + # @param [Object] percentage Value to be assigned + def percentage=(percentage) + if percentage.nil? + fail ArgumentError, 'percentage cannot be nil' + end + + if percentage > 100 + fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.' + end + + if percentage < 0 + fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.' + end + + @percentage = percentage + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] color Object to be assigned def color=(color) @@ -259,6 +330,10 @@ def ==(o) subtitle == o.subtitle && number_of_steps == o.number_of_steps && current_step == o.current_step && + percentage == o.percentage && + value == o.value && + upper_limit == o.upper_limit && + type == o.type && color == o.color && step_color == o.step_color && auto_dismiss_minutes == o.auto_dismiss_minutes @@ -273,7 +348,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, color, step_color, auto_dismiss_minutes].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, type, color, step_color, auto_dismiss_minutes].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/content_state_start.rb b/generated/activitysmith_openapi/models/content_state_start.rb index 83b8bd8..6423b5f 100644 --- a/generated/activitysmith_openapi/models/content_state_start.rb +++ b/generated/activitysmith_openapi/models/content_state_start.rb @@ -14,22 +14,33 @@ require 'time' module OpenapiClient - # Start payload requires title, number_of_steps, current_step, and type. + # 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. class ContentStateStart attr_accessor :title attr_accessor :subtitle + # Total number of steps. Use for type=segmented_progress. attr_accessor :number_of_steps + # Current step. Use for type=segmented_progress. attr_accessor :current_step + # Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. + attr_accessor :percentage + + # Current progress value. Use with upper_limit for type=progress. + attr_accessor :value + + # Maximum progress value. Use with value for type=progress. + attr_accessor :upper_limit + attr_accessor :type # Optional. Accent color for the Live Activity. Defaults to blue. attr_accessor :color - # Optional. Overrides color for the current step. + # Optional. Overrides color for the current step. Only applies to type=segmented_progress. attr_accessor :step_color class EnumAttributeValidator @@ -61,6 +72,9 @@ def self.attribute_map :'subtitle' => :'subtitle', :'number_of_steps' => :'number_of_steps', :'current_step' => :'current_step', + :'percentage' => :'percentage', + :'value' => :'value', + :'upper_limit' => :'upper_limit', :'type' => :'type', :'color' => :'color', :'step_color' => :'step_color' @@ -79,6 +93,9 @@ def self.openapi_types :'subtitle' => :'String', :'number_of_steps' => :'Integer', :'current_step' => :'Integer', + :'percentage' => :'Float', + :'value' => :'Float', + :'upper_limit' => :'Float', :'type' => :'String', :'color' => :'String', :'step_color' => :'String' @@ -118,14 +135,22 @@ def initialize(attributes = {}) if attributes.key?(:'number_of_steps') self.number_of_steps = attributes[:'number_of_steps'] - else - self.number_of_steps = nil end if attributes.key?(:'current_step') self.current_step = attributes[:'current_step'] - else - self.current_step = nil + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'upper_limit') + self.upper_limit = attributes[:'upper_limit'] end if attributes.key?(:'type') @@ -154,20 +179,20 @@ def list_invalid_properties invalid_properties.push('invalid value for "title", title cannot be nil.') end - if @number_of_steps.nil? - invalid_properties.push('invalid value for "number_of_steps", number_of_steps cannot be nil.') + if !@number_of_steps.nil? && @number_of_steps < 1 + invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.') end - if @number_of_steps < 1 - invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.') + if !@current_step.nil? && @current_step < 1 + invalid_properties.push('invalid value for "current_step", must be greater than or equal to 1.') end - if @current_step.nil? - invalid_properties.push('invalid value for "current_step", current_step cannot be nil.') + if !@percentage.nil? && @percentage > 100 + invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.') end - if @current_step < 1 - invalid_properties.push('invalid value for "current_step", must be greater than or equal to 1.') + if !@percentage.nil? && @percentage < 0 + invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.') end if @type.nil? @@ -182,12 +207,12 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @title.nil? - return false if @number_of_steps.nil? - return false if @number_of_steps < 1 - return false if @current_step.nil? - return false if @current_step < 1 + return false if !@number_of_steps.nil? && @number_of_steps < 1 + return false if !@current_step.nil? && @current_step < 1 + return false if !@percentage.nil? && @percentage > 100 + return false if !@percentage.nil? && @percentage < 0 return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["segmented_progress"]) + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"]) return false unless color_validator.valid?(@color) @@ -224,10 +249,28 @@ def current_step=(current_step) @current_step = current_step end + # Custom attribute writer method with validation + # @param [Object] percentage Value to be assigned + def percentage=(percentage) + if percentage.nil? + fail ArgumentError, 'percentage cannot be nil' + end + + if percentage > 100 + fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.' + end + + if percentage < 0 + fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.' + end + + @percentage = percentage + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["segmented_progress"]) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -263,6 +306,9 @@ def ==(o) subtitle == o.subtitle && number_of_steps == o.number_of_steps && current_step == o.current_step && + percentage == o.percentage && + value == o.value && + upper_limit == o.upper_limit && type == o.type && color == o.color && step_color == o.step_color @@ -277,7 +323,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, type, color, step_color].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, type, color, step_color].hash end # Builds the object from hash diff --git a/generated/activitysmith_openapi/models/content_state_update.rb b/generated/activitysmith_openapi/models/content_state_update.rb index 7850179..bcf3081 100644 --- a/generated/activitysmith_openapi/models/content_state_update.rb +++ b/generated/activitysmith_openapi/models/content_state_update.rb @@ -14,20 +14,34 @@ require 'time' module OpenapiClient - # Update payload. Required fields are title and current_step. number_of_steps is optional. + # Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. Type is optional when updating an existing activity. class ContentStateUpdate attr_accessor :title attr_accessor :subtitle + # Total number of steps. Use for type=segmented_progress. attr_accessor :number_of_steps + # Current step. Use for type=segmented_progress. attr_accessor :current_step + # Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided. + attr_accessor :percentage + + # Current progress value. Use with upper_limit for type=progress. + attr_accessor :value + + # Maximum progress value. Use with value for type=progress. + attr_accessor :upper_limit + + # Optional. When omitted, the API uses the existing Live Activity type. + attr_accessor :type + # Optional. Accent color for the Live Activity. Defaults to blue. attr_accessor :color - # Optional. Overrides color for the current step. + # Optional. Overrides color for the current step. Only applies to type=segmented_progress. attr_accessor :step_color class EnumAttributeValidator @@ -59,6 +73,10 @@ def self.attribute_map :'subtitle' => :'subtitle', :'number_of_steps' => :'number_of_steps', :'current_step' => :'current_step', + :'percentage' => :'percentage', + :'value' => :'value', + :'upper_limit' => :'upper_limit', + :'type' => :'type', :'color' => :'color', :'step_color' => :'step_color' } @@ -76,6 +94,10 @@ def self.openapi_types :'subtitle' => :'String', :'number_of_steps' => :'Integer', :'current_step' => :'Integer', + :'percentage' => :'Float', + :'value' => :'Float', + :'upper_limit' => :'Float', + :'type' => :'String', :'color' => :'String', :'step_color' => :'String' } @@ -118,8 +140,22 @@ def initialize(attributes = {}) if attributes.key?(:'current_step') self.current_step = attributes[:'current_step'] - else - self.current_step = nil + end + + if attributes.key?(:'percentage') + self.percentage = attributes[:'percentage'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'upper_limit') + self.upper_limit = attributes[:'upper_limit'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] end if attributes.key?(:'color') @@ -146,12 +182,16 @@ def list_invalid_properties invalid_properties.push('invalid value for "number_of_steps", must be greater than or equal to 1.') end - if @current_step.nil? - invalid_properties.push('invalid value for "current_step", current_step cannot be nil.') + if !@current_step.nil? && @current_step < 1 + invalid_properties.push('invalid value for "current_step", must be greater than or equal to 1.') end - if @current_step < 1 - invalid_properties.push('invalid value for "current_step", must be greater than or equal to 1.') + if !@percentage.nil? && @percentage > 100 + invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.') + end + + if !@percentage.nil? && @percentage < 0 + invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.') end invalid_properties @@ -163,8 +203,11 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @title.nil? return false if !@number_of_steps.nil? && @number_of_steps < 1 - return false if @current_step.nil? - return false if @current_step < 1 + return false if !@current_step.nil? && @current_step < 1 + return false if !@percentage.nil? && @percentage > 100 + return false if !@percentage.nil? && @percentage < 0 + type_validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress"]) + return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"]) return false unless color_validator.valid?(@color) step_color_validator = EnumAttributeValidator.new('String', ["lime", "green", "cyan", "blue", "purple", "magenta", "red", "orange", "yellow"]) @@ -200,6 +243,34 @@ def current_step=(current_step) @current_step = current_step end + # Custom attribute writer method with validation + # @param [Object] percentage Value to be assigned + def percentage=(percentage) + if percentage.nil? + fail ArgumentError, 'percentage cannot be nil' + end + + if percentage > 100 + fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.' + end + + if percentage < 0 + fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.' + end + + @percentage = percentage + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["segmented_progress", "progress"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] color Object to be assigned def color=(color) @@ -229,6 +300,10 @@ def ==(o) subtitle == o.subtitle && number_of_steps == o.number_of_steps && current_step == o.current_step && + percentage == o.percentage && + value == o.value && + upper_limit == o.upper_limit && + type == o.type && color == o.color && step_color == o.step_color end @@ -242,7 +317,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, subtitle, number_of_steps, current_step, color, step_color].hash + [title, subtitle, number_of_steps, current_step, percentage, value, upper_limit, type, color, step_color].hash end # Builds the object from hash