Class: OCI::CloudBridge::Models::InstanceNetworkInterfaceAttachment
- Inherits:
-
Object
- Object
- OCI::CloudBridge::Models::InstanceNetworkInterfaceAttachment
- Defined in:
- lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb
Overview
Describes a network interface attachment.
Instance Attribute Summary collapse
-
#attachment_key ⇒ String
The ID of the network interface attachment.
-
#device_index ⇒ Integer
The index of the device on the instance for the network interface attachment.
-
#is_delete_on_termination ⇒ BOOLEAN
Indicates whether the network interface is deleted when the instance is terminated.
-
#network_card_index ⇒ Integer
The index of the network card.
-
#status ⇒ String
The attachment state.
-
#time_attach ⇒ DateTime
The timestamp when the attachment initiated.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ InstanceNetworkInterfaceAttachment
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ InstanceNetworkInterfaceAttachment
Initializes the object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 75 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self. = attributes[:'attachmentKey'] if attributes[:'attachmentKey'] raise 'You cannot provide both :attachmentKey and :attachment_key' if attributes.key?(:'attachmentKey') && attributes.key?(:'attachment_key') self. = attributes[:'attachment_key'] if attributes[:'attachment_key'] self.time_attach = attributes[:'timeAttach'] if attributes[:'timeAttach'] raise 'You cannot provide both :timeAttach and :time_attach' if attributes.key?(:'timeAttach') && attributes.key?(:'time_attach') self.time_attach = attributes[:'time_attach'] if attributes[:'time_attach'] self.is_delete_on_termination = attributes[:'isDeleteOnTermination'] unless attributes[:'isDeleteOnTermination'].nil? self.is_delete_on_termination = false if is_delete_on_termination.nil? && !attributes.key?(:'isDeleteOnTermination') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isDeleteOnTermination and :is_delete_on_termination' if attributes.key?(:'isDeleteOnTermination') && attributes.key?(:'is_delete_on_termination') self.is_delete_on_termination = attributes[:'is_delete_on_termination'] unless attributes[:'is_delete_on_termination'].nil? self.is_delete_on_termination = false if is_delete_on_termination.nil? && !attributes.key?(:'isDeleteOnTermination') && !attributes.key?(:'is_delete_on_termination') # rubocop:disable Style/StringLiterals self.device_index = attributes[:'deviceIndex'] if attributes[:'deviceIndex'] raise 'You cannot provide both :deviceIndex and :device_index' if attributes.key?(:'deviceIndex') && attributes.key?(:'device_index') self.device_index = attributes[:'device_index'] if attributes[:'device_index'] self.network_card_index = attributes[:'networkCardIndex'] if attributes[:'networkCardIndex'] raise 'You cannot provide both :networkCardIndex and :network_card_index' if attributes.key?(:'networkCardIndex') && attributes.key?(:'network_card_index') self.network_card_index = attributes[:'network_card_index'] if attributes[:'network_card_index'] self.status = attributes[:'status'] if attributes[:'status'] end |
Instance Attribute Details
#attachment_key ⇒ String
The ID of the network interface attachment.
13 14 15 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 13 def @attachment_key end |
#device_index ⇒ Integer
The index of the device on the instance for the network interface attachment.
25 26 27 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 25 def device_index @device_index end |
#is_delete_on_termination ⇒ BOOLEAN
Indicates whether the network interface is deleted when the instance is terminated.
21 22 23 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 21 def is_delete_on_termination @is_delete_on_termination end |
#network_card_index ⇒ Integer
The index of the network card.
29 30 31 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 29 def network_card_index @network_card_index end |
#status ⇒ String
The attachment state.
33 34 35 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 33 def status @status end |
#time_attach ⇒ DateTime
The timestamp when the attachment initiated.
17 18 19 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 17 def time_attach @time_attach end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 36 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'attachment_key': :'attachmentKey', 'time_attach': :'timeAttach', 'is_delete_on_termination': :'isDeleteOnTermination', 'device_index': :'deviceIndex', 'network_card_index': :'networkCardIndex', 'status': :'status' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 50 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'attachment_key': :'String', 'time_attach': :'DateTime', 'is_delete_on_termination': :'BOOLEAN', 'device_index': :'Integer', 'network_card_index': :'Integer', 'status': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 123 def ==(other) return true if equal?(other) self.class == other.class && == other. && time_attach == other.time_attach && is_delete_on_termination == other.is_delete_on_termination && device_index == other.device_index && network_card_index == other.network_card_index && status == other.status end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 158 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
138 139 140 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 138 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
147 148 149 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 147 def hash [, time_attach, is_delete_on_termination, device_index, network_card_index, status].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 191 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
185 186 187 |
# File 'lib/oci/cloud_bridge/models/instance_network_interface_attachment.rb', line 185 def to_s to_hash.to_s end |