lib/ionoscloud/models/server.rb in ionoscloud-5.1.1 vs lib/ionoscloud/models/server.rb in ionoscloud-5.1.2

- old
+ new

@@ -13,33 +13,45 @@ require 'date' require 'time' module Ionoscloud class Server + # 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 + attr_accessor :metadata + attr_accessor :properties + attr_accessor :entities # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'id' => :'id', + :'type' => :'type', + :'href' => :'href', + :'metadata' => :'metadata', + :'properties' => :'properties', + :'entities' => :'entities' } end # Returns all the JSON keys this model knows about @@ -48,22 +60,34 @@ end # Attribute type mapping. def self.openapi_types { + :'id' => :'String', + :'type' => :'Type', + :'href' => :'String', + :'metadata' => :'DatacenterElementMetadata', + :'properties' => :'ServerProperties', + :'entities' => :'ServerEntities' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + + + + + + ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -77,64 +101,88 @@ if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::Server`. 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?(:'id') self.id = attributes[:'id'] end + if attributes.key?(:'type') self.type = attributes[:'type'] 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?(:'entities') self.entities = attributes[:'entities'] 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 + + + + + + # 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 && - metadata == o.metadata && - properties == o.properties && - entities == o.entities + id == o.id && + type == o.type && + href == o.href && + metadata == o.metadata && + properties == o.properties && + entities == o.entities end # @see the `==` method # @param [Object] Object to be compared def eql?(o)