Skip to content

Examples#

Index > Connect > Examples

Auto-generated documentation for Connect type annotations stubs module types-boto3-connect.

Client#

Implicit type annotations#

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

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

Client method usage example#

# ConnectClient usage example

from boto3.session import Session


session = Session()

client = session.client("connect")  # (1)
result = client.activate_evaluation_form()  # (2)
  1. client: ConnectClient
  2. result: ActivateEvaluationFormResponseTypeDef

Paginator usage example#

# GetMetricDataPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("get_metric_data")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: ConnectClient
  2. paginator: GetMetricDataPaginator
  3. item: GetMetricDataResponseTypeDef

Explicit type annotations#

With types-boto3-lite[connect] or a standalone types_boto3_connect package, you have to explicitly specify client: ConnectClient 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.

Client method usage example#

# ConnectClient usage example with type annotations

from boto3.session import Session

from types_boto3_connect.client import ConnectClient
from types_boto3_connect.type_defs import ActivateEvaluationFormResponseTypeDef
from types_boto3_connect.type_defs import ActivateEvaluationFormRequestTypeDef


session = Session()

client: ConnectClient = session.client("connect")

kwargs: ActivateEvaluationFormRequestTypeDef = {...}
result: ActivateEvaluationFormResponseTypeDef = client.activate_evaluation_form(**kwargs)

Paginator usage example#

# GetMetricDataPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_connect.client import ConnectClient
from types_boto3_connect.paginator import GetMetricDataPaginator
from types_boto3_connect.type_defs import GetMetricDataResponseTypeDef


session = Session()
client: ConnectClient = session.client("connect")

paginator: GetMetricDataPaginator = client.get_paginator("get_metric_data")
for item in paginator.paginate(...):
    item: GetMetricDataResponseTypeDef
    print(item)