mergeProfiles method
Runs an AWS Lambda job that does the following:
-
All the profileKeys in the
ProfileToBeMergedwill be moved to the main profile. -
All the objects in the
ProfileToBeMergedwill be moved to the main profile. -
All the
ProfileToBeMergedwill be deleted at the end. -
All the profileKeys in the
ProfileIdsToBeMergedwill be moved to the main profile. -
Standard fields are merged as follows:
- Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys.
-
When there are conflicting fields:
-
If no
SourceProfileIdsentry is specified, the main Profile value is always taken. -
If a
SourceProfileIdsentry is specified, the specified profileId is always taken, even if it is a NULL value.
-
If no
May throw BadRequestException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter domainName :
The unique name of the domain.
Parameter mainProfileId :
The identifier of the profile to be taken.
Parameter profileIdsToBeMerged :
The identifier of the profile to be merged into MainProfileId.
Parameter fieldSourceProfileIds :
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.
Implementation
Future<MergeProfilesResponse> mergeProfiles({
required String domainName,
required String mainProfileId,
required List<String> profileIdsToBeMerged,
FieldSourceProfileIds? fieldSourceProfileIds,
}) async {
final $payload = <String, dynamic>{
'MainProfileId': mainProfileId,
'ProfileIdsToBeMerged': profileIdsToBeMerged,
if (fieldSourceProfileIds != null)
'FieldSourceProfileIds': fieldSourceProfileIds,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/domains/${Uri.encodeComponent(domainName)}/profiles/objects/merge',
exceptionFnMap: _exceptionFns,
);
return MergeProfilesResponse.fromJson(response);
}