Skip to content

Examples#

Index > PartnerCentralSellingAPI > Examples

Auto-generated documentation for PartnerCentralSellingAPI type annotations stubs module mypy-boto3-partnercentral-selling.

Client#

Implicit type annotations#

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

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

# PartnerCentralSellingAPIClient usage example

from boto3.session import Session


session = Session()

client = session.client("partnercentral-selling")  # (1)
result = client.assign_opportunity()  # (2)
  1. client: PartnerCentralSellingAPIClient
  2. result: EmptyResponseMetadataTypeDef
# ListEngagementInvitationsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("partnercentral-selling")  # (1)

paginator = client.get_paginator("list_engagement_invitations")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: PartnerCentralSellingAPIClient
  2. paginator: ListEngagementInvitationsPaginator
  3. item: ListEngagementInvitationsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[partnercentral-selling] or a standalone mypy_boto3_partnercentral_selling package, you have to explicitly specify client: PartnerCentralSellingAPIClient 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.

# PartnerCentralSellingAPIClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_partnercentral_selling.client import PartnerCentralSellingAPIClient
from mypy_boto3_partnercentral_selling.type_defs import EmptyResponseMetadataTypeDef
from mypy_boto3_partnercentral_selling.type_defs import AssignOpportunityRequestRequestTypeDef


session = Session()

client: PartnerCentralSellingAPIClient = session.client("partnercentral-selling")

kwargs: AssignOpportunityRequestRequestTypeDef = {...}
result: EmptyResponseMetadataTypeDef = client.assign_opportunity(**kwargs)
# ListEngagementInvitationsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_partnercentral_selling.client import PartnerCentralSellingAPIClient
from mypy_boto3_partnercentral_selling.paginator import ListEngagementInvitationsPaginator
from mypy_boto3_partnercentral_selling.type_defs import ListEngagementInvitationsResponseTypeDef


session = Session()
client: PartnerCentralSellingAPIClient = session.client("partnercentral-selling")

paginator: ListEngagementInvitationsPaginator = client.get_paginator("list_engagement_invitations")
for item in paginator.paginate(...):
    item: ListEngagementInvitationsResponseTypeDef
    print(item)