Mypy Boto3 AuditManager Stubs
mypy-boto3-auditmanager provides PEP 561 compliant type annotations for the AWS Boto3 AuditManager service, ensuring static type checking for your Boto3 clients. It is currently at version 1.42.3 and is actively maintained, with frequent releases tied to the upstream `boto3` library and `mypy-boto3-builder` updates.
Warnings
- breaking Python 3.8 support was removed for all `mypy-boto3` packages, including `mypy-boto3-auditmanager`, starting with `mypy-boto3-builder` version 8.12.0.
- breaking Type Definition Naming Conventions underwent changes in `mypy-boto3-builder 8.9.0`. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef` and `Extra` postfixes moved to the end.
- gotcha It is critical that the version of `mypy-boto3-auditmanager` exactly matches the major and minor version of your installed `boto3` library (e.g., `mypy-boto3-auditmanager==1.x.y` for `boto3==1.x.z`). Mismatched versions can lead to incorrect type checking or runtime errors.
- gotcha `mypy-boto3` packages migrated to PEP 561 packaging in `mypy-boto3-builder 8.12.0`. While generally transparent, this might affect advanced build systems or tools that rely on specific package discovery mechanisms.
Install
-
pip install mypy-boto3-auditmanager
Imports
- AuditManagerClient
from mypy_boto3_auditmanager.client import AuditManagerClient
- GetChangeLogsRequestRequestTypeDef
from mypy_boto3_auditmanager.type_defs import GetChangeLogsRequestRequestTypeDef
- GetChangeLogsResponseTypeDef
from mypy_boto3_auditmanager.type_defs import GetChangeLogsResponseTypeDef
Quickstart
import boto3
from mypy_boto3_auditmanager.client import AuditManagerClient
from mypy_boto3_auditmanager.type_defs import GetChangeLogsRequestRequestTypeDef, GetChangeLogsResponseTypeDef
# Instantiate a Boto3 client with type hints
client: AuditManagerClient = boto3.client("auditmanager")
# Example of using type definitions for request and response
request_params: GetChangeLogsRequestRequestTypeDef = {
"auditReportId": "your-audit-report-id", # Replace with actual ID
"nextToken": "",
"maxResults": 10
}
try:
# Call a service method, type checkers will validate arguments and return type
response: GetChangeLogsResponseTypeDef = client.get_change_logs(**request_params)
print(f"Successfully retrieved {len(response.get('changeLogs', []))} change logs.")
except Exception as e:
print(f"Error calling AuditManager: {e}")