Examples#
Index > CodeConnections > Examples
Auto-generated documentation for CodeConnections type annotations stubs module types-boto3-codeconnections.
Client#
Implicit type annotations#
Can be used with types-boto3[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)
- client: CodeConnectionsClient
- result: CreateConnectionOutputTypeDef
Explicit type annotations#
With types-boto3-lite[codeconnections]
or a standalone types_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 types_boto3_codeconnections.client import CodeConnectionsClient
from types_boto3_codeconnections.type_defs import CreateConnectionOutputTypeDef
from types_boto3_codeconnections.type_defs import CreateConnectionInputRequestTypeDef
session = Session()
client: CodeConnectionsClient = session.client("codeconnections")
kwargs: CreateConnectionInputRequestTypeDef = {...}
result: CreateConnectionOutputTypeDef = client.create_connection(**kwargs)