listProxySessions method

Future<ListProxySessionsResponse> listProxySessions({
  1. required String voiceConnectorId,
  2. int? maxResults,
  3. String? nextToken,
  4. ProxySessionStatus? status,
})

Lists the proxy sessions for the specified Amazon Chime Voice Connector.

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

Parameter voiceConnectorId : The Amazon Chime voice connector ID.

Parameter maxResults : The maximum number of results to return in a single call.

Parameter nextToken : The token to use to retrieve the next page of results.

Parameter status : The proxy session status.

Implementation

Future<ListProxySessionsResponse> listProxySessions({
  required String voiceConnectorId,
  int? maxResults,
  String? nextToken,
  ProxySessionStatus? status,
}) async {
  ArgumentError.checkNotNull(voiceConnectorId, 'voiceConnectorId');
  _s.validateStringLength(
    'voiceConnectorId',
    voiceConnectorId,
    1,
    128,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    99,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    65535,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'max-results': [maxResults.toString()],
    if (nextToken != null) 'next-token': [nextToken],
    if (status != null) 'status': [status.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/voice-connectors/${Uri.encodeComponent(voiceConnectorId)}/proxy-sessions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListProxySessionsResponse.fromJson(response);
}