Examples#
Index > IoTAnalytics > Examples
Auto-generated documentation for IoTAnalytics type annotations stubs module mypy-boto3-iotanalytics.
Client#
Implicit type annotations#
Can be used with boto3-stubs[iotanalytics]
package installed.
Write your IoTAnalytics
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# IoTAnalyticsClient usage example
from boto3.session import Session
session = Session()
client = session.client("iotanalytics") # (1)
result = client.batch_put_message() # (2)
- client: IoTAnalyticsClient
- result: BatchPutMessageResponseTypeDef
Paginator usage example#
# ListChannelsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("iotanalytics") # (1)
paginator = client.get_paginator("list_channels") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: IoTAnalyticsClient
- paginator: ListChannelsPaginator
- item: ListChannelsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[iotanalytics]
or a standalone mypy_boto3_iotanalytics
package, you have to explicitly specify client: IoTAnalyticsClient
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#
# IoTAnalyticsClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_iotanalytics.client import IoTAnalyticsClient
from mypy_boto3_iotanalytics.type_defs import BatchPutMessageResponseTypeDef
from mypy_boto3_iotanalytics.type_defs import BatchPutMessageRequestTypeDef
session = Session()
client: IoTAnalyticsClient = session.client("iotanalytics")
kwargs: BatchPutMessageRequestTypeDef = {...}
result: BatchPutMessageResponseTypeDef = client.batch_put_message(**kwargs)
Paginator usage example#
# ListChannelsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_iotanalytics.client import IoTAnalyticsClient
from mypy_boto3_iotanalytics.paginator import ListChannelsPaginator
from mypy_boto3_iotanalytics.type_defs import ListChannelsResponseTypeDef
session = Session()
client: IoTAnalyticsClient = session.client("iotanalytics")
paginator: ListChannelsPaginator = client.get_paginator("list_channels")
for item in paginator.paginate(...):
item: ListChannelsResponseTypeDef
print(item)