Skip to content

Examples#

Index > Signer > Examples

Auto-generated documentation for Signer type annotations stubs module mypy-boto3-signer.

Client#

Implicit type annotations#

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

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

# SignerClient usage example

from boto3.session import Session


session = Session()

client = session.client("signer")  # (1)
result = client.add_profile_permission()  # (2)
  1. client: SignerClient
  2. result: AddProfilePermissionResponseTypeDef
# ListSigningJobsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_signing_jobs")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: SignerClient
  2. paginator: ListSigningJobsPaginator
  3. item: ListSigningJobsResponseTypeDef
# SuccessfulSigningJobWaiter usage example

from boto3.session import Session


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

waiter = client.get_waiter("successful_signing_job")  # (2)
waiter.wait()
  1. client: SignerClient
  2. waiter: SuccessfulSigningJobWaiter

Explicit type annotations#

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

# SignerClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_signer.client import SignerClient
from mypy_boto3_signer.type_defs import AddProfilePermissionResponseTypeDef
from mypy_boto3_signer.type_defs import AddProfilePermissionRequestRequestTypeDef


session = Session()

client: SignerClient = session.client("signer")

kwargs: AddProfilePermissionRequestRequestTypeDef = {...}
result: AddProfilePermissionResponseTypeDef = client.add_profile_permission(**kwargs)
# ListSigningJobsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_signer.client import SignerClient
from mypy_boto3_signer.paginator import ListSigningJobsPaginator
from mypy_boto3_signer.type_defs import ListSigningJobsResponseTypeDef


session = Session()
client: SignerClient = session.client("signer")

paginator: ListSigningJobsPaginator = client.get_paginator("list_signing_jobs")
for item in paginator.paginate(...):
    item: ListSigningJobsResponseTypeDef
    print(item)
# SuccessfulSigningJobWaiter usage example with type annotations

from boto3.session import Session

from mypy_boto3_signer.client import SignerClient
from mypy_boto3_signer.waiter import SuccessfulSigningJobWaiter

session = Session()
client: SignerClient = session.client("signer")

waiter: SuccessfulSigningJobWaiter = client.get_waiter("successful_signing_job")
waiter.wait()