Skip to content

create_channel_contract

create_channel_contract(
    contract_type: ChannelContractType,
    catalog: Catalog,
    payload: ChannelContractPayload,
    *,
    config_overrides: Optional[PartnerCentralChannelClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagList] = None,
) -> CreateChannelContractResponse

Creates a new channel contract and sends it to the signatory for signature. In the Sandbox catalog, the channel contract is accepted automatically.

Parameters:

  • contract_type (ChannelContractType) –

    The type of channel contract to create (for example, managed services attestation).

  • catalog (Catalog) –

    The catalog identifier for the channel contract.

  • payload (ChannelContractPayload) –

    The payload containing specific details for the contract 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 contract.

Raises:

Examples:

Example for CreateChannelContract - MANAGED_SERVICES_ATTESTATION

>>> client.create_channel_contract(contract_type='MANAGED_SERVICES_ATTESTATION', catalog='AWS', payload={'managedServicesAttestationPayload': {'legalEntityName': 'Example Partner Corp', 'signatoryName': 'Mary Major', 'signatoryEmail': '[email protected]', 'programManagementAccountIdentifier': 'pma-abcdef123456g', 'relationshipIdentifier': 'rs-abc123def456g', 'endDate': '2027-03-31T00:00:00Z', 'supportedServices': ['MONITORING', 'SECURITY'], 'memberAccountIds': ['111122224444'], 'legalEntityAddress': {'addressLine': '123 Any Street', 'addressLine2': 'Suite 100', 'city': 'Anytown', 'stateOrRegion': 'WA', 'postalCode': '98101', 'countryCode': 'US'}}}, client_token='clientToken')
Source code in docs_src/capo_partnercentral_channel/_services/partner_central_channel.py
def create_channel_contract(
    self,
    contract_type: "capo_partnercentral_channel.types.channel_contract_type.ChannelContractType",
    catalog: "capo_partnercentral_channel.types.catalog.Catalog",
    payload: "capo_partnercentral_channel.types.channel_contract_payload.ChannelContractPayload",
    *,
    config_overrides: Optional[PartnerCentralChannelClientConfig] = 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_contract_response.CreateChannelContractResponse":
    """<p>Creates a new channel contract and sends it to the signatory for signature. In the Sandbox catalog, the channel contract is accepted automatically.</p>

    Args:
        contract_type: <p>The type of channel contract to create (for example, managed services attestation).</p>
        catalog: <p>The catalog identifier for the channel contract.</p>
        payload: <p>The payload containing specific details for the contract 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 contract.</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 CreateChannelContract - MANAGED_SERVICES_ATTESTATION

        >>> client.create_channel_contract(contract_type='MANAGED_SERVICES_ATTESTATION', catalog='AWS', payload={'managedServicesAttestationPayload': {'legalEntityName': 'Example Partner Corp', 'signatoryName': 'Mary Major', 'signatoryEmail': '[email protected]', 'programManagementAccountIdentifier': 'pma-abcdef123456g', 'relationshipIdentifier': 'rs-abc123def456g', 'endDate': '2027-03-31T00:00:00Z', 'supportedServices': ['MONITORING', 'SECURITY'], 'memberAccountIds': ['111122224444'], 'legalEntityAddress': {'addressLine': '123 Any Street', 'addressLine2': 'Suite 100', 'city': 'Anytown', 'stateOrRegion': 'WA', 'postalCode': '98101', 'countryCode': 'US'}}}, client_token='clientToken')
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_channel.types.create_channel_contract_request.CreateChannelContractRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_channel.types.create_channel_contract_response.CreateChannelContractResponse"
    ]:
        import capo_partnercentral_channel._operations.partner_central_channel.create_channel_contract

        output, http_response = (
            capo_partnercentral_channel._operations.partner_central_channel.create_channel_contract.create_channel_contract(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_partnercentral_channel.types.create_channel_contract_request.CreateChannelContractRequest",
    ) -> dict[str, Any]:
        import capo_partnercentral_channel.types.create_channel_contract_request

        return capo_partnercentral_channel.types.create_channel_contract_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateChannelContract", redact_input=_redact_input),
    )
    input_: capo_partnercentral_channel.types.create_channel_contract_request.CreateChannelContractRequest = {
        "contract_type": contract_type,
        "catalog": catalog,
        "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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output