ShapeParser
Auto-generated documentation for mypy_boto3_builder.parsers.shape_parser module.
Parser for botocore shape files.
- mypy-boto3-builder / Modules / Mypy Boto3 Builder / Parsers / ShapeParser
- ShapeParser
- ShapeParser().get_client_method_map
- ShapeParser().get_collection_batch_methods
- ShapeParser().get_collection_filter_method
- ShapeParser().get_paginate_method
- ShapeParser().get_paginator_names
- ShapeParser().get_resource_method_map
- ShapeParser().get_service_resource_method_map
- ShapeParser().get_wait_method
- ShapeParser().parse_shape
- ShapeParser().resource_name
- ShapeParserError
- ShapeParser
ShapeParser
class ShapeParser():
def __init__(session: Session, service_name: ServiceName):
Parser for botocore shape files.
Arguments
session
- Boto3 session.service_name
- ServiceName.
See also
ShapeParser().get_client_method_map
def get_client_method_map() -> dict[str, Method]:
Get client methods from shape.
Returns
A map of method name to Method.
See also
ShapeParser().get_collection_batch_methods
def get_collection_batch_methods(
name: str,
collection: Collection,
) -> list[Method]:
Get batch operations for Resource collection.
Arguments
name
- Collection record name.collection
- Boto3 Collection.class_type
- Collection self type annotation.
Returns
List of Method records.
See also
ShapeParser().get_collection_filter_method
def get_collection_filter_method(
name: str,
collection: Collection,
self_type: FakeAnnotation,
) -> Method:
Get filter
classmethod for Resource collection.
Arguments
name
- Collection record name.collection
- Boto3 Collection.class_type
- Collection class type annotation.
Returns
Filter Method record.
See also
ShapeParser().get_paginate_method
def get_paginate_method(paginator_name: str) -> Method:
Get Paginator paginate
method.
Arguments
paginator_name
- Paginator name.
Returns
Method.
See also
ShapeParser().get_paginator_names
def get_paginator_names() -> list[str]:
Get available paginator names.
Returns
A list of paginator names.
ShapeParser().get_resource_method_map
def get_resource_method_map(resource_name: str) -> dict[str, Method]:
Get methods for Resource.
Arguments
resource_name
- Resource name.
Returns
A map of method name to Method.
See also
ShapeParser().get_service_resource_method_map
def get_service_resource_method_map() -> dict[str, Method]:
Get methods for ServiceResource.
Returns
A map of method name to Method.
See also
ShapeParser().get_wait_method
def get_wait_method(waiter_name: str) -> Method:
Get Waiter wait
method.
Arguments
waiter_name
- Waiter name.
Returns
Method.
See also
ShapeParser().parse_shape
def parse_shape(
shape: Shape,
output: bool = False,
output_child: bool = False,
is_streaming: bool = False,
) -> FakeAnnotation:
Parse any botocore shape to TypeAnnotation.
Arguments
shape
- Botocore shape.output
- Whether shape should use strict output types.output_child
- Whether shape parent is marked as output.is_streaming
- Whether shape should be streaming.
Returns
TypeAnnotation or similar class.
See also
ShapeParser().resource_name
@property
def resource_name() -> str:
Parsed resource name.
ShapeParserError
class ShapeParserError(Exception):
Main error for ShapeParser.