Skip to content

Examples#

Index > Firehose > Examples

Auto-generated documentation for Firehose type annotations stubs module types-aiobotocore-firehose.

Client#

Implicit type annotations#

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

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

# FirehoseClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("firehose") as client:  # (1)
    result = await client.create_delivery_stream()  # (2)
  1. client: FirehoseClient
  2. result: CreateDeliveryStreamOutputTypeDef

Explicit type annotations#

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

# FirehoseClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_firehose.client import FirehoseClient
from types_aiobotocore_firehose.type_defs import CreateDeliveryStreamOutputTypeDef
from types_aiobotocore_firehose.type_defs import CreateDeliveryStreamInputRequestTypeDef


session = Session()

client: FirehoseClient
async with session.client("firehose") as client:  # (1)
    kwargs: CreateDeliveryStreamInputRequestTypeDef = {...}  # (2)
    result: CreateDeliveryStreamOutputTypeDef = await client.create_delivery_stream(**kwargs)  # (3)
  1. client: FirehoseClient
  2. kwargs: CreateDeliveryStreamInputRequestTypeDef
  3. result: CreateDeliveryStreamOutputTypeDef