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

- old
+ new

@@ -14,42 +14,42 @@ require 'time' module Ionoscloud class IpBlockProperties + # Read-Only attribute. Lists consumption detail for an individual IP + attr_accessor :ip_consumers + + # Collection of IPs, associated with the IP Block. attr_accessor :ips # Location of that IP block. Property cannot be modified after it is created (disallowed in update requests). attr_accessor :location - # The size of the IP block. - attr_accessor :size - - # The name of the resource. attr_accessor :name - # Read-Only attribute. Lists consumption detail for an individual IP - attr_accessor :ip_consumers + # The size of the IP block. + attr_accessor :size # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'ip_consumers' => :'ipConsumers', + :'ips' => :'ips', :'location' => :'location', - :'size' => :'size', - :'name' => :'name', - :'ip_consumers' => :'ipConsumers' + :'size' => :'size' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes @@ -58,19 +58,19 @@ # Attribute type mapping. def self.openapi_types { + :'ip_consumers' => :'Array<IpConsumer>', + :'ips' => :'Array<String>', :'location' => :'String', - :'size' => :'Integer', - :'name' => :'String', - :'ip_consumers' => :'Array<IpConsumer>' + :'size' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable @@ -97,65 +97,65 @@ end h[k.to_sym] = v } + if attributes.key?(:'ip_consumers') && (value = attributes[:'ip_consumers']).is_a?(Array) + self.ip_consumers = value + end + + if attributes.key?(:'ips') && (value = attributes[:'ips']).is_a?(Array) self.ips = value end if attributes.key?(:'location') self.location = attributes[:'location'] end - if attributes.key?(:'size') - self.size = attributes[:'size'] - end - - if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'ip_consumers') && (value = attributes[:'ip_consumers']).is_a?(Array) - self.ip_consumers = value + if attributes.key?(:'size') + self.size = attributes[:'size'] 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 @location.nil? invalid_properties.push('invalid value for "location", location cannot be nil.') end + if @size.nil? invalid_properties.push('invalid value for "size", size 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 @location.nil? - return false if @size.nil? - + return false if @size.nil? true end @@ -165,15 +165,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 && + ip_consumers == o.ip_consumers && ips == o.ips && location == o.location && - size == o.size && name == o.name && - ip_consumers == o.ip_consumers + size == o.size end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -181,10 +181,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [ips, location, size, name, ip_consumers].hash + [ip_consumers, ips, location, name, size].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself