Skip to content

Examples#

Index > CustomerProfiles > Examples

Auto-generated documentation for CustomerProfiles type annotations stubs module types-aiobotocore-customer-profiles.

Client#

Implicit type annotations#

Can be used with types-aioboto3[customer-profiles] package installed.

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

# CustomerProfilesClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("customer-profiles") as client:  # (1)
    result = await client.add_profile_key()  # (2)
  1. client: CustomerProfilesClient
  2. result: AddProfileKeyResponseTypeDef
# ListEventStreamsPaginator usage example

from aioboto3.session import Session


session = Session()

async with session.client("customer-profiles") as client:  # (1)
    paginator = client.get_paginator("list_event_streams")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: CustomerProfilesClient
  2. paginator: ListEventStreamsPaginator
  3. item: ListEventStreamsResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[customer-profiles] or a standalone types_aiobotocore_customer_profiles package, you have to explicitly specify client: CustomerProfilesClient 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.

# CustomerProfilesClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_customer_profiles.client import CustomerProfilesClient
from types_aiobotocore_customer_profiles.type_defs import AddProfileKeyResponseTypeDef
from types_aiobotocore_customer_profiles.type_defs import AddProfileKeyRequestRequestTypeDef


session = Session()

client: CustomerProfilesClient
async with session.client("customer-profiles") as client:  # (1)
    kwargs: AddProfileKeyRequestRequestTypeDef = {...}  # (2)
    result: AddProfileKeyResponseTypeDef = await client.add_profile_key(**kwargs)  # (3)
  1. client: CustomerProfilesClient
  2. kwargs: AddProfileKeyRequestRequestTypeDef
  3. result: AddProfileKeyResponseTypeDef
# ListEventStreamsPaginator usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_customer_profiles.client import CustomerProfilesClient
from types_aiobotocore_customer_profiles.paginator import ListEventStreamsPaginator
from types_aiobotocore_customer_profiles.type_defs import ListEventStreamsResponseTypeDef


session = Session()

client: CustomerProfilesClient
async with session.client("customer-profiles") as client:  # (1)
    paginator: ListEventStreamsPaginator = client.get_paginator("list_event_streams")  # (2)
    async for item in paginator.paginate(...):
        item: ListEventStreamsResponseTypeDef
        print(item)  # (3)
  1. client: CustomerProfilesClient
  2. paginator: ListEventStreamsPaginator
  3. item: ListEventStreamsResponseTypeDef