Skip to content

Examples#

Index > ServiceCatalog > Examples

Auto-generated documentation for ServiceCatalog type annotations stubs module types-aiobotocore-servicecatalog.

Client#

Implicit type annotations#

Can be used with types-aiobotocore[servicecatalog] package installed.

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

# ServiceCatalogClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("servicecatalog") as client:  # (1)
    result = await client.batch_associate_service_action_with_provisioning_artifact()  # (2)
  1. client: ServiceCatalogClient
  2. result: BatchAssociateServiceActionWithProvisioningArtifactOutputTypeDef
# ListAcceptedPortfolioSharesPaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("servicecatalog") as client:  # (1)
    paginator = client.get_paginator("list_accepted_portfolio_shares")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: ServiceCatalogClient
  2. paginator: ListAcceptedPortfolioSharesPaginator
  3. item: ListAcceptedPortfolioSharesOutputTypeDef

Explicit type annotations#

With types-aiobotocore-lite[servicecatalog] or a standalone types_aiobotocore_servicecatalog package, you have to explicitly specify client: ServiceCatalogClient 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.

# ServiceCatalogClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_servicecatalog.client import ServiceCatalogClient
from types_aiobotocore_servicecatalog.type_defs import BatchAssociateServiceActionWithProvisioningArtifactOutputTypeDef
from types_aiobotocore_servicecatalog.type_defs import BatchAssociateServiceActionWithProvisioningArtifactInputRequestTypeDef


session = get_session()

async with session.create_client("servicecatalog") as client:
    client: ServiceCatalogClient
    kwargs: BatchAssociateServiceActionWithProvisioningArtifactInputRequestTypeDef = {...}
    result: BatchAssociateServiceActionWithProvisioningArtifactOutputTypeDef = await client.batch_associate_service_action_with_provisioning_artifact(**kwargs)
# ListAcceptedPortfolioSharesPaginator usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_servicecatalog.client import ServiceCatalogClient
from types_aiobotocore_servicecatalog.paginator import ListAcceptedPortfolioSharesPaginator
from types_aiobotocore_servicecatalog.type_defs import ListAcceptedPortfolioSharesOutputTypeDef


session = get_session()

async with session.create_client("servicecatalog") as client:
    client: ServiceCatalogClient
    paginator: ListAcceptedPortfolioSharesPaginator = client.get_paginator("list_accepted_portfolio_shares")
    async for item in paginator.paginate(...):
        item: ListAcceptedPortfolioSharesOutputTypeDef
        print(item)