module Aws::Structure

def to_h(obj = self, options = {})

Returns:
  • (Hash) -
def to_h(obj = self, options = {})
  case obj
  when Struct
    obj.each_pair.with_object({}) do |(member, value), hash|
      member = member.to_s if options[:as_json]
      hash[member] = to_hash(value, options) unless value.nil?
    end
  when Hash
    obj.each.with_object({}) do |(key, value), hash|
      key = key.to_s if options[:as_json]
      hash[key] = to_hash(value, options)
    end
  when Array
    obj.collect { |value| to_hash(value, options) }
  else
    obj
  end
end