def domain_metadata(domain_name)
response = Excon::Response.new
if domain = self.data[:domains][domain_name]
response.status = 200
attribute_names = []
attribute_values = []
for item in domain.values
for key, values in item
attribute_names << key
for value in values
attribute_values << value
end
end
end
response.body = {
'AttributeNameCount' => attribute_names.length,
'AttributeNamesSizeBytes' => attribute_names.join('').length,
'AttributeValueCount' => attribute_values.length,
'AttributeValuesSizeBytes' => attribute_values.join('').length,
'BoxUsage' => Fog::AWS::Mock.box_usage,
'ItemCount' => domain.keys.length,
'ItemNamesSizeBytes' => domain.keys.join('').length,
'RequestId' => Fog::AWS::Mock.request_id,
'Timestamp' => Time.now
}
else
response.status = 400
raise(Excon::Errors.status_error({:expects => 200}, response))
end
response
end