Skip to content

Examples#

Index > PcaConnectorAd > Examples

Auto-generated documentation for PcaConnectorAd type annotations stubs module mypy-boto3-pca-connector-ad.

Client#

Implicit type annotations#

Can be used with boto3-stubs[pca-connector-ad] package installed.

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

# PcaConnectorAdClient usage example

from boto3.session import Session


session = Session()

client = session.client("pca-connector-ad")  # (1)
result = client.create_connector()  # (2)
  1. client: PcaConnectorAdClient
  2. result: CreateConnectorResponseTypeDef
# ListConnectorsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("pca-connector-ad")  # (1)

paginator = client.get_paginator("list_connectors")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: PcaConnectorAdClient
  2. paginator: ListConnectorsPaginator
  3. item: ListConnectorsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[pca-connector-ad] or a standalone mypy_boto3_pca_connector_ad package, you have to explicitly specify client: PcaConnectorAdClient 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.

# PcaConnectorAdClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_pca_connector_ad.client import PcaConnectorAdClient
from mypy_boto3_pca_connector_ad.type_defs import CreateConnectorResponseTypeDef
from mypy_boto3_pca_connector_ad.type_defs import CreateConnectorRequestRequestTypeDef


session = Session()

client: PcaConnectorAdClient = session.client("pca-connector-ad")

kwargs: CreateConnectorRequestRequestTypeDef = {...}
result: CreateConnectorResponseTypeDef = client.create_connector(**kwargs)
# ListConnectorsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_pca_connector_ad.client import PcaConnectorAdClient
from mypy_boto3_pca_connector_ad.paginator import ListConnectorsPaginator
from mypy_boto3_pca_connector_ad.type_defs import ListConnectorsResponseTypeDef


session = Session()
client: PcaConnectorAdClient = session.client("pca-connector-ad")

paginator: ListConnectorsPaginator = client.get_paginator("list_connectors")
for item in paginator.paginate(...):
    item: ListConnectorsResponseTypeDef
    print(item)