ShapeParser

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

Parser for botocore shape files.

ShapeParser

[find in source code]

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

[find in source code]

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

[find in source code]

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

[find in source code]

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

[find in source code]

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

[find in source code]

def get_paginator_names() -> list[str]:

Get available paginator names.

Returns

A list of paginator names.

ShapeParser().get_resource_method_map

[find in source code]

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

[find in source code]

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

[find in source code]

def get_wait_method(waiter_name: str) -> Method:

Get Waiter wait method.

Arguments

  • waiter_name - Waiter name.

Returns

Method.

See also

ShapeParser().parse_shape

[find in source code]

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

[find in source code]

@property
def resource_name() -> str:

Parsed resource name.

ShapeParserError

[find in source code]

class ShapeParserError(Exception):

Main error for ShapeParser.