Skip to content

ShapeParser#

Mypy_boto3_builder Index / Mypy Boto3 Builder / Parsers / ShapeParser

Auto-generated documentation for mypy_boto3_builder.parsers.shape_parser module.

ShapeParser#

Show source in shape_parser.py:74

Parser for botocore shape files.

Arguments#

  • session - Boto3 session.
  • service_name - ServiceName.

Signature#

class ShapeParser:
    def __init__(self, session: Session, service_name: ServiceName): ...

See also#

ShapeParser._get_streaming_body#

Show source in shape_parser.py:449

Get the streaming member's shape if any; or None otherwise.

Signature#

@staticmethod
def _get_streaming_body(shape: Shape) -> Shape | None: ...

ShapeParser().fix_method_arguments_for_mypy#

Show source in shape_parser.py:984

Accept both input and output shapes in method arguments.

mypy does not compare TypedDicts, so we need to accept both input and output shapes. https://github.com/youtype/mypy_boto3_builder/issues/209

Signature#

def fix_method_arguments_for_mypy(self, methods: Sequence[Method]) -> None: ...

See also#

ShapeParser().fix_typed_dict_names#

Show source in shape_parser.py:923

Fix typed dict names to avoid duplicates.

Signature#

def fix_typed_dict_names(self) -> None: ...

ShapeParser().get_client_method_map#

Show source in shape_parser.py:235

Get client methods from shape.

Returns#

A map of method name to Method.

Signature#

def get_client_method_map(self) -> dict[str, Method]: ...

See also#

ShapeParser().get_collection_batch_methods#

Show source in shape_parser.py:843

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.

Signature#

def get_collection_batch_methods(
    self, name: str, collection: Collection
) -> list[Method]: ...

See also#

ShapeParser().get_collection_filter_method#

Show source in shape_parser.py:805

Get filter classmethod for Resource collection.

Arguments#

  • name - Collection record name.
  • collection - Boto3 Collection.
  • class_type - Collection class type annotation.

Returns#

Filter Method record.

Signature#

def get_collection_filter_method(
    self, name: str, collection: Collection, self_type: FakeAnnotation
) -> Method: ...

See also#

ShapeParser().get_paginate_method#

Show source in shape_parser.py:545

Get Paginator paginate method.

Arguments#

  • paginator_name - Paginator name.

Returns#

Method.

Signature#

def get_paginate_method(self, paginator_name: str) -> Method: ...

See also#

ShapeParser().get_paginator_names#

Show source in shape_parser.py:153

Get available paginator names.

Returns#

A list of paginator names.

Signature#

def get_paginator_names(self) -> list[str]: ...

ShapeParser().get_resource_method_map#

Show source in shape_parser.py:669

Get methods for Resource.

Arguments#

Returns#

A map of method name to Method.

Signature#

def get_resource_method_map(self, resource_name: str) -> dict[str, Method]: ...

See also#

ShapeParser().get_service_resource_method_map#

Show source in shape_parser.py:634

Get methods for ServiceResource.

Returns#

A map of method name to Method.

Signature#

def get_service_resource_method_map(self) -> dict[str, Method]: ...

See also#

ShapeParser().get_wait_method#

Show source in shape_parser.py:601

Get Waiter wait method.

Arguments#

  • waiter_name - Waiter name.

Returns#

Method.

Signature#

def get_wait_method(self, waiter_name: str) -> Method: ...

See also#

ShapeParser().parse_shape#

Show source in shape_parser.py:463

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.

Signature#

def parse_shape(
    self,
    shape: Shape,
    output: bool = False,
    output_child: bool = False,
    is_streaming: bool = False,
) -> FakeAnnotation: ...

See also#

ShapeParser().resource_name#

Show source in shape_parser.py:114

Parsed resource name.

Signature#

@property
def resource_name(self) -> str: ...

ShapeParserError#

Show source in shape_parser.py:68

Main error for ShapeParser.

Signature#

class ShapeParserError(Exception): ...