putVoiceConnectorProxy method

Future<PutVoiceConnectorProxyResponse> putVoiceConnectorProxy({
  1. required int defaultSessionExpiryMinutes,
  2. required List<String> phoneNumberPoolCountries,
  3. required String voiceConnectorId,
  4. bool? disabled,
  5. String? fallBackPhoneNumber,
})

Puts the specified proxy configuration to the specified Amazon Chime Voice Connector.

May throw UnauthorizedClientException. May throw AccessDeniedException. May throw NotFoundException. May throw ForbiddenException. May throw BadRequestException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter defaultSessionExpiryMinutes : The default number of minutes allowed for proxy sessions.

Parameter phoneNumberPoolCountries : The countries for proxy phone numbers to be selected from.

Parameter voiceConnectorId : The Amazon Chime voice connector ID.

Parameter disabled : When true, stops proxy sessions from being created on the specified Amazon Chime Voice Connector.

Parameter fallBackPhoneNumber : The phone number to route calls to after a proxy session expires.

Implementation

Future<PutVoiceConnectorProxyResponse> putVoiceConnectorProxy({
  required int defaultSessionExpiryMinutes,
  required List<String> phoneNumberPoolCountries,
  required String voiceConnectorId,
  bool? disabled,
  String? fallBackPhoneNumber,
}) async {
  ArgumentError.checkNotNull(
      defaultSessionExpiryMinutes, 'defaultSessionExpiryMinutes');
  ArgumentError.checkNotNull(
      phoneNumberPoolCountries, 'phoneNumberPoolCountries');
  ArgumentError.checkNotNull(voiceConnectorId, 'voiceConnectorId');
  _s.validateStringLength(
    'voiceConnectorId',
    voiceConnectorId,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'DefaultSessionExpiryMinutes': defaultSessionExpiryMinutes,
    'PhoneNumberPoolCountries': phoneNumberPoolCountries,
    if (disabled != null) 'Disabled': disabled,
    if (fallBackPhoneNumber != null)
      'FallBackPhoneNumber': fallBackPhoneNumber,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/voice-connectors/${Uri.encodeComponent(voiceConnectorId)}/programmable-numbers/proxy',
    exceptionFnMap: _exceptionFns,
  );
  return PutVoiceConnectorProxyResponse.fromJson(response);
}