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

- old
+ new

@@ -14,42 +14,42 @@ require 'time' module Ionoscloud class NicProperties - # The name of the resource. - attr_accessor :name + # The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created using Cloud API and no DCD changes were performed on the Datacenter. + attr_accessor :device_number - # The MAC address of the NIC. - attr_accessor :mac - - - # Collection of IP addresses, assigned to the NIC. Explicitly assigned public IPs need to come from reserved IP blocks. Passing value null or empty array will assign an IP address automatically. - attr_accessor :ips - - # Indicates if the NIC will reserve an IP using DHCP. attr_accessor :dhcp - # The LAN ID the NIC will be on. If the LAN ID does not exist, it will be implicitly created. - attr_accessor :lan - - # Activate or deactivate the firewall. By default, an active firewall without any defined rules will block all incoming network traffic except for the firewall rules that explicitly allows certain protocols, IP addresses and ports. attr_accessor :firewall_active # The type of firewall rules that will be allowed on the NIC. If not specified, the default INGRESS value is used. attr_accessor :firewall_type - # The Logical Unit Number (LUN) of the storage volume. Null if this NIC was created using Cloud API and no DCD changes were performed on the Datacenter. - attr_accessor :device_number + # Collection of IP addresses, assigned to the NIC. Explicitly assigned public IPs need to come from reserved IP blocks. Passing value null or empty array will assign an IP address automatically. + attr_accessor :ips + # The LAN ID the NIC will be on. If the LAN ID does not exist, it will be implicitly created. + attr_accessor :lan + + + # The MAC address of the NIC. + attr_accessor :mac + + + # The name of the resource. + attr_accessor :name + + # The PCI slot number for the NIC. attr_accessor :pci_slot class EnumAttributeValidator attr_reader :datatype @@ -75,27 +75,27 @@ # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'name' => :'name', + :'device_number' => :'deviceNumber', - :'mac' => :'mac', - - :'ips' => :'ips', - :'dhcp' => :'dhcp', - :'lan' => :'lan', - :'firewall_active' => :'firewallActive', :'firewall_type' => :'firewallType', - :'device_number' => :'deviceNumber', + :'ips' => :'ips', - :'pci_slot' => :'pciSlot' + :'lan' => :'lan', + + :'mac' => :'mac', + + :'name' => :'name', + + :'pci_slot' => :'pciSlot', } end # Returns all the JSON keys this model knows about def self.acceptable_attributes @@ -104,39 +104,39 @@ # Attribute type mapping. def self.openapi_types { - :'name' => :'String', + :'device_number' => :'Integer', - :'mac' => :'String', - - :'ips' => :'Array<String>', - :'dhcp' => :'Boolean', - :'lan' => :'Integer', - :'firewall_active' => :'Boolean', :'firewall_type' => :'String', - :'device_number' => :'Integer', + :'ips' => :'Array<String>', - :'pci_slot' => :'Integer' + :'lan' => :'Integer', + + :'mac' => :'String', + + :'name' => :'String', + + :'pci_slot' => :'Integer', } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'ips', + :'ips', ]) @@ -156,47 +156,49 @@ end h[k.to_sym] = v } - if attributes.key?(:'name') - self.name = attributes[:'name'] + if attributes.key?(:'device_number') + self.device_number = attributes[:'device_number'] end - if attributes.key?(:'mac') - self.mac = attributes[:'mac'] + if attributes.key?(:'dhcp') + self.dhcp = attributes[:'dhcp'] + else + self.dhcp = true end - if attributes.key?(:'ips') && (value = attributes[:'ips']).is_a?(Array) - self.ips = value + if attributes.key?(:'firewall_active') + self.firewall_active = attributes[:'firewall_active'] end - if attributes.key?(:'dhcp') - self.dhcp = attributes[:'dhcp'] + if attributes.key?(:'firewall_type') + self.firewall_type = attributes[:'firewall_type'] end - if attributes.key?(:'lan') - self.lan = attributes[:'lan'] + if attributes.key?(:'ips') && (value = attributes[:'ips']).is_a?(Array) + self.ips = value end - if attributes.key?(:'firewall_active') - self.firewall_active = attributes[:'firewall_active'] + if attributes.key?(:'lan') + self.lan = attributes[:'lan'] end - if attributes.key?(:'firewall_type') - self.firewall_type = attributes[:'firewall_type'] + if attributes.key?(:'mac') + self.mac = attributes[:'mac'] end - if attributes.key?(:'device_number') - self.device_number = attributes[:'device_number'] + if attributes.key?(:'name') + self.name = attributes[:'name'] end if attributes.key?(:'pci_slot') self.pci_slot = attributes[:'pci_slot'] @@ -210,46 +212,43 @@ + if @lan.nil? invalid_properties.push('invalid value for "lan", lan 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? + firewall_type_validator = EnumAttributeValidator.new('String', ["INGRESS", "EGRESS", "BIDIRECTIONAL"]) + return false unless firewall_type_validator.valid?(@firewall_type) + return false if @lan.nil? - firewall_type_validator = EnumAttributeValidator.new('String', ["INGRESS", "EGRESS", "BIDIRECTIONAL"]) - return false unless firewall_type_validator.valid?(@firewall_type) - true end - - - # Custom attribute writer method checking allowed values (enum). # @param [Object] firewall_type Object to be assigned def firewall_type=(firewall_type) validator = EnumAttributeValidator.new('String', ["INGRESS", "EGRESS", "BIDIRECTIONAL"]) unless validator.valid?(firewall_type) @@ -258,23 +257,26 @@ @firewall_type = firewall_type 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 && - name == o.name && - mac == o.mac && - ips == o.ips && + device_number == o.device_number && dhcp == o.dhcp && - lan == o.lan && firewall_active == o.firewall_active && firewall_type == o.firewall_type && - device_number == o.device_number && + ips == o.ips && + lan == o.lan && + mac == o.mac && + name == o.name && pci_slot == o.pci_slot end # @see the `==` method # @param [Object] Object to be compared @@ -283,10 +285,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, mac, ips, dhcp, lan, firewall_active, firewall_type, device_number, pci_slot].hash + [device_number, dhcp, firewall_active, firewall_type, ips, lan, mac, name, pci_slot, ].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself