Class: Azure::ARM::Network::Models::NetworkInterfacePropertiesFormat

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_network/Models/network_interface_properties_format.rb

Overview

NetworkInterface properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dns_settingsNetworkInterfaceDnsSettings

NetworkInterface

Returns:



28
29
30
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 28

def dns_settings
  @dns_settings
end

#ip_configurationsArray<NetworkInterfaceIpConfiguration>

IPConfigurations of the NetworkInterface

Returns:



24
25
26
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 24

def ip_configurations
  @ip_configurations
end

#mac_addressString

Returns Gets the MAC Address of the network interface.

Returns:

  • (String)

    Gets the MAC Address of the network interface



31
32
33
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 31

def mac_address
  @mac_address
end

#network_security_groupSubResource

NetworkSecurityGroup resource

Returns:

  • (SubResource)

    Gets or sets the reference of the



20
21
22
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 20

def network_security_group
  @network_security_group
end

#primaryBoolean

machine

Returns:

  • (Boolean)

    Gets whether this is a primary NIC on a virtual



35
36
37
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 35

def primary
  @primary
end

#provisioning_stateString

resource Updating/Deleting/Failed

Returns:

  • (String)

    Gets or sets Provisioning state of the PublicIP



39
40
41
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 39

def provisioning_state
  @provisioning_state
end

#virtual_machineSubResource

Returns Gets or sets the reference of a VirtualMachine.

Returns:

  • (SubResource)

    Gets or sets the reference of a VirtualMachine



16
17
18
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 16

def virtual_machine
  @virtual_machine
end

Class Method Details

.deserialize_object(object) ⇒ NetworkInterfacePropertiesFormat

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 108

def self.deserialize_object(object)
  return if object.nil?
  output_object = NetworkInterfacePropertiesFormat.new

  deserialized_property = object['virtualMachine']
  unless deserialized_property.nil?
    deserialized_property = SubResource.deserialize_object(deserialized_property)
  end
  output_object.virtual_machine = deserialized_property

  deserialized_property = object['networkSecurityGroup']
  unless deserialized_property.nil?
    deserialized_property = SubResource.deserialize_object(deserialized_property)
  end
  output_object.network_security_group = deserialized_property

  deserialized_property = object['ipConfigurations']
  unless deserialized_property.nil?
    deserializedArray = [];
    deserialized_property.each do |element1|
      unless element1.nil?
        element1 = NetworkInterfaceIpConfiguration.deserialize_object(element1)
      end
      deserializedArray.push(element1);
    end
    deserialized_property = deserializedArray;
  end
  output_object.ip_configurations = deserialized_property

  deserialized_property = object['dnsSettings']
  unless deserialized_property.nil?
    deserialized_property = NetworkInterfaceDnsSettings.deserialize_object(deserialized_property)
  end
  output_object.dns_settings = deserialized_property

  deserialized_property = object['macAddress']
  output_object.mac_address = deserialized_property

  deserialized_property = object['primary']
  output_object.primary = deserialized_property

  deserialized_property = object['provisioningState']
  output_object.provisioning_state = deserialized_property

  output_object.validate

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 56

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.virtual_machine
  unless serialized_property.nil?
    serialized_property = SubResource.serialize_object(serialized_property)
  end
  output_object['virtualMachine'] = serialized_property unless serialized_property.nil?

  serialized_property = object.network_security_group
  unless serialized_property.nil?
    serialized_property = SubResource.serialize_object(serialized_property)
  end
  output_object['networkSecurityGroup'] = serialized_property unless serialized_property.nil?

  serialized_property = object.ip_configurations
  unless serialized_property.nil?
    serializedArray = []
    serialized_property.each do |element|
      unless element.nil?
        element = NetworkInterfaceIpConfiguration.serialize_object(element)
      end
      serializedArray.push(element)
    end
    serialized_property = serializedArray
  end
  output_object['ipConfigurations'] = serialized_property unless serialized_property.nil?

  serialized_property = object.dns_settings
  unless serialized_property.nil?
    serialized_property = NetworkInterfaceDnsSettings.serialize_object(serialized_property)
  end
  output_object['dnsSettings'] = serialized_property unless serialized_property.nil?

  serialized_property = object.mac_address
  output_object['macAddress'] = serialized_property unless serialized_property.nil?

  serialized_property = object.primary
  output_object['primary'] = serialized_property unless serialized_property.nil?

  serialized_property = object.provisioning_state
  output_object['provisioningState'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



44
45
46
47
48
49
# File 'lib/azure_mgmt_network/Models/network_interface_properties_format.rb', line 44

def validate
  @virtual_machine.validate unless @virtual_machine.nil?
  @network_security_group.validate unless @network_security_group.nil?
  @ip_configurations.each{ |e| e.validate if e.respond_to?(:validate) } unless @ip_configurations.nil?
  @dns_settings.validate unless @dns_settings.nil?
end