Skip to content

Examples#

Index > CodeConnections > Examples

Auto-generated documentation for CodeConnections type annotations stubs module mypy-boto3-codeconnections.

Client#

Implicit type annotations#

Can be used with boto3-stubs[codeconnections] package installed.

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

# CodeConnectionsClient usage example

from boto3.session import Session


session = Session()

client = session.client("codeconnections")  # (1)
result = client.create_connection()  # (2)
  1. client: CodeConnectionsClient
  2. result: CreateConnectionOutputTypeDef

Explicit type annotations#

With boto3-stubs-lite[codeconnections] or a standalone mypy_boto3_codeconnections package, you have to explicitly specify client: CodeConnectionsClient 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.

# CodeConnectionsClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_codeconnections.client import CodeConnectionsClient
from mypy_boto3_codeconnections.type_defs import CreateConnectionOutputTypeDef
from mypy_boto3_codeconnections.type_defs import CreateConnectionInputRequestTypeDef


session = Session()

client: CodeConnectionsClient = session.client("codeconnections")

kwargs: CreateConnectionInputRequestTypeDef = {...}
result: CreateConnectionOutputTypeDef = client.create_connection(**kwargs)