37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/fog/azurerm/models/storage/container.rb', line 37
def self.parse(container)
hash = {}
if container.is_a? Hash
hash['name'] = container['name']
hash['metadata'] = container['metadata']
return hash unless container.key?('properties')
hash['last_modified'] = container['properties']['last_modified']
hash['etag'] = container['properties']['etag']
hash['lease_duration'] = container['properties']['lease_duration']
hash['lease_status'] = container['properties']['lease_status']
hash['lease_state'] = container['properties']['lease_state']
else
hash['name'] = container.name
hash['metadata'] = container.metadata
return hash unless container.respond_to?('properties')
hash['last_modified'] = container.properties[:last_modified]
hash['etag'] = container.properties[:etag]
hash['lease_duration'] = container.properties[:lease_duration]
hash['lease_status'] = container.properties[:lease_status]
hash['lease_state'] = container.properties[:lease_state]
end
hash
end
|