Examples
Index > CleanRoomsService > Examples
Auto-generated documentation for CleanRoomsService type annotations stubs module mypy-boto3-cleanrooms.
Client
Implicit type annotations
Can be used with boto3-stubs[cleanrooms]
package installed.
Write your CleanRoomsService
code as usual,
type checking and code completion should work out of the box.
# CleanRoomsServiceClient usage example
from boto3.session import Session
session = Session()
client = session.client("cleanrooms") # (1)
result = client.batch_get_schema() # (2)
- client: CleanRoomsServiceClient
- result: BatchGetSchemaOutputTypeDef
# ListCollaborationsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("cleanrooms") # (1)
paginator = client.get_paginator("list_collaborations") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: CleanRoomsServiceClient
- paginator: ListCollaborationsPaginator
- item: ListCollaborationsOutputTypeDef
Explicit type annotations
With boto3-stubs-lite[cleanrooms]
or a standalone mypy_boto3_cleanrooms
package, you have to explicitly specify client: CleanRoomsServiceClient
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.
# CleanRoomsServiceClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_cleanrooms.client import CleanRoomsServiceClient
from mypy_boto3_cleanrooms.type_defs import BatchGetSchemaOutputTypeDef
from mypy_boto3_cleanrooms.type_defs import BatchGetSchemaInputRequestTypeDef
session = Session()
client: CleanRoomsServiceClient = session.client("cleanrooms")
kwargs: BatchGetSchemaInputRequestTypeDef = {...}
result: BatchGetSchemaOutputTypeDef = client.batch_get_schema(**kwargs)
# ListCollaborationsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_cleanrooms.client import CleanRoomsServiceClient
from mypy_boto3_cleanrooms.paginator import ListCollaborationsPaginator
from mypy_boto3_cleanrooms.type_defs import ListCollaborationsOutputTypeDef
session = Session()
client: CleanRoomsServiceClient = session.client("cleanrooms")
paginator: ListCollaborationsPaginator = client.get_paginator("list_collaborations")
for item in paginator.paginate(...):
item: ListCollaborationsOutputTypeDef
print(item)