Examples#
Index > MigrationHubRefactorSpaces > Examples
Auto-generated documentation for MigrationHubRefactorSpaces type annotations stubs module mypy-boto3-migration-hub-refactor-spaces.
Client#
Implicit type annotations#
Can be used with boto3-stubs[migration-hub-refactor-spaces]
package installed.
Write your MigrationHubRefactorSpaces
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# MigrationHubRefactorSpacesClient usage example
from boto3.session import Session
session = Session()
client = session.client("migration-hub-refactor-spaces") # (1)
result = client.create_application() # (2)
- client: MigrationHubRefactorSpacesClient
- result: CreateApplicationResponseTypeDef
Paginator usage example#
# ListApplicationsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("migration-hub-refactor-spaces") # (1)
paginator = client.get_paginator("list_applications") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: MigrationHubRefactorSpacesClient
- paginator: ListApplicationsPaginator
- item: ListApplicationsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[migration-hub-refactor-spaces]
or a standalone mypy_boto3_migration_hub_refactor_spaces
package, you have to explicitly specify client: MigrationHubRefactorSpacesClient
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#
# MigrationHubRefactorSpacesClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_migration_hub_refactor_spaces.client import MigrationHubRefactorSpacesClient
from mypy_boto3_migration_hub_refactor_spaces.type_defs import CreateApplicationResponseTypeDef
from mypy_boto3_migration_hub_refactor_spaces.type_defs import CreateApplicationRequestTypeDef
session = Session()
client: MigrationHubRefactorSpacesClient = session.client("migration-hub-refactor-spaces")
kwargs: CreateApplicationRequestTypeDef = {...}
result: CreateApplicationResponseTypeDef = client.create_application(**kwargs)
Paginator usage example#
# ListApplicationsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_migration_hub_refactor_spaces.client import MigrationHubRefactorSpacesClient
from mypy_boto3_migration_hub_refactor_spaces.paginator import ListApplicationsPaginator
from mypy_boto3_migration_hub_refactor_spaces.type_defs import ListApplicationsResponseTypeDef
session = Session()
client: MigrationHubRefactorSpacesClient = session.client("migration-hub-refactor-spaces")
paginator: ListApplicationsPaginator = client.get_paginator("list_applications")
for item in paginator.paginate(...):
item: ListApplicationsResponseTypeDef
print(item)