mypy-boto3-partnercentral-account Type Stubs

1.42.79 · active · verified Sat Apr 11

This package provides type annotations for the `boto3` PartnerCentralAccountAPI service, generated by `mypy-boto3-builder`. It enables static type checking with tools like MyPy, Pyright, and enhances IDE auto-completion for `boto3` clients and resources. The `mypy-boto3` ecosystem receives frequent updates, typically aligning with new `boto3` and `botocore` releases.

Warnings

Install

Imports

Quickstart

Demonstrates how to initialize a type-hinted `PartnerCentralAccountClient` and make a basic API call. This example uses `get_alliance_lead_contact`, which may require specific AWS permissions or an existing setup in AWS Partner Central.

import boto3
from typing import TYPE_CHECKING
import os

if TYPE_CHECKING:
    from mypy_boto3_partnercentral_account.client import PartnerCentralAccountClient
    # Optionally import other types like paginators, waiters, or TypeDefs
    # from mypy_boto3_partnercentral_account.type_defs import CreatePartnerRequestRequestTypeDef

def get_partnercentral_account_client() -> "PartnerCentralAccountClient":
    """Returns a type-hinted PartnerCentralAccount client."""
    # Ensure AWS credentials are set via environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
    # or other boto3 configuration methods.
    return boto3.client(
        "partnercentral-account",
        region_name=os.environ.get("AWS_REGION", "us-east-1")
    )

client = get_partnercentral_account_client()

# Example usage: Replace with an actual API call relevant to your use case.
# get_alliance_lead_contact is used here as a simple example that doesn't require complex input.
try:
    # This call might require specific permissions or existing resources in your AWS account.
    response = client.get_alliance_lead_contact()
    print("Successfully called get_alliance_lead_contact (example API call).")
    if response:
        print(f"Response keys: {list(response.keys())}")
except Exception as e:
    print(f"An error occurred: {e}")
    print("Ensure AWS credentials are configured and you have permissions for partnercentral-account:GetAllianceLeadContact.")

view raw JSON →