associatePhoneNumbersWithVoiceConnectorGroup method

Future<AssociatePhoneNumbersWithVoiceConnectorGroupResponse> associatePhoneNumbersWithVoiceConnectorGroup({
  1. required List<String> e164PhoneNumbers,
  2. required String voiceConnectorGroupId,
  3. bool? forceAssociate,
})

Associates phone numbers with the specified Amazon Chime SDK Voice Connector group.

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

Parameter e164PhoneNumbers : List of phone numbers, in E.164 format.

Parameter voiceConnectorGroupId : The Amazon Chime SDK Voice Connector group ID.

Parameter forceAssociate : If true, associates the provided phone numbers with the provided Amazon Chime SDK Voice Connector Group and removes any previously existing associations. If false, does not associate any phone numbers that have previously existing associations.

Implementation

Future<AssociatePhoneNumbersWithVoiceConnectorGroupResponse>
    associatePhoneNumbersWithVoiceConnectorGroup({
  required List<String> e164PhoneNumbers,
  required String voiceConnectorGroupId,
  bool? forceAssociate,
}) async {
  final $payload = <String, dynamic>{
    'E164PhoneNumbers': e164PhoneNumbers,
    if (forceAssociate != null) 'ForceAssociate': forceAssociate,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/voice-connector-groups/${Uri.encodeComponent(voiceConnectorGroupId)}?operation=associate-phone-numbers',
    exceptionFnMap: _exceptionFns,
  );
  return AssociatePhoneNumbersWithVoiceConnectorGroupResponse.fromJson(
      response);
}