Skip to content

Examples#

Index > IdentityStore > Examples

Auto-generated documentation for IdentityStore type annotations stubs module mypy-boto3-identitystore.

Client#

Implicit type annotations#

Can be used with boto3-stubs[identitystore] package installed.

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

# IdentityStoreClient usage example

from boto3.session import Session


session = Session()

client = session.client("identitystore")  # (1)
result = client.create_group()  # (2)
  1. client: IdentityStoreClient
  2. result: CreateGroupResponseTypeDef
# ListGroupMembershipsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("identitystore")  # (1)

paginator = client.get_paginator("list_group_memberships")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: IdentityStoreClient
  2. paginator: ListGroupMembershipsPaginator
  3. item: ListGroupMembershipsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[identitystore] or a standalone mypy_boto3_identitystore package, you have to explicitly specify client: IdentityStoreClient 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.

# IdentityStoreClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_identitystore.client import IdentityStoreClient
from mypy_boto3_identitystore.type_defs import CreateGroupResponseTypeDef
from mypy_boto3_identitystore.type_defs import CreateGroupRequestRequestTypeDef


session = Session()

client: IdentityStoreClient = session.client("identitystore")

kwargs: CreateGroupRequestRequestTypeDef = {...}
result: CreateGroupResponseTypeDef = client.create_group(**kwargs)
# ListGroupMembershipsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_identitystore.client import IdentityStoreClient
from mypy_boto3_identitystore.paginator import ListGroupMembershipsPaginator
from mypy_boto3_identitystore.type_defs import ListGroupMembershipsResponseTypeDef


session = Session()
client: IdentityStoreClient = session.client("identitystore")

paginator: ListGroupMembershipsPaginator = client.get_paginator("list_group_memberships")
for item in paginator.paginate(...):
    item: ListGroupMembershipsResponseTypeDef
    print(item)