lib/ionoscloud/models/ip_block.rb in ionoscloud-6.1.1 vs lib/ionoscloud/models/ip_block.rb in ionoscloud-6.1.2

- old
+ new

@@ -14,40 +14,40 @@ require 'time' module Ionoscloud class IpBlock - # The resource's unique identifier. - attr_accessor :id - - - # The type of object that has been created. - attr_accessor :type - - # URL to the object representation (absolute path). attr_accessor :href + # The resource's unique identifier. + attr_accessor :id + + attr_accessor :metadata attr_accessor :properties + + # The type of object that has been created. + attr_accessor :type + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', - - :'type' => :'type', - :'href' => :'href', + :'id' => :'id', + :'metadata' => :'metadata', - :'properties' => :'properties' + :'properties' => :'properties', + + :'type' => :'type' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes @@ -56,19 +56,19 @@ # Attribute type mapping. def self.openapi_types { - :'id' => :'String', - - :'type' => :'Type', - :'href' => :'String', + :'id' => :'String', + :'metadata' => :'DatacenterElementMetadata', - :'properties' => :'IpBlockProperties' + :'properties' => :'IpBlockProperties', + + :'type' => :'Type' } end # List of attributes with nullable: true def self.openapi_nullable @@ -95,60 +95,60 @@ end h[k.to_sym] = v } - if attributes.key?(:'id') - self.id = attributes[:'id'] + if attributes.key?(:'href') + self.href = attributes[:'href'] end - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'id') + self.id = attributes[:'id'] end - if attributes.key?(:'href') - self.href = attributes[:'href'] - end - - if attributes.key?(:'metadata') self.metadata = attributes[:'metadata'] end if attributes.key?(:'properties') self.properties = attributes[:'properties'] end + + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 invalid_properties = Array.new - if @properties.nil? invalid_properties.push('invalid value for "properties", properties 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? - return false if @properties.nil? + true end @@ -158,15 +158,15 @@ # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - id == o.id && - type == o.type && href == o.href && + id == o.id && metadata == o.metadata && - properties == o.properties + properties == o.properties && + type == o.type end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -174,10 +174,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, href, metadata, properties].hash + [href, id, metadata, properties, type].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself