class Aws::Xml::Parser

def parse_shape(shape, value)

Returns:
  • (Object) -

Parameters:
  • value (Object) --
  • shape (Seahorse::Model::Shapes::Shape) --
def parse_shape(shape, value)
  if value.nil?
    case shape
    when Seahorse::Model::Shapes::Structure then structure(shape, {})
    when Seahorse::Model::Shapes::Map then {}
    when Seahorse::Model::Shapes::List then []
    when Seahorse::Model::Shapes::String then ''
    else nil
    end
  else
    case shape
    when Seahorse::Model::Shapes::String then string(shape, value)
    when Seahorse::Model::Shapes::Structure then structure(shape, value)
    when Seahorse::Model::Shapes::List then list(shape, value)
    when Seahorse::Model::Shapes::Map then map(shape, value)
    when Seahorse::Model::Shapes::Boolean then value == 'true'
    when Seahorse::Model::Shapes::Integer then value.to_i
    when Seahorse::Model::Shapes::Float then value.to_f
    when Seahorse::Model::Shapes::Timestamp then timestamp(value)
    when Seahorse::Model::Shapes::Blob then Base64.decode64(value)
    else
      raise "unhandled shape type: `#{shape.type}'"
    end
  end
end