Type annotations for boto3 License Manager User Subscriptions

1.42.3 · active · verified Sat Apr 11

mypy-boto3-license-manager-user-subscriptions provides type annotations for the `boto3` LicenseManagerUserSubscriptions service, ensuring static type checking for AWS SDK usage in Python. It is currently at version 1.42.3 and is actively maintained, with releases frequently synchronised with `boto3` updates via the `mypy-boto3-builder`.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the `LicenseManagerUserSubscriptionsClient` for type-hinting `boto3` calls. It shows both implicit and explicit type annotation for the client, and how to correctly use a paginator with type hints. Type checkers like MyPy will use these annotations to validate your code.

import boto3
from mypy_boto3_license_manager_user_subscriptions.client import LicenseManagerUserSubscriptionsClient
from typing import TYPE_CHECKING

# Boto3 client without explicit type annotation (type checkers will infer)
client = boto3.client("license-manager-user-subscriptions")
client.list_user_associations() # type checks correctly

# Boto3 client with explicit type annotation
def get_license_client() -> LicenseManagerUserSubscriptionsClient:
    return boto3.client("license-manager-user-subscriptions")

license_client: LicenseManagerUserSubscriptionsClient = get_license_client()
license_client.list_user_associations(InstanceId='test-instance') # type checks correctly

# Example of using a Paginator (if available for the operation)
if TYPE_CHECKING:
    from mypy_boto3_license_manager_user_subscriptions.paginator import ListUserAssociationsPaginator

    paginator: ListUserAssociationsPaginator = license_client.get_paginator("list_user_associations")
    for page in paginator.paginate():
        print(page.get('InstanceUserSummaries'))

print("mypy-boto3-license-manager-user-subscriptions setup successful!")

view raw JSON →