Examples#
Index > CloudSearch > Examples
Auto-generated documentation for CloudSearch type annotations stubs module types-aiobotocore-cloudsearch.
Client#
Implicit type annotations#
Can be used with types-aioboto3[cloudsearch]
package installed.
Write your CloudSearch
code as usual,
type checking and code completion should work out of the box.
# CloudSearchClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("cloudsearch") as client: # (1)
result = await client.build_suggesters() # (2)
- client: CloudSearchClient
- result: BuildSuggestersResponseTypeDef
Explicit type annotations#
With types-aioboto3-lite[cloudsearch]
or a standalone types_aiobotocore_cloudsearch
package, you have to explicitly specify
client: CloudSearchClient
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.
# CloudSearchClient usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_cloudsearch.client import CloudSearchClient
from types_aiobotocore_cloudsearch.type_defs import BuildSuggestersResponseTypeDef
from types_aiobotocore_cloudsearch.type_defs import BuildSuggestersRequestRequestTypeDef
session = Session()
client: CloudSearchClient
async with session.client("cloudsearch") as client: # (1)
kwargs: BuildSuggestersRequestRequestTypeDef = {...} # (2)
result: BuildSuggestersResponseTypeDef = await client.build_suggesters(**kwargs) # (3)
- client: CloudSearchClient
- kwargs: BuildSuggestersRequestRequestTypeDef
- result: BuildSuggestersResponseTypeDef