disconnectParticipant method
Disconnects a participant. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.
The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.
May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.
Parameter connectionToken
:
The authentication token associated with the participant's connection.
Parameter clientToken
:
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Implementation
Future<void> disconnectParticipant({
required String connectionToken,
String? clientToken,
}) async {
ArgumentError.checkNotNull(connectionToken, 'connectionToken');
_s.validateStringLength(
'connectionToken',
connectionToken,
1,
1000,
isRequired: true,
);
_s.validateStringLength(
'clientToken',
clientToken,
0,
500,
);
final headers = <String, String>{
'X-Amz-Bearer': connectionToken.toString(),
};
final $payload = <String, dynamic>{
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/participant/disconnect',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}