getSites method

Future<GetSitesResponse> getSites({
  1. required String globalNetworkId,
  2. int? maxResults,
  3. String? nextToken,
  4. List<String>? siteIds,
})

Gets information about one or more of your sites in a global network.

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

Parameter globalNetworkId : The ID of the global network.

Parameter maxResults : The maximum number of results to return.

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

Parameter siteIds : One or more site IDs. The maximum is 10.

Implementation

Future<GetSitesResponse> getSites({
  required String globalNetworkId,
  int? maxResults,
  String? nextToken,
  List<String>? siteIds,
}) async {
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (siteIds != null) 'siteIds': siteIds,
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/sites',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetSitesResponse.fromJson(response);
}