Type Stubs for boto3 AIOps Service
mypy-boto3-aiops provides comprehensive type annotations for the AWS AIOps service when used with the `boto3` library. As part of the `mypy-boto3` ecosystem, it enables static type checking with tools like `mypy` and enhances IDE autocompletion for `boto3` clients and responses. The library is actively maintained and regularly updated to reflect changes in `boto3` service definitions, with the current version being 1.42.3.
Warnings
- gotcha This package provides only type stubs. You must install the `boto3` library separately for runtime functionality. `mypy-boto3-aiops` will not make API calls on its own.
- breaking Python 3.8 support was removed with `mypy-boto3-builder` v8.12.0. As `mypy-boto3-aiops` v1.42.3 was generated using this builder, it explicitly requires Python 3.9 or newer.
- gotcha For accurate type checking, the version of `mypy-boto3-aiops` should ideally match or be compatible with your installed `boto3` version. Mismatched versions can lead to incorrect or missing type hints.
- breaking Specific `TypeDef` names for arguments or responses may change between versions (e.g., `CreateDistributionRequestRequestTypeDef` becoming `CreateDistributionRequestTypeDef`). This can break explicit type hints in your code.
Install
-
pip install boto3 mypy-boto3-aiops
Imports
- AIOPSClient
from mypy_boto3_aiops.client import AIOPSClient
- GetClient
from mypy_boto3_aiops import AIOPSClient as GetClient
- DescribeServiceQuotaResponseTypeDef
from mypy_boto3_aiops.type_defs import DescribeServiceQuotaResponseTypeDef
Quickstart
import boto3
from mypy_boto3_aiops.client import AIOPSClient
# Instantiate a boto3 AIOps client with type hint
client: AIOPSClient = boto3.client("aiops")
# Example usage with type-checked parameters and return value
# Note: AWS Account ID and Service Code might need to be valid for actual execution
response = client.describe_service_quota(
ServiceCode="s3", # Example service code
QuotaCode="L-F994326F", # Example quota code
AccountId="123456789012" # Example AWS account ID
)
print(f"Service Quota: {response.get('Quota', {}).get('QuotaName')}")
# To run this, ensure AWS credentials are configured (e.g., via ~/.aws/credentials
# or environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN).
# Also, 'aiops' is a placeholder service for demonstration purposes as AIOps is a broader concept.
# For actual AIOps related services like DevOps Guru, look for specific stubs.