Examples#
Index > CloudDirectory > Examples
Auto-generated documentation for CloudDirectory type annotations stubs module types-aiobotocore-clouddirectory.
Client#
Implicit type annotations#
Can be used with types-aiobotocore[clouddirectory]
package installed.
Write your CloudDirectory
code as usual,
type checking and code completion should work out of the box.
# CloudDirectoryClient usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("clouddirectory") as client: # (1)
result = await client.apply_schema() # (2)
- client: CloudDirectoryClient
- result: ApplySchemaResponseTypeDef
# ListAppliedSchemaArnsPaginator usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("clouddirectory") as client: # (1)
paginator = client.get_paginator("list_applied_schema_arns") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: CloudDirectoryClient
- paginator: ListAppliedSchemaArnsPaginator
- item: ListAppliedSchemaArnsResponseTypeDef
Explicit type annotations#
With types-aiobotocore-lite[clouddirectory]
or a standalone types_aiobotocore_clouddirectory
package, you have to explicitly specify
client: CloudDirectoryClient
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.
# CloudDirectoryClient usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_clouddirectory.client import CloudDirectoryClient
from types_aiobotocore_clouddirectory.type_defs import ApplySchemaResponseTypeDef
from types_aiobotocore_clouddirectory.type_defs import ApplySchemaRequestRequestTypeDef
session = get_session()
async with session.create_client("clouddirectory") as client:
client: CloudDirectoryClient
kwargs: ApplySchemaRequestRequestTypeDef = {...}
result: ApplySchemaResponseTypeDef = await client.apply_schema(**kwargs)
# ListAppliedSchemaArnsPaginator usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_clouddirectory.client import CloudDirectoryClient
from types_aiobotocore_clouddirectory.paginator import ListAppliedSchemaArnsPaginator
from types_aiobotocore_clouddirectory.type_defs import ListAppliedSchemaArnsResponseTypeDef
session = get_session()
async with session.create_client("clouddirectory") as client:
client: CloudDirectoryClient
paginator: ListAppliedSchemaArnsPaginator = client.get_paginator("list_applied_schema_arns")
async for item in paginator.paginate(...):
item: ListAppliedSchemaArnsResponseTypeDef
print(item)