Skip to content


Index > MarketplaceMetering > Examples

Auto-generated documentation for MarketplaceMetering type annotations stubs module mypy-boto3-meteringmarketplace.


Implicit type annotations#

Can be used with boto3-stubs[meteringmarketplace] package installed.

Write your MarketplaceMetering code as usual, type checking and code completion should work out of the box.

# MarketplaceMeteringClient usage example

from boto3.session import Session

session = Session()

client = session.client("meteringmarketplace")  # (1)
result = client.batch_meter_usage()  # (2)
  1. client: MarketplaceMeteringClient
  2. result: BatchMeterUsageResultTypeDef

Explicit type annotations#

With boto3-stubs-lite[meteringmarketplace] or a standalone mypy_boto3_meteringmarketplace package, you have to explicitly specify client: MarketplaceMeteringClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

# MarketplaceMeteringClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_meteringmarketplace.client import MarketplaceMeteringClient
from mypy_boto3_meteringmarketplace.type_defs import BatchMeterUsageResultTypeDef
from mypy_boto3_meteringmarketplace.type_defs import BatchMeterUsageRequestRequestTypeDef

session = Session()

client: MarketplaceMeteringClient = session.client("meteringmarketplace")

kwargs: BatchMeterUsageRequestRequestTypeDef = {...}
result: BatchMeterUsageResultTypeDef = client.batch_meter_usage(**kwargs)