Examples#
Auto-generated documentation for Snowball type annotations stubs module mypy-boto3-snowball.
Client#
Implicit type annotations#
Can be used with boto3-stubs[snowball]
package installed.
Write your Snowball
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# SnowballClient usage example
from boto3.session import Session
session = Session()
client = session.client("snowball") # (1)
result = client.create_address() # (2)
- client: SnowballClient
- result: CreateAddressResultTypeDef
Paginator usage example#
# DescribeAddressesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("snowball") # (1)
paginator = client.get_paginator("describe_addresses") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: SnowballClient
- paginator: DescribeAddressesPaginator
- item: DescribeAddressesResultTypeDef
Explicit type annotations#
With boto3-stubs-lite[snowball]
or a standalone mypy_boto3_snowball
package, you have to explicitly specify client: SnowballClient
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.
Client method usage example#
# SnowballClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_snowball.client import SnowballClient
from mypy_boto3_snowball.type_defs import CreateAddressResultTypeDef
from mypy_boto3_snowball.type_defs import CreateAddressRequestTypeDef
session = Session()
client: SnowballClient = session.client("snowball")
kwargs: CreateAddressRequestTypeDef = {...}
result: CreateAddressResultTypeDef = client.create_address(**kwargs)
Paginator usage example#
# DescribeAddressesPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_snowball.client import SnowballClient
from mypy_boto3_snowball.paginator import DescribeAddressesPaginator
from mypy_boto3_snowball.type_defs import DescribeAddressesResultTypeDef
session = Session()
client: SnowballClient = session.client("snowball")
paginator: DescribeAddressesPaginator = client.get_paginator("describe_addresses")
for item in paginator.paginate(...):
item: DescribeAddressesResultTypeDef
print(item)