Skip to content

Examples#

Index > QLDB > Examples

Auto-generated documentation for QLDB type annotations stubs module types-aiobotocore-qldb.

Client#

Implicit type annotations#

Can be used with types-aioboto3[qldb] package installed.

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

# QLDBClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("qldb") as client:  # (1)
    result = await client.cancel_journal_kinesis_stream()  # (2)
  1. client: QLDBClient
  2. result: CancelJournalKinesisStreamResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[qldb] or a standalone types_aiobotocore_qldb package, you have to explicitly specify client: QLDBClient 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.

# QLDBClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_qldb.client import QLDBClient
from types_aiobotocore_qldb.type_defs import CancelJournalKinesisStreamResponseTypeDef
from types_aiobotocore_qldb.type_defs import CancelJournalKinesisStreamRequestRequestTypeDef


session = Session()

client: QLDBClient
async with session.client("qldb") as client:  # (1)
    kwargs: CancelJournalKinesisStreamRequestRequestTypeDef = {...}  # (2)
    result: CancelJournalKinesisStreamResponseTypeDef = await client.cancel_journal_kinesis_stream(**kwargs)  # (3)
  1. client: QLDBClient
  2. kwargs: CancelJournalKinesisStreamRequestRequestTypeDef
  3. result: CancelJournalKinesisStreamResponseTypeDef