Skip to content

merge_profiles

merge_profiles(
    domain_name: name,
    main_profile_id: uuid,
    profile_ids_to_be_merged: ProfileIdToBeMergedList,
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    field_source_profile_ids: Optional[FieldSourceProfileIds] = None,
) -> MergeProfilesResponse

Runs an AWS Lambda job that does the following:

  1. All the profileKeys in the ProfileToBeMerged will be moved to the main profile.

  2. All the objects in the ProfileToBeMerged will be moved to the main profile.

  3. All the ProfileToBeMerged will be deleted at the end.

  4. All the profileKeys in the ProfileIdsToBeMerged will be moved to the main profile.

  5. Standard fields are merged as follows:

    1. Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys.

    2. When there are conflicting fields:

      1. If no SourceProfileIds entry is specified, the main Profile value is always taken.

      2. If a SourceProfileIds entry is specified, the specified profileId is always taken, even if it is a NULL value.

You can use MergeProfiles together with GetMatches, which returns potentially matching profiles, or use it with the results of another matching system. After profiles have been merged, they cannot be separated (unmerged).

Parameters:

  • domain_name (name) –

    The unique name of the domain.

  • main_profile_id (uuid) –

    The identifier of the profile to be taken.

  • profile_ids_to_be_merged (ProfileIdToBeMergedList) –

    The identifier of the profile to be merged into MainProfileId.

  • field_source_profile_ids (Optional[FieldSourceProfileIds], default: None ) –

    The identifiers of the fields in the profile that has the information you want to apply to the merge. For example, say you want to merge EmailAddress from Profile1 into MainProfile. This would be the identifier of the EmailAddress field in Profile1.

Raises:

Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
def merge_profiles(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    main_profile_id: "capo_customer_profiles.types.uuid.uuid",
    profile_ids_to_be_merged: "capo_customer_profiles.types.profile_id_to_be_merged_list.ProfileIdToBeMergedList",
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    field_source_profile_ids: Optional[
        "capo_customer_profiles.types.field_source_profile_ids.FieldSourceProfileIds"
    ] = None,
) -> "capo_customer_profiles.types.merge_profiles_response.MergeProfilesResponse":
    """<p>Runs an AWS Lambda job that does the following:</p> <ol> <li> <p>All the profileKeys in the <code>ProfileToBeMerged</code> will be moved to the main profile.</p> </li> <li> <p>All the objects in the <code>ProfileToBeMerged</code> will be moved to the main profile.</p> </li> <li> <p>All the <code>ProfileToBeMerged</code> will be deleted at the end.</p> </li> <li> <p>All the profileKeys in the <code>ProfileIdsToBeMerged</code> will be moved to the main profile.</p> </li> <li> <p>Standard fields are merged as follows:</p> <ol> <li> <p>Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys.</p> </li> <li> <p>When there are conflicting fields:</p> <ol> <li> <p>If no <code>SourceProfileIds</code> entry is specified, the main Profile value is always taken. </p> </li> <li> <p>If a <code>SourceProfileIds</code> entry is specified, the specified profileId is always taken, even if it is a NULL value.</p> </li> </ol> </li> </ol> </li> </ol> <p>You can use MergeProfiles together with <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html">GetMatches</a>, which returns potentially matching profiles, or use it with the results of another matching system. After profiles have been merged, they cannot be separated (unmerged).</p>

    Args:
        domain_name: <p>The unique name of the domain.</p>
        main_profile_id: <p>The identifier of the profile to be taken.</p>
        profile_ids_to_be_merged: <p>The identifier of the profile to be merged into MainProfileId.</p>
        field_source_profile_ids: <p>The identifiers of the fields in the profile that has the information you want to apply to the merge. For example, say you want to merge EmailAddress from Profile1 into MainProfile. This would be the identifier of the EmailAddress field in Profile1. </p>

    Raises:
        capo_customer_profiles.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_customer_profiles.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred.</p>
        capo_customer_profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
        capo_customer_profiles.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_customer_profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_customer_profiles.types.merge_profiles_request.MergeProfilesRequest]",
    ) -> OperationResponse[
        "capo_customer_profiles.types.merge_profiles_response.MergeProfilesResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.merge_profiles

        output, http_response = (
            capo_customer_profiles._operations.customer_profiles_20200815.merge_profiles.merge_profiles(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("MergeProfiles")
    )
    input_: capo_customer_profiles.types.merge_profiles_request.MergeProfilesRequest = {
        "domain_name": domain_name,
        "main_profile_id": main_profile_id,
        "profile_ids_to_be_merged": profile_ids_to_be_merged,
    }
    if field_source_profile_ids is not None:
        input_["field_source_profile_ids"] = field_source_profile_ids

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