Skip to content

Examples#

Index > AgreementService > Examples

Auto-generated documentation for AgreementService type annotations stubs module mypy-boto3-marketplace-agreement.

Client#

Implicit type annotations#

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

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

Client method usage example#

# AgreementServiceClient usage example

from boto3.session import Session


session = Session()

client = session.client("marketplace-agreement")  # (1)
result = client.cancel_agreement_payment_request()  # (2)
  1. client: AgreementServiceClient
  2. result: CancelAgreementPaymentRequestOutputTypeDef

Paginator usage example#

# ListAgreementPaymentRequestsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("marketplace-agreement")  # (1)

paginator = client.get_paginator("list_agreement_payment_requests")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: AgreementServiceClient
  2. paginator: ListAgreementPaymentRequestsPaginator
  3. item: ListAgreementPaymentRequestsOutputTypeDef

Explicit type annotations#

With boto3-stubs-lite[marketplace-agreement] or a standalone mypy_boto3_marketplace_agreement package, you have to explicitly specify client: AgreementServiceClient 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.

Client method usage example#

# AgreementServiceClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_marketplace_agreement.client import AgreementServiceClient
from mypy_boto3_marketplace_agreement.type_defs import CancelAgreementPaymentRequestOutputTypeDef
from mypy_boto3_marketplace_agreement.type_defs import CancelAgreementPaymentRequestInputTypeDef


session = Session()

client: AgreementServiceClient = session.client("marketplace-agreement")

kwargs: CancelAgreementPaymentRequestInputTypeDef = {...}
result: CancelAgreementPaymentRequestOutputTypeDef = client.cancel_agreement_payment_request(**kwargs)

Paginator usage example#

# ListAgreementPaymentRequestsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_marketplace_agreement.client import AgreementServiceClient
from mypy_boto3_marketplace_agreement.paginator import ListAgreementPaymentRequestsPaginator
from mypy_boto3_marketplace_agreement.type_defs import ListAgreementPaymentRequestsOutputTypeDef


session = Session()
client: AgreementServiceClient = session.client("marketplace-agreement")

paginator: ListAgreementPaymentRequestsPaginator = client.get_paginator("list_agreement_payment_requests")
for item in paginator.paginate(...):
    item: ListAgreementPaymentRequestsOutputTypeDef
    print(item)