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