updateProxySession method
Future<UpdateProxySessionResponse>
updateProxySession({
- required List<
Capability> capabilities, - required String proxySessionId,
- required String voiceConnectorId,
- int? expiryMinutes,
Updates the specified proxy session details, such as voice or SMS capabilities.
May throw UnauthorizedClientException. May throw NotFoundException. May throw ForbiddenException. May throw BadRequestException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.
Parameter capabilities
:
The proxy session capabilities.
Parameter proxySessionId
:
The proxy session ID.
Parameter voiceConnectorId
:
The Amazon Chime voice connector ID.
Parameter expiryMinutes
:
The number of minutes allowed for the proxy session.
Implementation
Future<UpdateProxySessionResponse> updateProxySession({
required List<Capability> capabilities,
required String proxySessionId,
required String voiceConnectorId,
int? expiryMinutes,
}) async {
ArgumentError.checkNotNull(capabilities, 'capabilities');
ArgumentError.checkNotNull(proxySessionId, 'proxySessionId');
_s.validateStringLength(
'proxySessionId',
proxySessionId,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(voiceConnectorId, 'voiceConnectorId');
_s.validateStringLength(
'voiceConnectorId',
voiceConnectorId,
1,
128,
isRequired: true,
);
_s.validateNumRange(
'expiryMinutes',
expiryMinutes,
1,
1152921504606846976,
);
final $payload = <String, dynamic>{
'Capabilities': capabilities.map((e) => e.toValue()).toList(),
if (expiryMinutes != null) 'ExpiryMinutes': expiryMinutes,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/voice-connectors/${Uri.encodeComponent(voiceConnectorId)}/proxy-sessions/${Uri.encodeComponent(proxySessionId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateProxySessionResponse.fromJson(response);
}