Examples#
Index > CodeStarconnections > Examples
Auto-generated documentation for CodeStarconnections type annotations stubs module mypy-boto3-codestar-connections.
Client#
Implicit type annotations#
Can be used with boto3-stubs[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 boto3.session import Session
session = Session()
client = session.client("codestar-connections") # (1)
result = client.create_connection() # (2)
- client: CodeStarconnectionsClient
- result: CreateConnectionOutputTypeDef
Explicit type annotations#
With boto3-stubs-lite[codestar-connections]
or a standalone mypy_boto3_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 boto3.session import Session
from mypy_boto3_codestar_connections.client import CodeStarconnectionsClient
from mypy_boto3_codestar_connections.type_defs import CreateConnectionOutputTypeDef
from mypy_boto3_codestar_connections.type_defs import CreateConnectionInputRequestTypeDef
session = Session()
client: CodeStarconnectionsClient = session.client("codestar-connections")
kwargs: CreateConnectionInputRequestTypeDef = {...}
result: CreateConnectionOutputTypeDef = client.create_connection(**kwargs)