Skip to content

create_relationship

create_relationship(
    catalog: Catalog,
    association_type: AssociationType,
    program_management_account_identifier: ProgramManagementAccountIdentifier,
    associated_account_id: AccountId,
    display_name: RelationshipDisplayName,
    sector: Sector,
    *,
    config_overrides: Optional[PartnerCentralChannelClientConfig] = None,
    resale_account_model: Optional[ResaleAccountModel] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagList] = None,
    requested_support_plan: Optional[SupportPlan] = None,
) -> CreateRelationshipResponse

Creates a new partner relationship between accounts.

Parameters:

  • catalog (Catalog) –

    The catalog identifier for the relationship.

  • association_type (AssociationType) –

    The type of association for the relationship (e.g., reseller, distributor).

  • program_management_account_identifier (ProgramManagementAccountIdentifier) –

    The identifier of the program management account for this relationship.

  • associated_account_id (AccountId) –

    The AWS account ID to associate in this relationship.

  • display_name (RelationshipDisplayName) –

    A human-readable name for the relationship.

  • resale_account_model (Optional[ResaleAccountModel], default: None ) –

    The resale account model for the relationship.

  • sector (Sector) –

    The business sector for the relationship.

  • 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 relationship.

  • requested_support_plan (Optional[SupportPlan], default: None ) –

    The support plan requested for this relationship.

Raises:

Examples:

Example for CreateRelationship

>>> client.create_relationship(catalog='AWS', association_type='DOWNSTREAM_SELLER', program_management_account_identifier='pma-u8ic702rtzng8', associated_account_id='987654321012', display_name='TestDisplayName', resale_account_model='END_CUSTOMER', sector='COMMERCIAL', client_token='clientToken')
Source code in docs_src/capo_partnercentral_channel/_services/partner_central_channel.py
def create_relationship(
    self,
    catalog: "capo_partnercentral_channel.types.catalog.Catalog",
    association_type: "capo_partnercentral_channel.types.association_type.AssociationType",
    program_management_account_identifier: "capo_partnercentral_channel.types.program_management_account_identifier.ProgramManagementAccountIdentifier",
    associated_account_id: "capo_partnercentral_channel.types.account_id.AccountId",
    display_name: "capo_partnercentral_channel.types.relationship_display_name.RelationshipDisplayName",
    sector: "capo_partnercentral_channel.types.sector.Sector",
    *,
    config_overrides: Optional[PartnerCentralChannelClientConfig] = None,
    resale_account_model: Optional[
        "capo_partnercentral_channel.types.resale_account_model.ResaleAccountModel"
    ] = None,
    client_token: Optional[
        "capo_partnercentral_channel.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_partnercentral_channel.types.tag_list.TagList"] = None,
    requested_support_plan: Optional[
        "capo_partnercentral_channel.types.support_plan.SupportPlan"
    ] = None,
) -> "capo_partnercentral_channel.types.create_relationship_response.CreateRelationshipResponse":
    """<p>Creates a new partner relationship between accounts.</p>

    Args:
        catalog: <p>The catalog identifier for the relationship.</p>
        association_type: <p>The type of association for the relationship (e.g., reseller, distributor).</p>
        program_management_account_identifier: <p>The identifier of the program management account for this relationship.</p>
        associated_account_id: <p>The AWS account ID to associate in this relationship.</p>
        display_name: <p>A human-readable name for the relationship.</p>
        resale_account_model: <p>The resale account model for the relationship.</p>
        sector: <p>The business sector for the relationship.</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 relationship.</p>
        requested_support_plan: <p>The support plan requested for this relationship.</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 CreateRelationship

        >>> client.create_relationship(catalog='AWS', association_type='DOWNSTREAM_SELLER', program_management_account_identifier='pma-u8ic702rtzng8', associated_account_id='987654321012', display_name='TestDisplayName', resale_account_model='END_CUSTOMER', sector='COMMERCIAL', client_token='clientToken')
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_channel.types.create_relationship_request.CreateRelationshipRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_channel.types.create_relationship_response.CreateRelationshipResponse"
    ]:
        import capo_partnercentral_channel._operations.partner_central_channel.create_relationship

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRelationship")
    )
    input_: capo_partnercentral_channel.types.create_relationship_request.CreateRelationshipRequest = {
        "catalog": catalog,
        "association_type": association_type,
        "program_management_account_identifier": program_management_account_identifier,
        "associated_account_id": associated_account_id,
        "display_name": display_name,
        "sector": sector,
    }
    if resale_account_model is not None:
        input_["resale_account_model"] = resale_account_model
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags
    if requested_support_plan is not None:
        input_["requested_support_plan"] = requested_support_plan

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output