Skip to content

Examples#

Index > LaunchWizard > Examples

Auto-generated documentation for LaunchWizard type annotations stubs module mypy-boto3-launch-wizard.

Client#

Implicit type annotations#

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

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

Client method usage example#

# LaunchWizardClient usage example

from boto3.session import Session


session = Session()

client = session.client("launch-wizard")  # (1)
result = client.create_deployment()  # (2)
  1. client: LaunchWizardClient
  2. result: CreateDeploymentOutputTypeDef

Paginator usage example#

# ListDeploymentEventsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("launch-wizard")  # (1)

paginator = client.get_paginator("list_deployment_events")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: LaunchWizardClient
  2. paginator: ListDeploymentEventsPaginator
  3. item: ListDeploymentEventsOutputTypeDef

Explicit type annotations#

With boto3-stubs-lite[launch-wizard] or a standalone mypy_boto3_launch_wizard package, you have to explicitly specify client: LaunchWizardClient 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#

# LaunchWizardClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_launch_wizard.client import LaunchWizardClient
from mypy_boto3_launch_wizard.type_defs import CreateDeploymentOutputTypeDef
from mypy_boto3_launch_wizard.type_defs import CreateDeploymentInputTypeDef


session = Session()

client: LaunchWizardClient = session.client("launch-wizard")

kwargs: CreateDeploymentInputTypeDef = {...}
result: CreateDeploymentOutputTypeDef = client.create_deployment(**kwargs)

Paginator usage example#

# ListDeploymentEventsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_launch_wizard.client import LaunchWizardClient
from mypy_boto3_launch_wizard.paginator import ListDeploymentEventsPaginator
from mypy_boto3_launch_wizard.type_defs import ListDeploymentEventsOutputTypeDef


session = Session()
client: LaunchWizardClient = session.client("launch-wizard")

paginator: ListDeploymentEventsPaginator = client.get_paginator("list_deployment_events")
for item in paginator.paginate(...):
    item: ListDeploymentEventsOutputTypeDef
    print(item)