listPeerings method

Future<ListPeeringsResponse> listPeerings({
  1. String? coreNetworkId,
  2. String? edgeLocation,
  3. int? maxResults,
  4. String? nextToken,
  5. PeeringType? peeringType,
  6. PeeringState? state,
})

Lists the peerings for a core network.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter coreNetworkId : The ID of a core network.

Parameter edgeLocation : Returns a list edge locations for the

Parameter maxResults : The maximum number of results to return.

Parameter nextToken : The token for the next page of results.

Parameter peeringType : Returns a list of a peering requests.

Parameter state : Returns a list of the peering request states.

Implementation

Future<ListPeeringsResponse> listPeerings({
  String? coreNetworkId,
  String? edgeLocation,
  int? maxResults,
  String? nextToken,
  PeeringType? peeringType,
  PeeringState? state,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $query = <String, List<String>>{
    if (coreNetworkId != null) 'coreNetworkId': [coreNetworkId],
    if (edgeLocation != null) 'edgeLocation': [edgeLocation],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (peeringType != null) 'peeringType': [peeringType.value],
    if (state != null) 'state': [state.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/peerings',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListPeeringsResponse.fromJson(response);
}