Skip to content

Examples#

Index > Kendra > Examples

Auto-generated documentation for Kendra type annotations stubs module mypy-boto3-kendra.

Client#

Implicit type annotations#

Can be used with boto3-stubs[kendra] package installed.

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

Client method usage example#

# KendraClient usage example

from boto3.session import Session


session = Session()

client = session.client("kendra")  # (1)
result = client.associate_entities_to_experience()  # (2)
  1. client: KendraClient
  2. result: AssociateEntitiesToExperienceResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[kendra] or a standalone mypy_boto3_kendra package, you have to explicitly specify client: KendraClient 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#

# KendraClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_kendra.client import KendraClient
from mypy_boto3_kendra.type_defs import AssociateEntitiesToExperienceResponseTypeDef
from mypy_boto3_kendra.type_defs import AssociateEntitiesToExperienceRequestTypeDef


session = Session()

client: KendraClient = session.client("kendra")

kwargs: AssociateEntitiesToExperienceRequestTypeDef = {...}
result: AssociateEntitiesToExperienceResponseTypeDef = client.associate_entities_to_experience(**kwargs)