Skip to content

Examples#

Index > TimestreamInfluxDB > Examples

Auto-generated documentation for TimestreamInfluxDB type annotations stubs module mypy-boto3-timestream-influxdb.

Client#

Implicit type annotations#

Can be used with boto3-stubs[timestream-influxdb] package installed.

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

Client method usage example#

# TimestreamInfluxDBClient usage example

from boto3.session import Session


session = Session()

client = session.client("timestream-influxdb")  # (1)
result = client.create_db_cluster()  # (2)
  1. client: TimestreamInfluxDBClient
  2. result: CreateDbClusterOutputTypeDef

Paginator usage example#

# ListDbClustersPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("timestream-influxdb")  # (1)

paginator = client.get_paginator("list_db_clusters")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: TimestreamInfluxDBClient
  2. paginator: ListDbClustersPaginator
  3. item: ListDbClustersOutputTypeDef

Explicit type annotations#

With boto3-stubs-lite[timestream-influxdb] or a standalone mypy_boto3_timestream_influxdb package, you have to explicitly specify client: TimestreamInfluxDBClient 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 method usage example#

# TimestreamInfluxDBClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_timestream_influxdb.client import TimestreamInfluxDBClient
from mypy_boto3_timestream_influxdb.type_defs import CreateDbClusterOutputTypeDef
from mypy_boto3_timestream_influxdb.type_defs import CreateDbClusterInputTypeDef


session = Session()

client: TimestreamInfluxDBClient = session.client("timestream-influxdb")

kwargs: CreateDbClusterInputTypeDef = {...}
result: CreateDbClusterOutputTypeDef = client.create_db_cluster(**kwargs)

Paginator usage example#

# ListDbClustersPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_timestream_influxdb.client import TimestreamInfluxDBClient
from mypy_boto3_timestream_influxdb.paginator import ListDbClustersPaginator
from mypy_boto3_timestream_influxdb.type_defs import ListDbClustersOutputTypeDef


session = Session()
client: TimestreamInfluxDBClient = session.client("timestream-influxdb")

paginator: ListDbClustersPaginator = client.get_paginator("list_db_clusters")
for item in paginator.paginate(...):
    item: ListDbClustersOutputTypeDef
    print(item)