Class: Aws::Api::ShapeMap Private
- Inherits:
-
Object
- Object
- Aws::Api::ShapeMap
- Includes:
- Seahorse::Model::Shapes
- Defined in:
- lib/aws-sdk-core/api/shape_map.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- EMPTY_REF =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
begin shape = StructureShape.new shape[:struct_class] = Aws::EmptyStructure ShapeRef.new(shape: shape) end
- SHAPE_CLASSES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ 'blob' => BlobShape, 'byte' => StringShape, 'boolean' => BooleanShape, 'character' => StringShape, 'double' => FloatShape, 'float' => FloatShape, 'integer' => IntegerShape, 'list' => ListShape, 'long' => IntegerShape, 'map' => MapShape, 'string' => StringShape, 'structure' => StructureShape, 'timestamp' => TimestampShape, }
Instance Method Summary collapse
- #[](shape_name) ⇒ Object private
- #each_structure ⇒ Object private
-
#initialize(shape_definitions, options = {}) ⇒ ShapeMap
constructor
private
A new instance of ShapeMap.
- #shape_ref(definition, options = {}) ⇒ Object private
Constructor Details
#initialize(shape_definitions, options = {}) ⇒ ShapeMap
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ShapeMap.
31 32 33 34 35 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 31 def initialize(shape_definitions, = {}) @shapes = {} @docs = [:docs] || Docs::NullDocstringProvider.new build_shapes(shape_definitions) end |
Instance Method Details
#[](shape_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 40 41 42 43 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 37 def [](shape_name) if shape = @shapes[shape_name] shape else raise ArgumentError, "unknown shape #{shape_name.inspect}" end end |
#each_structure ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 48 49 50 51 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 45 def each_structure @shapes.each do |_, shape| if StructureShape === shape && !shape[:error] && !shape[:exception] yield(shape) end end end |
#shape_ref(definition, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 53 def shape_ref(definition, = {}) if definition = definition.dup shape = self[.delete('shape')] location = .delete('location') location_name = .delete('locationName') location_name ||= [:member_name] unless location == 'headers' documentation = @docs.shape_ref_docs(shape.name, [:target]) ShapeRef.new( shape: shape, location: location, location_name: location_name, required: !![:required], deprecated: !!(.delete('deprecated') || shape[:deprecated]), documentation: documentation, metadata: ) else EMPTY_REF end end |