createProxySession method
Creates a proxy session for the specified Amazon Chime SDK Voice Connector for the specified participant phone numbers.
May throw BadRequestException.
May throw ForbiddenException.
May throw NotFoundException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter capabilities :
The proxy session's capabilities.
Parameter participantPhoneNumbers :
The participant phone numbers.
Parameter voiceConnectorId :
The Voice Connector ID.
Parameter expiryMinutes :
The number of minutes allowed for the proxy session.
Parameter geoMatchLevel :
The preference for matching the country or area code of the proxy phone
number with that of the first participant.
Parameter geoMatchParams :
The country and area code for the proxy phone number.
Parameter name :
The name of the proxy session.
Parameter numberSelectionBehavior :
The preference for proxy phone number reuse, or stickiness, between the
same participants across sessions.
Implementation
Future<CreateProxySessionResponse> createProxySession({
required List<Capability> capabilities,
required List<String> participantPhoneNumbers,
required String voiceConnectorId,
int? expiryMinutes,
GeoMatchLevel? geoMatchLevel,
GeoMatchParams? geoMatchParams,
String? name,
NumberSelectionBehavior? numberSelectionBehavior,
}) async {
_s.validateNumRange(
'expiryMinutes',
expiryMinutes,
1,
1152921504606846976,
);
final $payload = <String, dynamic>{
'Capabilities': capabilities.map((e) => e.value).toList(),
'ParticipantPhoneNumbers': participantPhoneNumbers,
if (expiryMinutes != null) 'ExpiryMinutes': expiryMinutes,
if (geoMatchLevel != null) 'GeoMatchLevel': geoMatchLevel.value,
if (geoMatchParams != null) 'GeoMatchParams': geoMatchParams,
if (name != null) 'Name': name,
if (numberSelectionBehavior != null)
'NumberSelectionBehavior': numberSelectionBehavior.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/voice-connectors/${Uri.encodeComponent(voiceConnectorId)}/proxy-sessions',
exceptionFnMap: _exceptionFns,
);
return CreateProxySessionResponse.fromJson(response);
}