mypy-boto3-iotwireless Type Annotations

1.42.3 · active · verified Sat Apr 11

mypy-boto3-iotwireless provides type annotations for the `boto3` IoTWireless service. It is generated by `mypy-boto3-builder` and enables static type checking with tools like MyPy, improved IDE autocompletion, and enhanced code navigation for `boto3` users. The current version is 1.42.3, typically released in sync with `boto3` updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a typed `IoTWirelessClient` using `boto3` and perform a basic API call (`list_destinations`) with type-hinted request and response objects. It assumes `boto3` and `mypy-boto3-iotwireless` are installed and AWS credentials are configured (e.g., via environment variables or AWS CLI).

import boto3
from mypy_boto3_iotwireless.client import IoTWirelessClient
from mypy_boto3_iotwireless.type_defs import ListDestinationsResponseTypeDef
import os

def get_iotwireless_client() -> IoTWirelessClient:
    # Using explicit type annotation for the client
    client: IoTWirelessClient = boto3.client(
        "iotwireless",
        region_name=os.environ.get('AWS_REGION', 'us-east-1'),
        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')
    )
    return client


if __name__ == "__main__":
    client = get_iotwireless_client()
    try:
        # Example: Listing IoTWireless destinations with type-checked response
        response: ListDestinationsResponseTypeDef = client.list_destinations(
            MaxResults=10
        )
        print("Successfully listed IoTWireless destinations:")
        for dest in response.get('DestinationList', []):
            print(f"  - Name: {dest.get('Name')}, ARN: {dest.get('Arn')}")
    except Exception as e:
        print(f"Error listing destinations: {e}")

view raw JSON →