Skip to content

Examples#

Index > VerifiedPermissions > Examples

Auto-generated documentation for VerifiedPermissions type annotations stubs module mypy-boto3-verifiedpermissions.

Client#

Implicit type annotations#

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

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

# VerifiedPermissionsClient usage example

from boto3.session import Session


session = Session()

client = session.client("verifiedpermissions")  # (1)
result = client.batch_is_authorized()  # (2)
  1. client: VerifiedPermissionsClient
  2. result: BatchIsAuthorizedOutputTypeDef
# ListIdentitySourcesPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_identity_sources")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: VerifiedPermissionsClient
  2. paginator: ListIdentitySourcesPaginator
  3. item: ListIdentitySourcesOutputTypeDef

Explicit type annotations#

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

# VerifiedPermissionsClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_verifiedpermissions.client import VerifiedPermissionsClient
from mypy_boto3_verifiedpermissions.type_defs import BatchIsAuthorizedOutputTypeDef
from mypy_boto3_verifiedpermissions.type_defs import BatchIsAuthorizedInputRequestTypeDef


session = Session()

client: VerifiedPermissionsClient = session.client("verifiedpermissions")

kwargs: BatchIsAuthorizedInputRequestTypeDef = {...}
result: BatchIsAuthorizedOutputTypeDef = client.batch_is_authorized(**kwargs)
# ListIdentitySourcesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_verifiedpermissions.client import VerifiedPermissionsClient
from mypy_boto3_verifiedpermissions.paginator import ListIdentitySourcesPaginator
from mypy_boto3_verifiedpermissions.type_defs import ListIdentitySourcesOutputTypeDef


session = Session()
client: VerifiedPermissionsClient = session.client("verifiedpermissions")

paginator: ListIdentitySourcesPaginator = client.get_paginator("list_identity_sources")
for item in paginator.paginate(...):
    item: ListIdentitySourcesOutputTypeDef
    print(item)