Examples#
Auto-generated documentation for Transfer type annotations stubs module mypy-boto3-transfer.
Client#
Implicit type annotations#
Can be used with boto3-stubs[transfer]
package installed.
Write your Transfer
code as usual,
type checking and code completion should work out of the box.
# TransferClient usage example
from boto3.session import Session
session = Session()
client = session.client("transfer") # (1)
result = client.create_access() # (2)
- client: TransferClient
- result: CreateAccessResponseTypeDef
# ListAccessesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("transfer") # (1)
paginator = client.get_paginator("list_accesses") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: TransferClient
- paginator: ListAccessesPaginator
- item: ListAccessesResponseTypeDef
# ServerOfflineWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("transfer") # (1)
waiter = client.get_waiter("server_offline") # (2)
waiter.wait()
- client: TransferClient
- waiter: ServerOfflineWaiter
Explicit type annotations#
With boto3-stubs-lite[transfer]
or a standalone mypy_boto3_transfer
package, you have to explicitly specify client: TransferClient
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.