mypy-boto3-route53globalresolver Type Stubs

1.42.64 · active · verified Sat Apr 11

mypy-boto3-route53globalresolver provides type annotations for the boto3 Route53GlobalResolver client, enabling static type checking with tools like MyPy. It ensures type safety for AWS API calls made via boto3. The library is part of the larger `mypy-boto3-builder` ecosystem, which typically releases updates frequently, synchronized with new boto3 releases and AWS service updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to instantiate a boto3 Route53GlobalResolver client and apply the type hints provided by `mypy-boto3-route53globalresolver`. It includes a basic API call example (listing resolver endpoints) and shows how MyPy would validate the types.

import boto3
from mypy_boto3_route53globalresolver.client import Route53GlobalResolverClient

# Initialize a boto3 client for Route53GlobalResolver
# Ensure AWS credentials and region are configured via environment variables
# (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME) or AWS config files.
client: Route53GlobalResolverClient = boto3.client("route53-global-resolver")

# Example usage: List Resolver Endpoints
# The exact API calls depend on the specific service functionality.
try:
    response = client.list_resolver_endpoints(
        MaxResults=5 # Limit results for a quick example
    )
    print(f"Successfully listed {len(response.get('ResolverEndpoints', []))} Resolver Endpoints.")
    if response.get('ResolverEndpoints'):
        first_endpoint = response['ResolverEndpoints'][0]
        print(f"First endpoint ID: {first_endpoint.get('Id')}, Name: {first_endpoint.get('Name')}")
except Exception as e:
    print(f"Error listing resolver endpoints: {e}")

# Type checking with MyPy will now ensure that 'client' methods and 'response' structure are correct.

view raw JSON →