Examples#
Auto-generated documentation for ACMPCA type annotations stubs module types-boto3-acm-pca.
Client#
Implicit type annotations#
Can be used with types-boto3[acm-pca]
package installed.
Write your ACMPCA
code as usual,
type checking and code completion should work out of the box.
# ACMPCAClient usage example
from boto3.session import Session
session = Session()
client = session.client("acm-pca") # (1)
result = client.create_certificate_authority() # (2)
- client: ACMPCAClient
- result: CreateCertificateAuthorityResponseTypeDef
# ListCertificateAuthoritiesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("acm-pca") # (1)
paginator = client.get_paginator("list_certificate_authorities") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: ACMPCAClient
- paginator: ListCertificateAuthoritiesPaginator
- item: ListCertificateAuthoritiesResponseTypeDef
# AuditReportCreatedWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("acm-pca") # (1)
waiter = client.get_waiter("audit_report_created") # (2)
waiter.wait()
- client: ACMPCAClient
- waiter: AuditReportCreatedWaiter
Explicit type annotations#
With types-boto3-lite[acm-pca]
or a standalone types_boto3_acm_pca
package, you have to explicitly specify client: ACMPCAClient
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.
# ACMPCAClient usage example with type annotations
from boto3.session import Session
from types_boto3_acm_pca.client import ACMPCAClient
from types_boto3_acm_pca.type_defs import CreateCertificateAuthorityResponseTypeDef
from types_boto3_acm_pca.type_defs import CreateCertificateAuthorityRequestRequestTypeDef
session = Session()
client: ACMPCAClient = session.client("acm-pca")
kwargs: CreateCertificateAuthorityRequestRequestTypeDef = {...}
result: CreateCertificateAuthorityResponseTypeDef = client.create_certificate_authority(**kwargs)
# ListCertificateAuthoritiesPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_acm_pca.client import ACMPCAClient
from types_boto3_acm_pca.paginator import ListCertificateAuthoritiesPaginator
from types_boto3_acm_pca.type_defs import ListCertificateAuthoritiesResponseTypeDef
session = Session()
client: ACMPCAClient = session.client("acm-pca")
paginator: ListCertificateAuthoritiesPaginator = client.get_paginator("list_certificate_authorities")
for item in paginator.paginate(...):
item: ListCertificateAuthoritiesResponseTypeDef
print(item)
# AuditReportCreatedWaiter usage example with type annotations
from boto3.session import Session
from types_boto3_acm_pca.client import ACMPCAClient
from types_boto3_acm_pca.waiter import AuditReportCreatedWaiter
session = Session()
client: ACMPCAClient = session.client("acm-pca")
waiter: AuditReportCreatedWaiter = client.get_waiter("audit_report_created")
waiter.wait()