Skip to content

Examples#

Index > SSOAdmin > Examples

Auto-generated documentation for SSOAdmin type annotations stubs module types-boto3-sso-admin.

Client#

Implicit type annotations#

Can be used with types-boto3[sso-admin] package installed.

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

# SSOAdminClient usage example

from boto3.session import Session


session = Session()

client = session.client("sso-admin")  # (1)
result = client.create_account_assignment()  # (2)
  1. client: SSOAdminClient
  2. result: CreateAccountAssignmentResponseTypeDef
# ListAccountAssignmentCreationStatusPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("sso-admin")  # (1)

paginator = client.get_paginator("list_account_assignment_creation_status")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: SSOAdminClient
  2. paginator: ListAccountAssignmentCreationStatusPaginator
  3. item: ListAccountAssignmentCreationStatusResponseTypeDef

Explicit type annotations#

With types-boto3-lite[sso-admin] or a standalone types_boto3_sso_admin package, you have to explicitly specify client: SSOAdminClient 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.

# SSOAdminClient usage example with type annotations

from boto3.session import Session

from types_boto3_sso_admin.client import SSOAdminClient
from types_boto3_sso_admin.type_defs import CreateAccountAssignmentResponseTypeDef
from types_boto3_sso_admin.type_defs import CreateAccountAssignmentRequestRequestTypeDef


session = Session()

client: SSOAdminClient = session.client("sso-admin")

kwargs: CreateAccountAssignmentRequestRequestTypeDef = {...}
result: CreateAccountAssignmentResponseTypeDef = client.create_account_assignment(**kwargs)
# ListAccountAssignmentCreationStatusPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_sso_admin.client import SSOAdminClient
from types_boto3_sso_admin.paginator import ListAccountAssignmentCreationStatusPaginator
from types_boto3_sso_admin.type_defs import ListAccountAssignmentCreationStatusResponseTypeDef


session = Session()
client: SSOAdminClient = session.client("sso-admin")

paginator: ListAccountAssignmentCreationStatusPaginator = client.get_paginator("list_account_assignment_creation_status")
for item in paginator.paginate(...):
    item: ListAccountAssignmentCreationStatusResponseTypeDef
    print(item)