Skip to content

Examples

Index > IAMRolesAnywhere > Examples

Auto-generated documentation for IAMRolesAnywhere type annotations stubs module types-aiobotocore-rolesanywhere.

Client

Implicit type annotations

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

Write your IAMRolesAnywhere 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("rolesanywhere") as client:  # (1)
    result = await client.create_profile()  # (2)
  1. client: IAMRolesAnywhereClient
  2. result: ProfileDetailResponseTypeDef
Paginator usage example
from aioboto3.session import Session


session = Session()

async with session.client("rolesanywhere") as client:  # (1)
    paginator = client.get_paginator("list_crls")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: IAMRolesAnywhereClient
  2. paginator: ListCrlsPaginator
  3. item: ListCrlsResponseTypeDef

Explicit type annotations

With types-aioboto3-lite[rolesanywhere] or a standalone types_aiobotocore_rolesanywhere package, you have to explicitly specify client: IAMRolesAnywhereClient 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_rolesanywhere.client import IAMRolesAnywhereClient
from types_aiobotocore_rolesanywhere.type_defs import ProfileDetailResponseTypeDef
from types_aiobotocore_rolesanywhere.type_defs import CreateProfileRequestRequestTypeDef


session = Session()

client: IAMRolesAnywhereClient
async with session.client("rolesanywhere") as client:  # (1)
    kwargs: CreateProfileRequestRequestTypeDef = {...}  # (2)
    result: ProfileDetailResponseTypeDef = await client.create_profile(**kwargs)  # (3)
  1. client: IAMRolesAnywhereClient
  2. kwargs: CreateProfileRequestRequestTypeDef
  3. result: ProfileDetailResponseTypeDef
Paginator usage example
from aioboto3.session import Session

from types_aiobotocore_rolesanywhere.client import IAMRolesAnywhereClient
from types_aiobotocore_rolesanywhere.paginator import ListCrlsPaginator
from types_aiobotocore_rolesanywhere.type_defs import ListCrlsResponseTypeDef


session = Session()

client: IAMRolesAnywhereClient
async with session.client("rolesanywhere") as client:  # (1)
    paginator: ListCrlsPaginator = client.get_paginator("list_crls")  # (2)
    async for item in paginator.paginate(...):
        item: ListCrlsResponseTypeDef
        print(item)  # (3)
  1. client: IAMRolesAnywhereClient
  2. paginator: ListCrlsPaginator
  3. item: ListCrlsResponseTypeDef