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

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

# CodeCatalystClient usage example

from aioboto3.session import Session


session = Session()

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

from aioboto3.session import Session


session = Session()

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

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

from aioboto3.session import Session

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


session = Session()

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