Skip to content

Examples#

Index > CodeStarconnections > Examples

Auto-generated documentation for CodeStarconnections type annotations stubs module types-aiobotocore-codestar-connections.

Client#

Implicit type annotations#

Can be used with types-aioboto3[codestar-connections] package installed.

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

# CodeStarconnectionsClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("codestar-connections") as client:  # (1)
    result = await client.create_connection()  # (2)
  1. client: CodeStarconnectionsClient
  2. result: CreateConnectionOutputTypeDef

Explicit type annotations#

With types-aioboto3-lite[codestar-connections] or a standalone types_aiobotocore_codestar_connections package, you have to explicitly specify client: CodeStarconnectionsClient 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.

# CodeStarconnectionsClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_codestar_connections.client import CodeStarconnectionsClient
from types_aiobotocore_codestar_connections.type_defs import CreateConnectionOutputTypeDef
from types_aiobotocore_codestar_connections.type_defs import CreateConnectionInputRequestTypeDef


session = Session()

client: CodeStarconnectionsClient
async with session.client("codestar-connections") as client:  # (1)
    kwargs: CreateConnectionInputRequestTypeDef = {...}  # (2)
    result: CreateConnectionOutputTypeDef = await client.create_connection(**kwargs)  # (3)
  1. client: CodeStarconnectionsClient
  2. kwargs: CreateConnectionInputRequestTypeDef
  3. result: CreateConnectionOutputTypeDef