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
- 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.
25 26 27 28 29 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 25 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.
31 32 33 34 35 36 37 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 31 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.
39 40 41 42 43 44 45 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 39 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.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/aws-sdk-core/api/shape_map.rb', line 47 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 |