lib/fog/azurerm/models/network/inbound_nat_rule.rb in fog-azure-rm-0.0.4 vs lib/fog/azurerm/models/network/inbound_nat_rule.rb in fog-azure-rm-0.0.5
- old
+ new
@@ -9,19 +9,16 @@
attribute :protocol
attribute :frontend_port
attribute :backend_port
def self.parse(inbound_nat_rule)
- inbound_nat_rule_prop = inbound_nat_rule['properties']
hash = {}
- hash['id'] = inbound_nat_rule['id']
- hash['name'] = inbound_nat_rule['name']
- unless inbound_nat_rule_prop['frontendIPConfiguration'].nil?
- hash['frontend_ip_configuration_id'] = inbound_nat_rule_prop['frontendIPConfiguration']['id']
- end
- hash['protocol'] = inbound_nat_rule_prop['protocol']
- hash['frontend_port'] = inbound_nat_rule_prop['frontendPort']
- hash['backend_port'] = inbound_nat_rule_prop['backendPort']
+ hash['id'] = inbound_nat_rule.id
+ hash['name'] = inbound_nat_rule.name
+ hash['frontend_ip_configuration_id'] = inbound_nat_rule.frontend_ipconfiguration.id unless inbound_nat_rule.frontend_ipconfiguration.nil?
+ hash['protocol'] = inbound_nat_rule.protocol
+ hash['frontend_port'] = inbound_nat_rule.frontend_port
+ hash['backend_port'] = inbound_nat_rule.backend_port
hash
end
end
end
end