{"id":3627,"library":"mypy-boto3-marketplace-reporting","title":"mypy-boto3-marketplace-reporting Type Stubs","description":"Type annotations for boto3's MarketplaceReportingService. This package, part of the `mypy-boto3` ecosystem, provides static type checking for AWS SDK for Python (boto3) clients, resources, and their associated data structures. It helps improve code quality by enabling IDE autocomplete and early error detection for `MarketplaceReportingService` operations. It is regularly updated to match `boto3` releases and requires Python >= 3.9.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type hints","type stubs","boto3","aws","marketplace","reporting","static analysis"],"install":[{"cmd":"pip install mypy-boto3-marketplace-reporting","lang":"bash","label":"Install service-specific stubs"}],"dependencies":[],"imports":[{"note":"Import the typed client for MarketplaceReportingService.","symbol":"MarketplaceReportingClient","correct":"from mypy_boto3_marketplace_reporting.client import MarketplaceReportingClient"},{"note":"Import a specific TypeDef for clearer type annotations on method returns.","symbol":"ListEntitlementsOutputTypeDef","correct":"from mypy_boto3_marketplace_reporting.type_defs import ListEntitlementsOutputTypeDef"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\n\nif TYPE_CHECKING:\n    from mypy_boto3_marketplace_reporting.client import MarketplaceReportingClient\n    from mypy_boto3_marketplace_reporting.type_defs import ListEntitlementsOutputTypeDef\n\ndef get_marketplace_reporting_client() -> 'MarketplaceReportingClient':\n    \"\"\"Gets a typed Marketplace Reporting Service client.\"\"\"\n    # boto3 client creation without type hint (type checkers will infer via stubs)\n    client = boto3.client('marketplace-reporting')\n    return client # type: ignore\n\nclient: MarketplaceReportingClient = get_marketplace_reporting_client()\n\n# Example usage: List entitlements with type-hinted response\n# Replace 'YOUR_PRODUCT_CODE' with an actual AWS Marketplace Product Code\ntry:\n    response: ListEntitlementsOutputTypeDef = client.list_entitlements(\n        ProductCode='YOUR_PRODUCT_CODE',\n        MaxResults=5\n    )\n    print(\"Successfully listed entitlements:\")\n    for entitlement in response.get('Entitlements', []):\n        print(f\"  Entitlement ID: {entitlement.get('EntitlementId')}\")\n    if response.get('NextToken'):\n        print(f\"  NextToken: {response['NextToken']}\")\nexcept client.exceptions.ClientError as e:\n    print(f\"Error listing entitlements: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a `MarketplaceReportingClient` with type annotations. It shows how to use `TYPE_CHECKING` for conditional stub imports, which is common practice to avoid runtime dependencies on stub packages. The example then performs a `list_entitlements` operation, with the response also type-hinted for improved static analysis."},"warnings":[{"fix":"Upgrade to Python 3.9+ or pin `mypy-boto3-marketplace-reporting` to an earlier version compatible with Python 3.8.","message":"Support for Python 3.8 was removed from `mypy-boto3-builder` (version 8.12.0 onwards), impacting all generated `mypy-boto3` stub packages. Projects requiring Python 3.8 should use an older version of `mypy-boto3` stubs or upgrade their Python version.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (impacts mypy-boto3-marketplace-reporting 1.42.3 and newer)"},{"fix":"Update your import paths and TypeDef names to reflect the shorter, standardized conventions. Refer to the specific service's `type_defs` documentation.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` (version 8.9.0), affecting all generated stub packages. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`. Existing code explicitly importing these verbose TypeDef names might break.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder (impacts mypy-boto3-marketplace-reporting 1.42.3 and newer)"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"This package provides only type annotations (`.pyi` files) for `boto3`. It does not include the `boto3` runtime library itself. You must install `boto3` separately to use the AWS SDK functionality at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"As a workaround, set the conditionally imported types to `object` in the `else` branch of the `TYPE_CHECKING` block. Example: `if TYPE_CHECKING: from my_module import MyType else: MyType = object`.","message":"When using `TYPE_CHECKING` for conditional imports (as in the quickstart), Pylint may report `undefined-variable` errors for the conditionally imported types. This is a known issue with Pylint's static analysis.","severity":"gotcha","affected_versions":"All versions when using Pylint with `TYPE_CHECKING` guards"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}