lib/VoucherifySdk/models/promotion_stack.rb in voucherify-5.0.0 vs lib/VoucherifySdk/models/promotion_stack.rb in voucherify-6.0.0

- old
+ new

@@ -21,20 +21,20 @@ attr_accessor :tiers # Unique promotion stack ID. attr_accessor :id - # Timestamp representing the date and time when the promotion stack was created in ISO 8601 format. + # Timestamp representing the date and time when the promotion stack was created. The value is shown in the ISO 8601 format. attr_accessor :created_at - # Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format. + # Timestamp representing the date and time when the promotion stack was updated. The value is shown in the ISO 8601 format. attr_accessor :updated_at # Promotion stack's parent campaign's unique ID. attr_accessor :campaign_id - # The type of object represented by JSON. + # The type of the object represented by JSON. attr_accessor :object # Promotion stack category ID. attr_accessor :category_id @@ -85,11 +85,11 @@ # Attribute type mapping. def self.openapi_types { :'name' => :'String', - :'tiers' => :'PromotionStackBaseTiers', + :'tiers' => :'PromotionStackTiers', :'id' => :'String', :'created_at' => :'Time', :'updated_at' => :'Time', :'campaign_id' => :'String', :'object' => :'String', @@ -99,150 +99,85 @@ end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'name', + :'tiers', + :'id', + :'created_at', + :'updated_at', + :'campaign_id', + :'object', :'category_id', + :'categories' ]) end - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PromotionStackBase' - ] - 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 `VoucherifySdk::PromotionStack` 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 `VoucherifySdk::PromotionStack`. 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?(:'name') self.name = attributes[:'name'] - else - self.name = nil end if attributes.key?(:'tiers') self.tiers = attributes[:'tiers'] - else - self.tiers = nil end if attributes.key?(:'id') self.id = attributes[:'id'] - else - self.id = 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'] end if attributes.key?(:'campaign_id') self.campaign_id = attributes[:'campaign_id'] - else - self.campaign_id = nil end if attributes.key?(:'object') self.object = attributes[:'object'] else self.object = 'promotion_stack' end if attributes.key?(:'category_id') self.category_id = attributes[:'category_id'] - else - self.category_id = nil end if attributes.key?(:'categories') if (value = attributes[:'categories']).is_a?(Array) self.categories = value end - else - self.categories = 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 @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @tiers.nil? - invalid_properties.push('invalid value for "tiers", tiers cannot be nil.') - end - - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @campaign_id.nil? - invalid_properties.push('invalid value for "campaign_id", campaign_id cannot be nil.') - end - - if @object.nil? - invalid_properties.push('invalid value for "object", object cannot be nil.') - end - - if @categories.nil? - invalid_properties.push('invalid value for "categories", categories 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 @name.nil? - return false if @tiers.nil? - return false if @id.nil? - return false if @created_at.nil? - return false if @campaign_id.nil? - return false if @object.nil? object_validator = EnumAttributeValidator.new('String', ["promotion_stack"]) return false unless object_validator.valid?(@object) - return false if @categories.nil? true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] object Object to be assigned - def object=(object) - validator = EnumAttributeValidator.new('String', ["promotion_stack"]) - unless validator.valid?(object) - fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}." - end - @object = object end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o)