Type Annotations for AWS Billing and Cost Management Recommended Actions (Boto3)

1.42.9 · active · verified Sat Apr 11

This library provides comprehensive type annotations (stubs) for the `boto3` client of the AWS Billing and Cost Management Recommended Actions service, enabling static type checking with tools like MyPy. It is part of the `mypy-boto3` project, which generates stubs for all AWS services. The current version is `1.42.9`, and the project has a frequent release cadence, often aligning with `boto3` updates and new AWS service features.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `boto3` client for the Billing and Cost Management Recommended Actions service and annotate it with the `mypy-boto3` provided type, enabling static analysis of API calls.

import boto3
from mypy_boto3_bcm_recommended_actions.client import BillingAndCostManagementRecommendedActionsClient

# For demonstration, typically use AWS credentials configured externally
# via environment variables, ~/.aws/credentials, etc.
# This example assumes you have valid AWS credentials configured.

try:
    session = boto3.Session(region_name="us-east-1")
    client: BillingAndCostManagementRecommendedActionsClient = session.client(
        "billing-cost-management-recommended-actions"
    )

    # Example: List resource budgeting recommendations (actual API call might vary)
    # Note: This service's API details might not have common public list operations
    # The example is illustrative for type checking.
    # Consult AWS BCM Recommended Actions documentation for actual operations.
    print("Attempting a dummy client call for type checking demonstration...")
    # The BCM Recommended Actions service typically works with specific actions/recommendations.
    # A simple call might not exist for generic 'list'.
    # Let's simulate a call that would be type-checked if it existed.
    # For real use, replace with an actual API method like 'get_recommendations'.
    # response = client.get_recommendations(RecommendationType='SOME_TYPE') # Example
    # print(response)
    print("Client successfully initialized with type hints.")
    print(f"Client type: {type(client)}")
except Exception as e:
    print(f"An error occurred: {e}")
    print("Please ensure 'boto3' is installed and AWS credentials are configured.")

view raw JSON →