Type Annotations for Boto3 DLM Service

1.42.84 · active · verified Sat Apr 11

mypy-boto3-dlm (version 1.42.84) provides static type annotations for the AWS Data Lifecycle Manager (DLM) service within the `boto3` library. It enables static analysis tools like MyPy and Pyright, and IDEs such as VSCode and PyCharm, to offer robust autocomplete, early error detection, and improved code quality for your `boto3` interactions. This package is automatically generated and kept in sync with `boto3` updates by the `mypy-boto3` project.

Warnings

Install

Imports

Quickstart

This example demonstrates how to import and use the `DLMClient` type for static analysis. The `if TYPE_CHECKING:` block ensures that the import is only active during type checking, avoiding potential runtime overhead or issues if stubs are not present in the production environment. Replace `policy-0123456789abcdef0` with an actual DLM policy ID for a successful response.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_dlm import DLMClient

# Instantiate the boto3 client with type hints
client: DLMClient = boto3.client("dlm", region_name="us-east-1")

# Example usage with type-checked methods and arguments
try:
    response = client.get_lifecycle_policies(
        PolicyIds=["policy-0123456789abcdef0"]
    )
    print("Successfully retrieved DLM policies:", response["Policies"])
except client.exceptions.ResourceNotFoundException as e:
    print(f"Policy not found: {e}")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →