{"id":3624,"library":"mypy-boto3-marketplace-agreement","title":"mypy-boto3-marketplace-agreement: Type Stubs for AWS Marketplace Agreement Service","description":"mypy-boto3-marketplace-agreement provides a comprehensive set of type annotations for the AWS Marketplace Agreement Service client in boto3. This library is part of the `mypy-boto3-builder` ecosystem, which generates type stubs for all boto3 services, enhancing static type checking capabilities for AWS SDK users. The project actively maintains and updates its stubs, with version 1.42.80 reflecting the latest boto3 API for AgreementService and aligning with `mypy-boto3-builder` version 8.12.0. Releases are frequent, following boto3 updates and builder enhancements.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","marketplace-agreement","aws-marketplace"],"install":[{"cmd":"pip install mypy-boto3-marketplace-agreement boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed to use the AWS SDK functionality.","package":"boto3","optional":false},{"reason":"mypy is the primary static type checker that leverages these stubs.","package":"mypy","optional":true}],"imports":[{"symbol":"AgreementServiceClient","correct":"from mypy_boto3_marketplace_agreement.client import AgreementServiceClient"},{"note":"A general builder change in 8.9.0 introduced naming conventions that might alter expected TypedDict names by adding or removing 'Request' or 'Output' suffixes or other qualifiers based on context and potential conflicts. Always check the generated `type_defs.pyi` for exact names.","wrong":"from mypy_boto3_marketplace_agreement.type_defs import AcceptAgreementRequestTypeDef","symbol":"AcceptAgreementRequestRequestTypeDef","correct":"from mypy_boto3_marketplace_agreement.type_defs import AcceptAgreementRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_marketplace_agreement.client import AgreementServiceClient\nfrom mypy_boto3_marketplace_agreement.type_defs import AcceptAgreementOutputTypeDef, AcceptAgreementRequestRequestTypeDef\nimport os\n\ndef get_agreement_client() -> AgreementServiceClient:\n    \"\"\"Returns a type-hinted boto3 AgreementService client.\"\"\"\n    # Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n    # For local testing, you might mock this or ensure your environment has AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, etc.\n    return boto3.client(\"marketplace-agreement\")\n\ndef accept_agreement(agreement_id: str) -> AcceptAgreementOutputTypeDef:\n    \"\"\"Accepts a Marketplace agreement using the type-hinted client.\"\"\"\n    client: AgreementServiceClient = get_agreement_client()\n    \n    # Example request payload, adjust as per actual API requirements\n    request_payload: AcceptAgreementRequestRequestTypeDef = {\n        \"agreementId\": agreement_id\n    }\n    \n    response: AcceptAgreementOutputTypeDef = client.accept_agreement(**request_payload)\n    print(f\"Agreement accepted: {response.get('agreementId')}\")\n    return response\n\nif __name__ == \"__main__\":\n    # Replace with a real agreement ID for actual testing\n    test_agreement_id = os.environ.get('MARKETPLACE_AGREEMENT_ID', 'ag-xxxxxxxxxxxxxxxxx') \n    if test_agreement_id == 'ag-xxxxxxxxxxxxxxxxx':\n        print(\"Please set the MARKETPLACE_AGREEMENT_ID environment variable for a real test.\")\n        print(\"Using a placeholder ID.\")\n\n    try:\n        # This call will require valid AWS credentials and a real agreement ID to succeed.\n        # If credentials are not configured or ID is invalid, it will raise a boto3 exception.\n        accept_agreement(test_agreement_id)\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        print(\"Ensure 'boto3' is installed and AWS credentials are configured correctly.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a type-hinted `AgreementServiceClient` and use it to call an API operation, such as `accept_agreement`. It highlights the correct import paths for both the client and its associated type definitions, which are essential for leveraging static type checking with `mypy-boto3` stubs."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Support for Python 3.8 has been removed across all `mypy-boto3` packages. Projects targeting `mypy-boto3` builder versions 8.12.0 and above must use Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder version), affects all generated stub packages"},{"fix":"Review your explicit `TypeDef` imports and usage. Refer to the `type_defs.pyi` file within the specific `mypy-boto3-` service package for the correct, updated type names.","message":"Type definition names (`TypeDef`s) generated by `mypy-boto3-builder` might have changed for some services to use shorter names or resolve conflicts. For instance, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`. This could affect code directly importing or referencing these generated type names.","severity":"breaking","affected_versions":">=8.9.0 (builder version), affects all generated stub packages"},{"fix":"Always install `boto3` alongside `mypy-boto3-marketplace-agreement`: `pip install boto3 mypy-boto3-marketplace-agreement`.","message":"The `mypy-boto3-marketplace-agreement` package provides *only* type stubs. You must explicitly install `boto3` (or `aioboto3` for async clients) to have the actual AWS SDK functionality at runtime. The stub package does not pull `boto3` as a runtime dependency.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your `mypy` configuration is up-to-date and correctly identifies installed `py.typed` packages. In most cases, `mypy` will find them automatically, but complex setups might require verifying `MYPYPATH` or other stub path configurations.","message":"As of `mypy-boto3-builder` 8.12.0, all packages have migrated to PEP 561, becoming `py.typed` packages. While this is a standard and generally beneficial change, older `mypy` configurations or tools that rely on specific `MYPYPATH` setups might need adjustments to correctly locate the stubs.","severity":"gotcha","affected_versions":">=8.12.0 (builder version), affects all generated stub packages"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}