Skip to content

Examples#

Index > CodeCatalyst > Examples

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

Client#

Implicit type annotations#

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

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

# CodeCatalystClient usage example

from boto3.session import Session


session = Session()

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

from boto3.session import Session


session = Session()
client = session.client("codecatalyst")  # (1)

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

Explicit type annotations#

With types-boto3-lite[codecatalyst] or a standalone types_boto3_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 boto3.session import Session

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


session = Session()

client: CodeCatalystClient = session.client("codecatalyst")

kwargs: CreateAccessTokenRequestRequestTypeDef = {...}
result: CreateAccessTokenResponseTypeDef = client.create_access_token(**kwargs)
# ListAccessTokensPaginator usage example with type annotations

from boto3.session import Session

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


session = Session()
client: CodeCatalystClient = session.client("codecatalyst")

paginator: ListAccessTokensPaginator = client.get_paginator("list_access_tokens")
for item in paginator.paginate(...):
    item: ListAccessTokensResponseTypeDef
    print(item)