Examples
Auto-generated documentation for SSO type annotations stubs module types-aiobotocore-sso.
Client
Implicit type annotations
Can be used with types-aioboto3[sso]
package installed.
Write your SSO
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("sso") as client: # (1)
result = await client.get_role_credentials() # (2)
- client: SSOClient
- result: GetRoleCredentialsResponseTypeDef
Paginator usage example
from aioboto3.session import Session
session = Session()
async with session.client("sso") as client: # (1)
paginator = client.get_paginator("list_account_roles") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: SSOClient
- paginator: ListAccountRolesPaginator
- item: ListAccountRolesResponseTypeDef
Explicit type annotations
With types-aioboto3-lite[sso]
or a standalone types_aiobotocore_sso
package, you have to explicitly specify
client: SSOClient
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_sso.client import SSOClient
from types_aiobotocore_sso.type_defs import GetRoleCredentialsResponseTypeDef
from types_aiobotocore_sso.type_defs import GetRoleCredentialsRequestRequestTypeDef
session = Session()
client: SSOClient
async with session.client("sso") as client: # (1)
kwargs: GetRoleCredentialsRequestRequestTypeDef = {...} # (2)
result: GetRoleCredentialsResponseTypeDef = await client.get_role_credentials(**kwargs) # (3)
- client: SSOClient
- kwargs: GetRoleCredentialsRequestRequestTypeDef
- result: GetRoleCredentialsResponseTypeDef
Paginator usage example
from aioboto3.session import Session
from types_aiobotocore_sso.client import SSOClient
from types_aiobotocore_sso.paginator import ListAccountRolesPaginator
from types_aiobotocore_sso.type_defs import ListAccountRolesResponseTypeDef
session = Session()
client: SSOClient
async with session.client("sso") as client: # (1)
paginator: ListAccountRolesPaginator = client.get_paginator("list_account_roles") # (2)
async for item in paginator.paginate(...):
item: ListAccountRolesResponseTypeDef
print(item) # (3)
- client: SSOClient
- paginator: ListAccountRolesPaginator
- item: ListAccountRolesResponseTypeDef