Skip to content

Examples#

Index > EBS > Examples

Auto-generated documentation for EBS type annotations stubs module types-aiobotocore-ebs.

Client#

Implicit type annotations#

Can be used with types-aioboto3[ebs] package installed.

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

# EBSClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("ebs") as client:  # (1)
    result = await client.complete_snapshot()  # (2)
  1. client: EBSClient
  2. result: CompleteSnapshotResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[ebs] or a standalone types_aiobotocore_ebs package, you have to explicitly specify client: EBSClient 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.

# EBSClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_ebs.client import EBSClient
from types_aiobotocore_ebs.type_defs import CompleteSnapshotResponseTypeDef
from types_aiobotocore_ebs.type_defs import CompleteSnapshotRequestRequestTypeDef


session = Session()

client: EBSClient
async with session.client("ebs") as client:  # (1)
    kwargs: CompleteSnapshotRequestRequestTypeDef = {...}  # (2)
    result: CompleteSnapshotResponseTypeDef = await client.complete_snapshot(**kwargs)  # (3)
  1. client: EBSClient
  2. kwargs: CompleteSnapshotRequestRequestTypeDef
  3. result: CompleteSnapshotResponseTypeDef