Skip to content

Examples

Index > StorageGateway > Examples

Auto-generated documentation for StorageGateway type annotations stubs module types-aiobotocore-storagegateway.

Client

Implicit type annotations

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

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

Client usage example
from aioboto3.session import Session


session = Session()

async with session.client("storagegateway") as client:  # (1)
    result = await client.activate_gateway()  # (2)
  1. client: StorageGatewayClient
  2. result: ActivateGatewayOutputTypeDef
Paginator usage example
from aioboto3.session import Session


session = Session()

async with session.client("storagegateway") as client:  # (1)
    paginator = client.get_paginator("describe_tape_archives")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: StorageGatewayClient
  2. paginator: DescribeTapeArchivesPaginator
  3. item: DescribeTapeArchivesOutputTypeDef

Explicit type annotations

With types-aioboto3-lite[storagegateway] or a standalone types_aiobotocore_storagegateway package, you have to explicitly specify client: StorageGatewayClient 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 usage example
from aioboto3.session import Session

from types_aiobotocore_storagegateway.client import StorageGatewayClient
from types_aiobotocore_storagegateway.type_defs import ActivateGatewayOutputTypeDef
from types_aiobotocore_storagegateway.type_defs import ActivateGatewayInputRequestTypeDef


session = Session()

client: StorageGatewayClient
async with session.client("storagegateway") as client:  # (1)
    kwargs: ActivateGatewayInputRequestTypeDef = {...}  # (2)
    result: ActivateGatewayOutputTypeDef = await client.activate_gateway(**kwargs)  # (3)
  1. client: StorageGatewayClient
  2. kwargs: ActivateGatewayInputRequestTypeDef
  3. result: ActivateGatewayOutputTypeDef
Paginator usage example
from aioboto3.session import Session

from types_aiobotocore_storagegateway.client import StorageGatewayClient
from types_aiobotocore_storagegateway.paginator import DescribeTapeArchivesPaginator
from types_aiobotocore_storagegateway.type_defs import DescribeTapeArchivesOutputTypeDef


session = Session()

client: StorageGatewayClient
async with session.client("storagegateway") as client:  # (1)
    paginator: DescribeTapeArchivesPaginator = client.get_paginator("describe_tape_archives")  # (2)
    async for item in paginator.paginate(...):
        item: DescribeTapeArchivesOutputTypeDef
        print(item)  # (3)
  1. client: StorageGatewayClient
  2. paginator: DescribeTapeArchivesPaginator
  3. item: DescribeTapeArchivesOutputTypeDef