Skip to content

Examples#

Index > ACM > Examples

Auto-generated documentation for ACM type annotations stubs module mypy-boto3-acm.

Client#

Implicit type annotations#

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

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

# ACMClient usage example

from boto3.session import Session


session = Session()

client = session.client("acm")  # (1)
result = client.add_tags_to_certificate()  # (2)
  1. client: ACMClient
  2. result: EmptyResponseMetadataTypeDef
# ListCertificatesPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_certificates")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: ACMClient
  2. paginator: ListCertificatesPaginator
  3. item: ListCertificatesResponseTypeDef
# CertificateValidatedWaiter usage example

from boto3.session import Session


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

waiter = client.get_waiter("certificate_validated")  # (2)
waiter.wait()
  1. client: ACMClient
  2. waiter: CertificateValidatedWaiter

Explicit type annotations#

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

# ACMClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_acm.client import ACMClient
from mypy_boto3_acm.type_defs import EmptyResponseMetadataTypeDef
from mypy_boto3_acm.type_defs import AddTagsToCertificateRequestRequestTypeDef


session = Session()

client: ACMClient = session.client("acm")

kwargs: AddTagsToCertificateRequestRequestTypeDef = {...}
result: EmptyResponseMetadataTypeDef = client.add_tags_to_certificate(**kwargs)
# ListCertificatesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_acm.client import ACMClient
from mypy_boto3_acm.paginator import ListCertificatesPaginator
from mypy_boto3_acm.type_defs import ListCertificatesResponseTypeDef


session = Session()
client: ACMClient = session.client("acm")

paginator: ListCertificatesPaginator = client.get_paginator("list_certificates")
for item in paginator.paginate(...):
    item: ListCertificatesResponseTypeDef
    print(item)
# CertificateValidatedWaiter usage example with type annotations

from boto3.session import Session

from mypy_boto3_acm.client import ACMClient
from mypy_boto3_acm.waiter import CertificateValidatedWaiter

session = Session()
client: ACMClient = session.client("acm")

waiter: CertificateValidatedWaiter = client.get_waiter("certificate_validated")
waiter.wait()