deleteContactData method

Future<void> deleteContactData({
  1. required List<ContactField> contactFields,
  2. required String contactId,
  3. required String instanceId,
})

Deletes the specified fields containing personally identifiable information (PII) from a contact in the specified Connect Customer instance. We redact PII (such as customer endpoints, additional email recipients, and the email subject) from the contact and its associated contact trace record (CTR). The contact must be in a terminated state.

May throw ContactNotTerminatedException. May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter contactFields : The categories of PII to redact from the contact. Specify one or more of the following values:

  • CUSTOMER_ENDPOINT – The customer's contact endpoint.
  • ADDITIONAL_EMAIL_RECIPIENTS – Additional recipients on an email contact (email channel only).
  • EMAIL_SUBJECT – The subject line of an email contact (email channel only).

Parameter contactId : The identifier of the contact. You can delete PII only from a contact that has been disconnected (is in a terminated state).

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Implementation

Future<void> deleteContactData({
  required List<ContactField> contactFields,
  required String contactId,
  required String instanceId,
}) async {
  final $payload = <String, dynamic>{
    'ContactFields': contactFields.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/contact/delete/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}',
    exceptionFnMap: _exceptionFns,
  );
}