monitorContact method

Future<MonitorContactResponse> monitorContact({
  1. required String contactId,
  2. required String instanceId,
  3. required String userId,
  4. List<MonitorCapability>? allowedMonitorCapabilities,
  5. String? clientToken,
})

Initiates silent monitoring of a contact. The Contact Control Panel (CCP) of the user specified by userId will be set to silent monitoring mode on the contact.

May throw AccessDeniedException. May throw IdempotencyException. May throw InternalServiceException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException.

Parameter contactId : The identifier of the contact.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instanceId in the ARN of the instance.

Parameter userId : The identifier of the user account.

Parameter allowedMonitorCapabilities : Specify which monitoring actions the user is allowed to take. For example, whether the user is allowed to escalate from silent monitoring to barge. AllowedMonitorCapabilities is required if barge is enabled.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Implementation

Future<MonitorContactResponse> monitorContact({
  required String contactId,
  required String instanceId,
  required String userId,
  List<MonitorCapability>? allowedMonitorCapabilities,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'ContactId': contactId,
    'InstanceId': instanceId,
    'UserId': userId,
    if (allowedMonitorCapabilities != null)
      'AllowedMonitorCapabilities':
          allowedMonitorCapabilities.map((e) => e.value).toList(),
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/contact/monitor',
    exceptionFnMap: _exceptionFns,
  );
  return MonitorContactResponse.fromJson(response);
}