Skip to content

Examples#

Index > CodeCatalyst > Examples

Auto-generated documentation for CodeCatalyst type annotations stubs module types-aiobotocore-codecatalyst.

Client#

Implicit type annotations#

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

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

# CodeCatalystClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("codecatalyst") as client:  # (1)
    result = await client.create_access_token()  # (2)
  1. client: CodeCatalystClient
  2. result: CreateAccessTokenResponseTypeDef
# ListAccessTokensPaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("codecatalyst") as client:  # (1)
    paginator = client.get_paginator("list_access_tokens")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: CodeCatalystClient
  2. paginator: ListAccessTokensPaginator
  3. item: ListAccessTokensResponseTypeDef

Explicit type annotations#

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

# CodeCatalystClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_codecatalyst.client import CodeCatalystClient
from types_aiobotocore_codecatalyst.type_defs import CreateAccessTokenResponseTypeDef
from types_aiobotocore_codecatalyst.type_defs import CreateAccessTokenRequestRequestTypeDef


session = get_session()

async with session.create_client("codecatalyst") as client:
    client: CodeCatalystClient
    kwargs: CreateAccessTokenRequestRequestTypeDef = {...}
    result: CreateAccessTokenResponseTypeDef = await client.create_access_token(**kwargs)
# ListAccessTokensPaginator usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_codecatalyst.client import CodeCatalystClient
from types_aiobotocore_codecatalyst.paginator import ListAccessTokensPaginator
from types_aiobotocore_codecatalyst.type_defs import ListAccessTokensResponseTypeDef


session = get_session()

async with session.create_client("codecatalyst") as client:
    client: CodeCatalystClient
    paginator: ListAccessTokensPaginator = client.get_paginator("list_access_tokens")
    async for item in paginator.paginate(...):
        item: ListAccessTokensResponseTypeDef
        print(item)