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