Skip to content

Examples#

Index > Kendra > Examples

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

Client#

Implicit type annotations#

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

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

# 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 types-boto3-lite[kendra] or a standalone types_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.

# KendraClient usage example with type annotations

from boto3.session import Session

from types_boto3_kendra.client import KendraClient
from types_boto3_kendra.type_defs import AssociateEntitiesToExperienceResponseTypeDef
from types_boto3_kendra.type_defs import AssociateEntitiesToExperienceRequestRequestTypeDef


session = Session()

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

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