Skip to content

Examples#

Index > PaymentCryptographyControlPlane > Examples

Auto-generated documentation for PaymentCryptographyControlPlane type annotations stubs module mypy-boto3-payment-cryptography.

Client#

Implicit type annotations#

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

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

# PaymentCryptographyControlPlaneClient usage example

from boto3.session import Session


session = Session()

client = session.client("payment-cryptography")  # (1)
result = client.create_alias()  # (2)
  1. client: PaymentCryptographyControlPlaneClient
  2. result: CreateAliasOutputTypeDef
# ListAliasesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("payment-cryptography")  # (1)

paginator = client.get_paginator("list_aliases")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: PaymentCryptographyControlPlaneClient
  2. paginator: ListAliasesPaginator
  3. item: ListAliasesOutputTypeDef

Explicit type annotations#

With boto3-stubs-lite[payment-cryptography] or a standalone mypy_boto3_payment_cryptography package, you have to explicitly specify client: PaymentCryptographyControlPlaneClient 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.

# PaymentCryptographyControlPlaneClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_payment_cryptography.client import PaymentCryptographyControlPlaneClient
from mypy_boto3_payment_cryptography.type_defs import CreateAliasOutputTypeDef
from mypy_boto3_payment_cryptography.type_defs import CreateAliasInputRequestTypeDef


session = Session()

client: PaymentCryptographyControlPlaneClient = session.client("payment-cryptography")

kwargs: CreateAliasInputRequestTypeDef = {...}
result: CreateAliasOutputTypeDef = client.create_alias(**kwargs)
# ListAliasesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_payment_cryptography.client import PaymentCryptographyControlPlaneClient
from mypy_boto3_payment_cryptography.paginator import ListAliasesPaginator
from mypy_boto3_payment_cryptography.type_defs import ListAliasesOutputTypeDef


session = Session()
client: PaymentCryptographyControlPlaneClient = session.client("payment-cryptography")

paginator: ListAliasesPaginator = client.get_paginator("list_aliases")
for item in paginator.paginate(...):
    item: ListAliasesOutputTypeDef
    print(item)