Skip to content

create_channel_handshake async

create_channel_handshake(
    handshake_type: HandshakeType,
    catalog: Catalog,
    associated_resource_identifier: AssociatedResourceIdentifier,
    *,
    config_overrides: Optional[AsyncPartnerCentralChannelClientConfig] = None,
    payload: Optional[ChannelHandshakePayload] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagList] = None,
) -> CreateChannelHandshakeResponse

Creates a new channel handshake request to establish a partnership with another AWS account.

Parameters:

  • handshake_type (HandshakeType) –

    The type of handshake to create (e.g., start service period, revoke service period).

  • catalog (Catalog) –

    The catalog identifier for the handshake request.

  • associated_resource_identifier (AssociatedResourceIdentifier) –

    The identifier of the resource associated with this handshake.

  • payload (Optional[ChannelHandshakePayload], default: None ) –

    The payload containing specific details for the handshake type.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure idempotency of the request.

  • tags (Optional[TagList], default: None ) –

    Key-value pairs to associate with the channel handshake.

Raises:

Examples:

Example for CreateChannelHandshake - START_SERVICE_PERIOD with Minimum Notice Period

>>> await client.create_channel_handshake(handshake_type='START_SERVICE_PERIOD', catalog='AWS', associated_resource_identifier='rs-abc123def456g', payload={'startServicePeriodPayload': {'programManagementAccountIdentifier': 'pma-abcdef123456g', 'servicePeriodType': 'MINIMUM_NOTICE_PERIOD', 'minimumNoticeDays': '14', 'note': 'Optional Note'}}, client_token='clientToken')
Example for CreateChannelHandshake - START_SERVICE_PERIOD with Fixed Commitment Period
>>> await client.create_channel_handshake(handshake_type='START_SERVICE_PERIOD', catalog='AWS', associated_resource_identifier='rs-abc123def456g', payload={'startServicePeriodPayload': {'programManagementAccountIdentifier': 'pma-abcdef123456g', 'servicePeriodType': 'FIXED_COMMITMENT_PERIOD', 'endDate': '2026-07-01T00:00:00Z', 'note': 'Optional Note'}}, client_token='clientToken')
Example for CreateChannelHandshake - REVOKE_SERVICE_PERIOD
>>> await client.create_channel_handshake(handshake_type='REVOKE_SERVICE_PERIOD', catalog='AWS', associated_resource_identifier='rs-abc123def456g', payload={'revokeServicePeriodPayload': {'programManagementAccountIdentifier': 'pma-abcdef123456g', 'note': 'Optional Note'}}, client_token='clientToken')
Example for CreateChannelHandshake - PROGRAM_MANAGEMENT_ACCOUNT
>>> await client.create_channel_handshake(handshake_type='PROGRAM_MANAGEMENT_ACCOUNT', catalog='AWS', associated_resource_identifier='pma-123abc456def7', client_token='clientToken')
Source code in docs_src/capo_partnercentral_channel/_services/async_partner_central_channel.py
async def create_channel_handshake(
    self,
    handshake_type: "capo_partnercentral_channel.types.handshake_type.HandshakeType",
    catalog: "capo_partnercentral_channel.types.catalog.Catalog",
    associated_resource_identifier: "capo_partnercentral_channel.types.associated_resource_identifier.AssociatedResourceIdentifier",
    *,
    config_overrides: Optional[AsyncPartnerCentralChannelClientConfig] = None,
    payload: Optional[
        "capo_partnercentral_channel.types.channel_handshake_payload.ChannelHandshakePayload"
    ] = None,
    client_token: Optional[
        "capo_partnercentral_channel.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_partnercentral_channel.types.tag_list.TagList"] = None,
) -> "capo_partnercentral_channel.types.create_channel_handshake_response.CreateChannelHandshakeResponse":
    """<p>Creates a new channel handshake request to establish a partnership with another AWS account.</p>

    Args:
        handshake_type: <p>The type of handshake to create (e.g., start service period, revoke service period).</p>
        catalog: <p>The catalog identifier for the handshake request.</p>
        associated_resource_identifier: <p>The identifier of the resource associated with this handshake.</p>
        payload: <p>The payload containing specific details for the handshake type.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
        tags: <p>Key-value pairs to associate with the channel handshake.</p>

    Raises:
        capo_partnercentral_channel.errors.access_denied_exception.AccessDeniedException: <p>The request was denied due to insufficient permissions.</p>
        capo_partnercentral_channel.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred while processing the request.</p>
        capo_partnercentral_channel.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_partnercentral_channel.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests being sent in a short period.</p>
        capo_partnercentral_channel.errors.validation_exception.ValidationException: <p>The request failed validation due to invalid input parameters.</p>
        capo_partnercentral_channel.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_partnercentral_channel.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota limit.</p>
        capo_partnercentral_channel.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Example for CreateChannelHandshake - START_SERVICE_PERIOD with Minimum Notice Period

        >>> await client.create_channel_handshake(handshake_type='START_SERVICE_PERIOD', catalog='AWS', associated_resource_identifier='rs-abc123def456g', payload={'startServicePeriodPayload': {'programManagementAccountIdentifier': 'pma-abcdef123456g', 'servicePeriodType': 'MINIMUM_NOTICE_PERIOD', 'minimumNoticeDays': '14', 'note': 'Optional Note'}}, client_token='clientToken')
        Example for CreateChannelHandshake - START_SERVICE_PERIOD with Fixed Commitment Period

        >>> await client.create_channel_handshake(handshake_type='START_SERVICE_PERIOD', catalog='AWS', associated_resource_identifier='rs-abc123def456g', payload={'startServicePeriodPayload': {'programManagementAccountIdentifier': 'pma-abcdef123456g', 'servicePeriodType': 'FIXED_COMMITMENT_PERIOD', 'endDate': '2026-07-01T00:00:00Z', 'note': 'Optional Note'}}, client_token='clientToken')
        Example for CreateChannelHandshake - REVOKE_SERVICE_PERIOD

        >>> await client.create_channel_handshake(handshake_type='REVOKE_SERVICE_PERIOD', catalog='AWS', associated_resource_identifier='rs-abc123def456g', payload={'revokeServicePeriodPayload': {'programManagementAccountIdentifier': 'pma-abcdef123456g', 'note': 'Optional Note'}}, client_token='clientToken')
        Example for CreateChannelHandshake - PROGRAM_MANAGEMENT_ACCOUNT

        >>> await client.create_channel_handshake(handshake_type='PROGRAM_MANAGEMENT_ACCOUNT', catalog='AWS', associated_resource_identifier='pma-123abc456def7', client_token='clientToken')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_partnercentral_channel.types.create_channel_handshake_request.CreateChannelHandshakeRequest]",
    ) -> AsyncOperationResponse[
        "capo_partnercentral_channel.types.create_channel_handshake_response.CreateChannelHandshakeResponse"
    ]:
        import capo_partnercentral_channel._operations.partner_central_channel.create_channel_handshake

        (
            output,
            http_response,
        ) = await capo_partnercentral_channel._operations.partner_central_channel.create_channel_handshake.async_create_channel_handshake(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateChannelHandshake")
    )
    input_: capo_partnercentral_channel.types.create_channel_handshake_request.CreateChannelHandshakeRequest = {
        "handshake_type": handshake_type,
        "catalog": catalog,
        "associated_resource_identifier": associated_resource_identifier,
    }
    if payload is not None:
        input_["payload"] = payload
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output