mypy-boto3-snowball

1.42.3 · active · verified Sat Apr 11

Type annotations for boto3 Snowball 1.42.3 service generated with mypy-boto3-builder 8.12.0. This library provides static type checking for `boto3` clients and resources, enhancing development with autocompletion and early error detection for AWS Snowball operations. It follows `boto3`'s release cadence, with frequent updates to align with new AWS service versions.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `boto3` Snowball client and use it with `mypy-boto3-snowball` type annotations. The `TYPE_CHECKING` guard ensures the stub package is only used during static analysis, preventing a runtime dependency. The example lists up to 10 Snowball jobs.

import boto3
from typing import TYPE_CHECKING
from mypy_boto3_snowball.client import SnowballClient

def get_snowball_jobs():
    # Use TYPE_CHECKING guard to avoid runtime dependency on mypy-boto3-snowball
    if TYPE_CHECKING:
        client: SnowballClient = boto3.client("snowball")
    else:
        client = boto3.client("snowball")

    try:
        response = client.list_jobs(
            MaxResults=10,
            # NextToken='string' # Uncomment if you have a next token
        )
        print(f"Snowball Jobs: {response.get('JobListEntries')}")
        return response.get('JobListEntries', [])
    except client.exceptions.InvalidResourceException as e:
        print(f"Error: {e}")
        return []

if __name__ == "__main__":
    # Ensure AWS credentials are configured (e.g., via ~/.aws/credentials or environment variables)
    # For local testing, you might need a mock boto3 or actual AWS setup.
    print("Attempting to list Snowball jobs...")
    jobs = get_snowball_jobs()

view raw JSON →