Examples#
Index > MarketplaceCatalog > Examples
Auto-generated documentation for MarketplaceCatalog type annotations stubs module mypy-boto3-marketplace-catalog.
Client#
Implicit type annotations#
Can be used with boto3-stubs[marketplace-catalog]
package installed.
Write your MarketplaceCatalog
code as usual,
type checking and code completion should work out of the box.
# MarketplaceCatalogClient usage example
from boto3.session import Session
session = Session()
client = session.client("marketplace-catalog") # (1)
result = client.batch_describe_entities() # (2)
- client: MarketplaceCatalogClient
- result: BatchDescribeEntitiesResponseTypeDef
# ListChangeSetsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("marketplace-catalog") # (1)
paginator = client.get_paginator("list_change_sets") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: MarketplaceCatalogClient
- paginator: ListChangeSetsPaginator
- item: ListChangeSetsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[marketplace-catalog]
or a standalone mypy_boto3_marketplace_catalog
package, you have to explicitly specify client: MarketplaceCatalogClient
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.
# MarketplaceCatalogClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_marketplace_catalog.client import MarketplaceCatalogClient
from mypy_boto3_marketplace_catalog.type_defs import BatchDescribeEntitiesResponseTypeDef
from mypy_boto3_marketplace_catalog.type_defs import BatchDescribeEntitiesRequestRequestTypeDef
session = Session()
client: MarketplaceCatalogClient = session.client("marketplace-catalog")
kwargs: BatchDescribeEntitiesRequestRequestTypeDef = {...}
result: BatchDescribeEntitiesResponseTypeDef = client.batch_describe_entities(**kwargs)
# ListChangeSetsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_marketplace_catalog.client import MarketplaceCatalogClient
from mypy_boto3_marketplace_catalog.paginator import ListChangeSetsPaginator
from mypy_boto3_marketplace_catalog.type_defs import ListChangeSetsResponseTypeDef
session = Session()
client: MarketplaceCatalogClient = session.client("marketplace-catalog")
paginator: ListChangeSetsPaginator = client.get_paginator("list_change_sets")
for item in paginator.paginate(...):
item: ListChangeSetsResponseTypeDef
print(item)