Skip to content

Examples#

Index > IoTFleetWise > Examples

Auto-generated documentation for IoTFleetWise type annotations stubs module mypy-boto3-iotfleetwise.

Client#

Implicit type annotations#

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

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

# IoTFleetWiseClient usage example

from boto3.session import Session


session = Session()

client = session.client("iotfleetwise")  # (1)
result = client.batch_create_vehicle()  # (2)
  1. client: IoTFleetWiseClient
  2. result: BatchCreateVehicleResponseTypeDef
# GetVehicleStatusPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("iotfleetwise")  # (1)

paginator = client.get_paginator("get_vehicle_status")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: IoTFleetWiseClient
  2. paginator: GetVehicleStatusPaginator
  3. item: GetVehicleStatusResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[iotfleetwise] or a standalone mypy_boto3_iotfleetwise package, you have to explicitly specify client: IoTFleetWiseClient 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.

# IoTFleetWiseClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_iotfleetwise.client import IoTFleetWiseClient
from mypy_boto3_iotfleetwise.type_defs import BatchCreateVehicleResponseTypeDef
from mypy_boto3_iotfleetwise.type_defs import BatchCreateVehicleRequestRequestTypeDef


session = Session()

client: IoTFleetWiseClient = session.client("iotfleetwise")

kwargs: BatchCreateVehicleRequestRequestTypeDef = {...}
result: BatchCreateVehicleResponseTypeDef = client.batch_create_vehicle(**kwargs)
# GetVehicleStatusPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_iotfleetwise.client import IoTFleetWiseClient
from mypy_boto3_iotfleetwise.paginator import GetVehicleStatusPaginator
from mypy_boto3_iotfleetwise.type_defs import GetVehicleStatusResponseTypeDef


session = Session()
client: IoTFleetWiseClient = session.client("iotfleetwise")

paginator: GetVehicleStatusPaginator = client.get_paginator("get_vehicle_status")
for item in paginator.paginate(...):
    item: GetVehicleStatusResponseTypeDef
    print(item)