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-aioboto3[servicecatalog] package installed.

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

# ServiceCatalogClient usage example

from aioboto3.session import Session


session = Session()

async with session.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 aioboto3.session import Session


session = Session()

async with session.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-aioboto3-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 aioboto3.session import 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 = Session()

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

from aioboto3.session import Session

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


session = Session()

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