Skip to content

Examples#

Index > SupplyChain > Examples

Auto-generated documentation for SupplyChain type annotations stubs module types-boto3-supplychain.

Client#

Implicit type annotations#

Can be used with types-boto3[supplychain] package installed.

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

Client method usage example#

# SupplyChainClient usage example

from boto3.session import Session


session = Session()

client = session.client("supplychain")  # (1)
result = client.create_bill_of_materials_import_job()  # (2)
  1. client: SupplyChainClient
  2. result: CreateBillOfMaterialsImportJobResponseTypeDef

Paginator usage example#

# 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)
  1. client: SupplyChainClient
  2. paginator: ListDataIntegrationFlowsPaginator
  3. item: ListDataIntegrationFlowsResponseTypeDef

Explicit type annotations#

With types-boto3-lite[supplychain] or a standalone types_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.

Client method usage example#

# SupplyChainClient usage example with type annotations

from boto3.session import Session

from types_boto3_supplychain.client import SupplyChainClient
from types_boto3_supplychain.type_defs import CreateBillOfMaterialsImportJobResponseTypeDef
from types_boto3_supplychain.type_defs import CreateBillOfMaterialsImportJobRequestTypeDef


session = Session()

client: SupplyChainClient = session.client("supplychain")

kwargs: CreateBillOfMaterialsImportJobRequestTypeDef = {...}
result: CreateBillOfMaterialsImportJobResponseTypeDef = client.create_bill_of_materials_import_job(**kwargs)

Paginator usage example#

# ListDataIntegrationFlowsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_supplychain.client import SupplyChainClient
from types_boto3_supplychain.paginator import ListDataIntegrationFlowsPaginator
from types_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)