Skip to content

Examples#

Index > AmplifyUIBuilder > Examples

Auto-generated documentation for AmplifyUIBuilder type annotations stubs module mypy-boto3-amplifyuibuilder.

Client#

Implicit type annotations#

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

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

# AmplifyUIBuilderClient usage example

from boto3.session import Session


session = Session()

client = session.client("amplifyuibuilder")  # (1)
result = client.create_component()  # (2)
  1. client: AmplifyUIBuilderClient
  2. result: CreateComponentResponseTypeDef
# ExportComponentsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("export_components")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: AmplifyUIBuilderClient
  2. paginator: ExportComponentsPaginator
  3. item: ExportComponentsResponsePaginatorTypeDef

Explicit type annotations#

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

# AmplifyUIBuilderClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_amplifyuibuilder.client import AmplifyUIBuilderClient
from mypy_boto3_amplifyuibuilder.type_defs import CreateComponentResponseTypeDef
from mypy_boto3_amplifyuibuilder.type_defs import CreateComponentRequestRequestTypeDef


session = Session()

client: AmplifyUIBuilderClient = session.client("amplifyuibuilder")

kwargs: CreateComponentRequestRequestTypeDef = {...}
result: CreateComponentResponseTypeDef = client.create_component(**kwargs)
# ExportComponentsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_amplifyuibuilder.client import AmplifyUIBuilderClient
from mypy_boto3_amplifyuibuilder.paginator import ExportComponentsPaginator
from mypy_boto3_amplifyuibuilder.type_defs import ExportComponentsResponsePaginatorTypeDef


session = Session()
client: AmplifyUIBuilderClient = session.client("amplifyuibuilder")

paginator: ExportComponentsPaginator = client.get_paginator("export_components")
for item in paginator.paginate(...):
    item: ExportComponentsResponsePaginatorTypeDef
    print(item)