{"id":3661,"library":"mypy-boto3-partnercentral-benefits","title":"mypy-boto3-partnercentral-benefits","description":"mypy-boto3-partnercentral-benefits provides comprehensive type annotations for the `boto3` PartnerCentralBenefits service. It enhances development with static type checking and improved autocomplete in IDEs for `boto3` clients, paginators, and specific type definitions. Part of the `mypy-boto3-builder` project, this library is frequently updated to stay synchronized with `boto3` releases. The current version is 1.42.3.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","type-hints","aws","partnercentral-benefits","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-partnercentral-benefits boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python.","package":"boto3"}],"imports":[{"symbol":"PartnerCentralBenefitsClient","correct":"from mypy_boto3_partnercentral_benefits.client import PartnerCentralBenefitsClient"},{"note":"Example for a common TypeDef import. Specific TypeDefs vary by service operation.","symbol":"ListPartnerBenefitsResponseTypeDef","correct":"from mypy_boto3_partnercentral_benefits.type_defs import ListPartnerBenefitsResponseTypeDef"},{"note":"For literal type hints, useful in overloads.","symbol":"PartnerCentralBenefitsServiceName","correct":"from mypy_boto3_partnercentral_benefits.literals import PartnerCentralBenefitsServiceName"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_partnercentral_benefits.client import PartnerCentralBenefitsClient\n\n\ndef get_benefits_summary():\n    # The stubs provide type hints; boto3 itself performs the AWS API calls.\n    client: PartnerCentralBenefitsClient = boto3.client(\n        \"partnercentral-benefits\",\n        region_name=\"us-east-1\",\n        aws_access_key_id=\"test\", # Replace with actual credentials or env vars\n        aws_secret_access_key=\"test\"\n    )\n\n    try:\n        response = client.list_partner_benefits(MaxResults=10)\n        print(\"Successfully listed partner benefits.\")\n        for benefit in response.get(\"PartnerBenefitSummaries\", []):\n            print(f\"- Benefit ID: {benefit.get('BenefitId')}, Status: {benefit.get('Status')}\")\n    except Exception as e:\n        print(f\"Error listing partner benefits: {e}\")\n\n\nif __name__ == \"__main__\":\n    get_benefits_summary()\n","lang":"python","description":"This example demonstrates how to initialize a `PartnerCentralBenefitsClient` with explicit type annotation, enabling static type checking and IDE autocompletion for its methods and arguments. It then calls `list_partner_benefits` to retrieve and print a summary of benefits. Ensure `boto3` is installed alongside `mypy-boto3-partnercentral-benefits`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and later, affecting all generated `mypy-boto3` stub packages. This package (1.42.3) requires Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (mypy-boto3-builder)"},{"fix":"Ensure `mypy` is up-to-date and your build system correctly recognizes PEP 561-compliant `py.typed` packages.","message":"Migration to PEP 561-compliant packages occurred in `mypy-boto3-builder` 8.12.0. While this generally improves type checker discovery, users with highly customized build systems or older `mypy` versions might need to verify compatibility.","severity":"breaking","affected_versions":">=8.12.0 (mypy-boto3-builder)"},{"fix":"Update explicit `TypeDef` imports and references in your code to match the new naming conventions. Refer to the specific service's documentation for exact TypeDef names.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` 8.9.0. This includes shorter names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving 'Extra' postfixes (`CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). Code explicitly importing or referencing these TypeDefs will break.","severity":"breaking","affected_versions":">=8.9.0 (mypy-boto3-builder)"},{"fix":"Always install `boto3` alongside `mypy-boto3-partnercentral-benefits` (e.g., `pip install boto3 mypy-boto3-partnercentral-benefits`).","message":"This package provides only type annotations. `boto3` (the actual AWS SDK for Python) must be installed separately for your code to function at runtime. Ensure `boto3` is installed and its version is compatible with the stubs.","severity":"gotcha","affected_versions":"All"},{"fix":"Consider installing `boto3-stubs-lite[partnercentral-benefits]` if using PyCharm, or configure PyCharm to use an external type checker like `mypy` or `pyright`.","message":"PyCharm users might experience slow performance or high CPU usage due to `Literal` overloads (PyCharm issue PY-40997). The `mypy-boto3` project recommends using `boto3-stubs-lite` packages or disabling PyCharm's type checker and relying on `mypy` or `pyright` instead.","severity":"gotcha","affected_versions":"All, specific to PyCharm IDE"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}