Skip to content

Examples#

Index > CustomerProfiles > Examples

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

Client#

Implicit type annotations#

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

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

Client method usage example#

# CustomerProfilesClient usage example

from boto3.session import Session


session = Session()

client = session.client("customer-profiles")  # (1)
result = client.add_profile_key()  # (2)
  1. client: CustomerProfilesClient
  2. result: AddProfileKeyResponseTypeDef

Paginator usage example#

# GetSimilarProfilesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("customer-profiles")  # (1)

paginator = client.get_paginator("get_similar_profiles")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: CustomerProfilesClient
  2. paginator: GetSimilarProfilesPaginator
  3. item: GetSimilarProfilesResponseTypeDef

Explicit type annotations#

With types-boto3-lite[customer-profiles] or a standalone types_boto3_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.

Client method usage example#

# CustomerProfilesClient usage example with type annotations

from boto3.session import Session

from types_boto3_customer_profiles.client import CustomerProfilesClient
from types_boto3_customer_profiles.type_defs import AddProfileKeyResponseTypeDef
from types_boto3_customer_profiles.type_defs import AddProfileKeyRequestTypeDef


session = Session()

client: CustomerProfilesClient = session.client("customer-profiles")

kwargs: AddProfileKeyRequestTypeDef = {...}
result: AddProfileKeyResponseTypeDef = client.add_profile_key(**kwargs)

Paginator usage example#

# GetSimilarProfilesPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_customer_profiles.client import CustomerProfilesClient
from types_boto3_customer_profiles.paginator import GetSimilarProfilesPaginator
from types_boto3_customer_profiles.type_defs import GetSimilarProfilesResponseTypeDef


session = Session()
client: CustomerProfilesClient = session.client("customer-profiles")

paginator: GetSimilarProfilesPaginator = client.get_paginator("get_similar_profiles")
for item in paginator.paginate(...):
    item: GetSimilarProfilesResponseTypeDef
    print(item)