Examples#
Auto-generated documentation for AppFabric type annotations stubs module mypy-boto3-appfabric.
Client#
Implicit type annotations#
Can be used with boto3-stubs[appfabric]
package installed.
Write your AppFabric
code as usual,
type checking and code completion should work out of the box.
# AppFabricClient usage example
from boto3.session import Session
session = Session()
client = session.client("appfabric") # (1)
result = client.batch_get_user_access_tasks() # (2)
- client: AppFabricClient
- result: BatchGetUserAccessTasksResponseTypeDef
# ListAppAuthorizationsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("appfabric") # (1)
paginator = client.get_paginator("list_app_authorizations") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: AppFabricClient
- paginator: ListAppAuthorizationsPaginator
- item: ListAppAuthorizationsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[appfabric]
or a standalone mypy_boto3_appfabric
package, you have to explicitly specify client: AppFabricClient
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.
# AppFabricClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_appfabric.client import AppFabricClient
from mypy_boto3_appfabric.type_defs import BatchGetUserAccessTasksResponseTypeDef
from mypy_boto3_appfabric.type_defs import BatchGetUserAccessTasksRequestRequestTypeDef
session = Session()
client: AppFabricClient = session.client("appfabric")
kwargs: BatchGetUserAccessTasksRequestRequestTypeDef = {...}
result: BatchGetUserAccessTasksResponseTypeDef = client.batch_get_user_access_tasks(**kwargs)
# ListAppAuthorizationsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_appfabric.client import AppFabricClient
from mypy_boto3_appfabric.paginator import ListAppAuthorizationsPaginator
from mypy_boto3_appfabric.type_defs import ListAppAuthorizationsResponseTypeDef
session = Session()
client: AppFabricClient = session.client("appfabric")
paginator: ListAppAuthorizationsPaginator = client.get_paginator("list_app_authorizations")
for item in paginator.paginate(...):
item: ListAppAuthorizationsResponseTypeDef
print(item)