lib/fog/azurerm/models/network/frontend_ip_configuration.rb in fog-azure-rm-0.0.4 vs lib/fog/azurerm/models/network/frontend_ip_configuration.rb in fog-azure-rm-0.0.5

- old
+ new

@@ -11,24 +11,14 @@ attribute :subnet_id attribute :public_ipaddress_id def self.parse(frontend_ip_configuration) hash = {} - hash['name'] = frontend_ip_configuration['name'] - subnet = frontend_ip_configuration['properties']['subnet'] - hash['subnet_id'] = subnet['id'] unless subnet.nil? - private_ip_address = frontend_ip_configuration['properties']['private_ipaddress'] - unless private_ip_address.nil? - hash['private_ipaddress'] = private_ip_address - end - private_ipallocation_method = frontend_ip_configuration['properties']['privateIPAllocationMethod'] - unless private_ipallocation_method.nil? - hash['private_ipallocation_method'] = private_ipallocation_method - end - public_ip_address = frontend_ip_configuration['properties']['publicIPAddress'] - unless public_ip_address.nil? - hash['public_ip_address_id'] = public_ip_address['id'] - end + hash['name'] = frontend_ip_configuration.name + hash['subnet_id'] = frontend_ip_configuration.subnet.id unless frontend_ip_configuration.subnet.nil? + hash['private_ipaddress'] = frontend_ip_configuration.private_ipaddress if frontend_ip_configuration.respond_to?(:private_ipaddress) + hash['private_ipallocation_method'] = frontend_ip_configuration.private_ipallocation_method unless frontend_ip_configuration.private_ipallocation_method.nil? + hash['public_ip_address_id'] = frontend_ip_configuration.public_ipaddress unless frontend_ip_configuration.public_ipaddress.nil? hash end end end end