Type annotations for boto3 ApplicationCostProfiler

1.42.3 · active · verified Sat Apr 11

mypy-boto3-applicationcostprofiler provides type annotations for the boto3 ApplicationCostProfiler service, generated with mypy-boto3-builder. It enhances development with type checking and autocomplete for AWS SDK for Python (boto3) clients. The library is actively maintained with frequent releases, typically in sync with boto3 and botocore updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain a type-hinted boto3 client for the ApplicationCostProfiler service. It uses `TYPE_CHECKING` for conditional imports, ensuring the stubs are only used during type checking. A sample API call `list_report_definitions` is included to show typical usage with type safety.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_applicationcostprofiler.client import ApplicationCostProfilerClient
    from mypy_boto3_applicationcostprofiler.type_defs import ListReportDefinitionsOutputTypeDef

def get_app_cost_profiler_client() -> ApplicationCostProfilerClient:
    """Returns a typed ApplicationCostProfiler client."""
    return boto3.client('applicationcostprofiler')

client = get_app_cost_profiler_client()

try:
    # Example operation: List report definitions
    response: ListReportDefinitionsOutputTypeDef = client.list_report_definitions()
    print(f"Successfully listed {len(response.get('reportDefinitions', []))} report definitions.")
except client.exceptions.ClientError as e:
    print(f"Error listing report definitions: {e}")

view raw JSON →