mypy-boto3-panorama

1.42.3 · active · verified Sat Apr 11

mypy-boto3-panorama provides type annotations for the `boto3` Panorama service, ensuring static type checking for your AWS interactions. It is generated by `mypy-boto3-builder` and keeps pace with `boto3` releases, typically updating when `boto3` itself releases new versions or changes service APIs. The current version is 1.42.3.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to instantiate a Panorama client with type annotations and call a method. Ensure you have `boto3` and `mypy-boto3-panorama` installed, and your AWS credentials configured (e.g., via environment variables or `~/.aws/credentials`).

import os
import boto3
from mypy_boto3_panorama.client import PanoramaClient
from mypy_boto3_panorama.type_defs import ListApplicationInstancesOutputTypeDef

def list_panorama_instances(region: str = "us-east-1") -> ListApplicationInstancesOutputTypeDef:
    """Lists Panorama application instances with type checking."""
    # Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,
    # or ~/.aws/credentials. For demonstration, we'll use environment variables.
    client: PanoramaClient = boto3.client(
        "panorama",
        region_name=region,
        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),
        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')
    )
    
    response: ListApplicationInstancesOutputTypeDef = client.list_application_instances()
    print(f"Found {len(response.get('ApplicationInstances', []))} Panorama application instances.")
    return response

if __name__ == "__main__":
    try:
        # This call will likely fail without proper AWS credentials/permissions.
        # It demonstrates the type-checked interaction.
        list_panorama_instances()
    except Exception as e:
        print(f"Error listing Panorama instances (expected if credentials/permissions are not set): {e}")

view raw JSON →