Skip to content

Examples#

Index > PersonalizeEvents > Examples

Auto-generated documentation for PersonalizeEvents type annotations stubs module types-aiobotocore-personalize-events.

Client#

Implicit type annotations#

Can be used with types-aioboto3[personalize-events] package installed.

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

# PersonalizeEventsClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("personalize-events") as client:  # (1)
    result = await client.put_action_interactions()  # (2)
  1. client: PersonalizeEventsClient
  2. result: EmptyResponseMetadataTypeDef

Explicit type annotations#

With types-aioboto3-lite[personalize-events] or a standalone types_aiobotocore_personalize_events package, you have to explicitly specify client: PersonalizeEventsClient 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.

# PersonalizeEventsClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_personalize_events.client import PersonalizeEventsClient
from types_aiobotocore_personalize_events.type_defs import EmptyResponseMetadataTypeDef
from types_aiobotocore_personalize_events.type_defs import PutActionInteractionsRequestRequestTypeDef


session = Session()

client: PersonalizeEventsClient
async with session.client("personalize-events") as client:  # (1)
    kwargs: PutActionInteractionsRequestRequestTypeDef = {...}  # (2)
    result: EmptyResponseMetadataTypeDef = await client.put_action_interactions(**kwargs)  # (3)
  1. client: PersonalizeEventsClient
  2. kwargs: PutActionInteractionsRequestRequestTypeDef
  3. result: EmptyResponseMetadataTypeDef