Skip to content

Commit

Permalink
Wrap aioboto3 client methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Dec 5, 2024
1 parent ff90cfb commit 0346ac9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mypy_boto3_builder/parsers/parse_wrapper_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

from collections.abc import Iterable

from mypy_boto3_builder.import_helpers.import_string import ImportString
from mypy_boto3_builder.package_data import BasePackageData
from mypy_boto3_builder.parsers.wrapper_package_parser import WrapperPackageParser
from mypy_boto3_builder.service_name import ServiceName
from mypy_boto3_builder.structures.types_aioboto3_package import TypesAioBoto3Package
from mypy_boto3_builder.structures.types_aiobotocore_package import TypesAioBotocorePackage
from mypy_boto3_builder.structures.types_boto3_package import TypesBoto3Package
from mypy_boto3_builder.type_annotations.external_import import ExternalImport
from mypy_boto3_builder.type_annotations.internal_import import InternalImport
from mypy_boto3_builder.type_annotations.type_subscript import TypeSubscript

Expand Down Expand Up @@ -86,7 +88,12 @@ def parse_types_aioboto3_package(
"""
package = TypesAioBoto3Package(package_data, service_names, version)
parser = WrapperPackageParser(package)
package.session_class.methods.extend(parser.get_session_client_methods())
for method in parser.get_session_client_methods():
method.return_type = TypeSubscript(
ExternalImport(ImportString("botocore", "session"), "ClientCreatorContext"),
[method.return_type],
)
package.session_class.methods.append(method)
for method in parser.get_session_resource_methods():
method.return_type = TypeSubscript(
InternalImport("ResourceCreatorContext", stringify=False),
Expand Down

0 comments on commit 0346ac9

Please sign in to comment.