Skip to content

Examples#

Index > LicenseManagerLinuxSubscriptions > Examples

Auto-generated documentation for LicenseManagerLinuxSubscriptions type annotations stubs module mypy-boto3-license-manager-linux-subscriptions.

Client#

Implicit type annotations#

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

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

# LicenseManagerLinuxSubscriptionsClient usage example

from boto3.session import Session


session = Session()

client = session.client("license-manager-linux-subscriptions")  # (1)
result = client.get_registered_subscription_provider()  # (2)
  1. client: LicenseManagerLinuxSubscriptionsClient
  2. result: GetRegisteredSubscriptionProviderResponseTypeDef
# ListLinuxSubscriptionInstancesPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_linux_subscription_instances")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: LicenseManagerLinuxSubscriptionsClient
  2. paginator: ListLinuxSubscriptionInstancesPaginator
  3. item: ListLinuxSubscriptionInstancesResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[license-manager-linux-subscriptions] or a standalone mypy_boto3_license_manager_linux_subscriptions package, you have to explicitly specify client: LicenseManagerLinuxSubscriptionsClient 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.

# LicenseManagerLinuxSubscriptionsClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_license_manager_linux_subscriptions.client import LicenseManagerLinuxSubscriptionsClient
from mypy_boto3_license_manager_linux_subscriptions.type_defs import GetRegisteredSubscriptionProviderResponseTypeDef
from mypy_boto3_license_manager_linux_subscriptions.type_defs import GetRegisteredSubscriptionProviderRequestRequestTypeDef


session = Session()

client: LicenseManagerLinuxSubscriptionsClient = session.client("license-manager-linux-subscriptions")

kwargs: GetRegisteredSubscriptionProviderRequestRequestTypeDef = {...}
result: GetRegisteredSubscriptionProviderResponseTypeDef = client.get_registered_subscription_provider(**kwargs)
# ListLinuxSubscriptionInstancesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_license_manager_linux_subscriptions.client import LicenseManagerLinuxSubscriptionsClient
from mypy_boto3_license_manager_linux_subscriptions.paginator import ListLinuxSubscriptionInstancesPaginator
from mypy_boto3_license_manager_linux_subscriptions.type_defs import ListLinuxSubscriptionInstancesResponseTypeDef


session = Session()
client: LicenseManagerLinuxSubscriptionsClient = session.client("license-manager-linux-subscriptions")

paginator: ListLinuxSubscriptionInstancesPaginator = client.get_paginator("list_linux_subscription_instances")
for item in paginator.paginate(...):
    item: ListLinuxSubscriptionInstancesResponseTypeDef
    print(item)