{"id":3560,"library":"mypy-boto3-bcm-recommended-actions","title":"Type Annotations for AWS Billing and Cost Management Recommended Actions (Boto3)","description":"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.","status":"active","version":"1.42.9","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","Boto3","Type Hinting","MyPy","Billing","Cost Management"],"install":[{"cmd":"pip install boto3 mypy-boto3-bcm-recommended-actions","lang":"bash","label":"Install `boto3` and stubs"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed for runtime functionality.","package":"boto3","optional":false},{"reason":"Required for full type hint compatibility on Python versions older than 3.9, though often handled automatically by pip.","package":"typing-extensions","optional":true}],"imports":[{"note":"The client type hint comes from the mypy-boto3 stub package, not directly from boto3.","wrong":"from boto3.client import BillingAndCostManagementRecommendedActions","symbol":"BillingAndCostManagementRecommendedActionsClient","correct":"from mypy_boto3_bcm_recommended_actions.client import BillingAndCostManagementRecommendedActionsClient"},{"symbol":"Client","correct":"from mypy_boto3_bcm_recommended_actions.client import BillingAndCostManagementRecommendedActionsClient"},{"symbol":"ServiceResource","correct":"from mypy_boto3_bcm_recommended_actions.service_resource import BillingAndCostManagementRecommendedActionsServiceResource"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_bcm_recommended_actions.client import BillingAndCostManagementRecommendedActionsClient\n\n# For demonstration, typically use AWS credentials configured externally\n# via environment variables, ~/.aws/credentials, etc.\n# This example assumes you have valid AWS credentials configured.\n\ntry:\n    session = boto3.Session(region_name=\"us-east-1\")\n    client: BillingAndCostManagementRecommendedActionsClient = session.client(\n        \"billing-cost-management-recommended-actions\"\n    )\n\n    # Example: List resource budgeting recommendations (actual API call might vary)\n    # Note: This service's API details might not have common public list operations\n    # The example is illustrative for type checking.\n    # Consult AWS BCM Recommended Actions documentation for actual operations.\n    print(\"Attempting a dummy client call for type checking demonstration...\")\n    # The BCM Recommended Actions service typically works with specific actions/recommendations.\n    # A simple call might not exist for generic 'list'.\n    # Let's simulate a call that would be type-checked if it existed.\n    # For real use, replace with an actual API method like 'get_recommendations'.\n    # response = client.get_recommendations(RecommendationType='SOME_TYPE') # Example\n    # print(response)\n    print(\"Client successfully initialized with type hints.\")\n    print(f\"Client type: {type(client)}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure 'boto3' is installed and AWS credentials are configured.\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 is no longer supported starting with `mypy-boto3-builder` version 8.12.0. All generated stub packages (including this one) now require Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), corresponding stub package versions"},{"fix":"Review and update custom TypeDef aliases or direct usages to match the new naming conventions if you were relying on the old patterns.","message":"TypeDef naming conventions changed in builder version 8.9.0. TypeDefs for packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). Conflicting TypeDef `Extra` postfixes were also moved.","severity":"breaking","affected_versions":">=8.9.0 (builder), corresponding stub package versions"},{"fix":"Ensure `pip install boto3 mypy-boto3-bcm-recommended-actions` is run.","message":"This package provides *only* type annotations. You must have `boto3` installed alongside `mypy-boto3-bcm-recommended-actions` for your code to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update both `boto3` and its corresponding `mypy-boto3` stub packages. Consider using `pip-tools` or similar to manage dependencies.","message":"To ensure correct type checking, the version of `mypy-boto3-bcm-recommended-actions` should ideally match or be very close to your installed `boto3` version. Significant mismatches can lead to incorrect type hints or missing attributes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always refer to the official `boto3` documentation or `mypy-boto3` examples for the correct service name string for `session.client()`.","message":"The service name used in `boto3.client('SERVICE_NAME')` might differ slightly from the package name. For this service, use `billing-cost-management-recommended-actions` for the client initialization.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}