Skip to content

Examples#

Index > PersonalizeEvents > Examples

Auto-generated documentation for PersonalizeEvents type annotations stubs module mypy-boto3-personalize-events.

Client#

Implicit type annotations#

Can be used with boto3-stubs[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 boto3.session import Session


session = Session()

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

Explicit type annotations#

With boto3-stubs-lite[personalize-events] or a standalone mypy_boto3_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 boto3.session import Session

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


session = Session()

client: PersonalizeEventsClient = session.client("personalize-events")

kwargs: PutActionInteractionsRequestRequestTypeDef = {...}
result: EmptyResponseMetadataTypeDef = client.put_action_interactions(**kwargs)