Class: Azure::ARM::Network::Models::VirtualNetworkGatewayPropertiesFormat

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb

Overview

VirtualNeworkGateay properties

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enable_bgpBoolean

Returns EnableBgp Flag.

Returns:

  • (Boolean)

    EnableBgp Flag



28
29
30
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 28

def enable_bgp
  @enable_bgp
end

#gateway_typeVirtualNetworkGatewayType

gateway. Possible values for this property include: ‘Vpn’.

Returns:



21
22
23
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 21

def gateway_type
  @gateway_type
end

#ip_configurationsArray<VirtualNetworkGatewayIpConfiguration>

for Virtual network gateway.

Returns:



17
18
19
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 17

def ip_configurations
  @ip_configurations
end

#provisioning_stateString

VirtualNetworkGateway resource Updating/Deleting/Failed

Returns:

  • (String)

    Gets or sets Provisioning state of the



32
33
34
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 32

def provisioning_state
  @provisioning_state
end

#vpn_typeVpnType

values for this property include: ‘PolicyBased’, ‘RouteBased’.

Returns:

  • (VpnType)

    The type of this virtual network gateway. Possible



25
26
27
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 25

def vpn_type
  @vpn_type
end

Class Method Details

.deserialize_object(object) ⇒ VirtualNetworkGatewayPropertiesFormat

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



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
115
116
117
118
119
120
121
122
123
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 83

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

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

  deserialized_property = object['gatewayType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = VirtualNetworkGatewayType.constants.any? { |e| VirtualNetworkGatewayType.const_get(e).to_s.downcase == deserialized_property.downcase }
    fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid
  end
  output_object.gateway_type = deserialized_property

  deserialized_property = object['vpnType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = VpnType.constants.any? { |e| VpnType.const_get(e).to_s.downcase == deserialized_property.downcase }
    fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid
  end
  output_object.vpn_type = deserialized_property

  deserialized_property = object['enableBgp']
  output_object.enable_bgp = 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.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 46

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

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

  serialized_property = object.gateway_type
  output_object['gatewayType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.vpn_type
  output_object['vpnType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.enable_bgp
  output_object['enableBgp'] = 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.



37
38
39
# File 'lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb', line 37

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