Skip to content

Examples#

Index > EVS > Examples

Auto-generated documentation for EVS type annotations stubs module mypy-boto3-evs.

Client#

Implicit type annotations#

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

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

Client method usage example#

# EVSClient usage example

from boto3.session import Session


session = Session()

client = session.client("evs")  # (1)
result = client.create_environment()  # (2)
  1. client: EVSClient
  2. result: CreateEnvironmentResponseTypeDef

Paginator usage example#

# ListEnvironmentHostsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_environment_hosts")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: EVSClient
  2. paginator: ListEnvironmentHostsPaginator
  3. item: ListEnvironmentHostsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[evs] or a standalone mypy_boto3_evs package, you have to explicitly specify client: EVSClient 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#

# EVSClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_evs.client import EVSClient
from mypy_boto3_evs.type_defs import CreateEnvironmentResponseTypeDef
from mypy_boto3_evs.type_defs import CreateEnvironmentRequestTypeDef


session = Session()

client: EVSClient = session.client("evs")

kwargs: CreateEnvironmentRequestTypeDef = {...}
result: CreateEnvironmentResponseTypeDef = client.create_environment(**kwargs)

Paginator usage example#

# ListEnvironmentHostsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_evs.client import EVSClient
from mypy_boto3_evs.paginator import ListEnvironmentHostsPaginator
from mypy_boto3_evs.type_defs import ListEnvironmentHostsResponseTypeDef


session = Session()
client: EVSClient = session.client("evs")

paginator: ListEnvironmentHostsPaginator = client.get_paginator("list_environment_hosts")
for item in paginator.paginate(...):
    item: ListEnvironmentHostsResponseTypeDef
    print(item)