Skip to content

Examples#

Index > Support > Examples

Auto-generated documentation for Support type annotations stubs module mypy-boto3-support.

Client#

Implicit type annotations#

Can be used with boto3-stubs[support] package installed.

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

# SupportClient usage example

from boto3.session import Session


session = Session()

client = session.client("support")  # (1)
result = client.add_attachments_to_set()  # (2)
  1. client: SupportClient
  2. result: AddAttachmentsToSetResponseTypeDef
# DescribeCasesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("support")  # (1)

paginator = client.get_paginator("describe_cases")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: SupportClient
  2. paginator: DescribeCasesPaginator
  3. item: DescribeCasesResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[support] or a standalone mypy_boto3_support package, you have to explicitly specify client: SupportClient 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.

# SupportClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_support.client import SupportClient
from mypy_boto3_support.type_defs import AddAttachmentsToSetResponseTypeDef
from mypy_boto3_support.type_defs import AddAttachmentsToSetRequestRequestTypeDef


session = Session()

client: SupportClient = session.client("support")

kwargs: AddAttachmentsToSetRequestRequestTypeDef = {...}
result: AddAttachmentsToSetResponseTypeDef = client.add_attachments_to_set(**kwargs)
# DescribeCasesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_support.client import SupportClient
from mypy_boto3_support.paginator import DescribeCasesPaginator
from mypy_boto3_support.type_defs import DescribeCasesResponseTypeDef


session = Session()
client: SupportClient = session.client("support")

paginator: DescribeCasesPaginator = client.get_paginator("describe_cases")
for item in paginator.paginate(...):
    item: DescribeCasesResponseTypeDef
    print(item)