Skip to content

Examples#

Index > LicenseManagerUserSubscriptions > Examples

Auto-generated documentation for LicenseManagerUserSubscriptions type annotations stubs module mypy-boto3-license-manager-user-subscriptions.

Client#

Implicit type annotations#

Can be used with boto3-stubs[license-manager-user-subscriptions] package installed.

Write your LicenseManagerUserSubscriptions code as usual, type checking and code completion should work out of the box.

# LicenseManagerUserSubscriptionsClient usage example

from boto3.session import Session


session = Session()

client = session.client("license-manager-user-subscriptions")  # (1)
result = client.associate_user()  # (2)
  1. client: LicenseManagerUserSubscriptionsClient
  2. result: AssociateUserResponseTypeDef
# ListIdentityProvidersPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("license-manager-user-subscriptions")  # (1)

paginator = client.get_paginator("list_identity_providers")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: LicenseManagerUserSubscriptionsClient
  2. paginator: ListIdentityProvidersPaginator
  3. item: ListIdentityProvidersResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[license-manager-user-subscriptions] or a standalone mypy_boto3_license_manager_user_subscriptions package, you have to explicitly specify client: LicenseManagerUserSubscriptionsClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

# LicenseManagerUserSubscriptionsClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_license_manager_user_subscriptions.client import LicenseManagerUserSubscriptionsClient
from mypy_boto3_license_manager_user_subscriptions.type_defs import AssociateUserResponseTypeDef
from mypy_boto3_license_manager_user_subscriptions.type_defs import AssociateUserRequestRequestTypeDef


session = Session()

client: LicenseManagerUserSubscriptionsClient = session.client("license-manager-user-subscriptions")

kwargs: AssociateUserRequestRequestTypeDef = {...}
result: AssociateUserResponseTypeDef = client.associate_user(**kwargs)
# ListIdentityProvidersPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_license_manager_user_subscriptions.client import LicenseManagerUserSubscriptionsClient
from mypy_boto3_license_manager_user_subscriptions.paginator import ListIdentityProvidersPaginator
from mypy_boto3_license_manager_user_subscriptions.type_defs import ListIdentityProvidersResponseTypeDef


session = Session()
client: LicenseManagerUserSubscriptionsClient = session.client("license-manager-user-subscriptions")

paginator: ListIdentityProvidersPaginator = client.get_paginator("list_identity_providers")
for item in paginator.paginate(...):
    item: ListIdentityProvidersResponseTypeDef
    print(item)