Class: Azure::ARM::Network::Models::RoutePropertiesFormat

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

Overview

Route resource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#address_prefixString

applies.

Returns:

  • (String)

    Gets or sets the destination CIDR to which the route



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

def address_prefix
  @address_prefix
end

#next_hop_ip_addressString

forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.

Returns:

  • (String)

    Gets or sets the IP address packets should be



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

def next_hop_ip_address
  @next_hop_ip_address
end

#next_hop_typeRouteNextHopType

packet should be sent to. Possible values include: ‘VirtualNetworkGateway’, ‘VnetLocal’, ‘Internet’, ‘VirtualAppliance’, ‘None’

Returns:



23
24
25
# File 'lib/azure_mgmt_network/models/route_properties_format.rb', line 23

def next_hop_type
  @next_hop_type
end

#provisioning_stateString

Updating/Deleting/Failed

Returns:

  • (String)

    Gets or sets Provisioning state of the resource



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

def provisioning_state
  @provisioning_state
end

Class Method Details

.deserialize_object(object) ⇒ RoutePropertiesFormat

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/azure_mgmt_network/models/route_properties_format.rb', line 70

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

  deserialized_property = object['nextHopType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = RouteNextHopType.constants.any? { |e| RouteNextHopType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum RouteNextHopType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.next_hop_type = deserialized_property

  deserialized_property = object['addressPrefix']
  output_object.address_prefix = deserialized_property

  deserialized_property = object['nextHopIpAddress']
  output_object.next_hop_ip_address = deserialized_property

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

  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
# File 'lib/azure_mgmt_network/models/route_properties_format.rb', line 46

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

  serialized_property = object.next_hop_type
  output_object['nextHopType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.address_prefix
  output_object['addressPrefix'] = serialized_property unless serialized_property.nil?

  serialized_property = object.next_hop_ip_address
  output_object['nextHopIpAddress'] = 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/route_properties_format.rb', line 37

def validate
  fail MsRest::ValidationError, 'property next_hop_type is nil' if @next_hop_type.nil?
end