getLinks method

Future<GetLinksResponse> getLinks({
  1. required String globalNetworkId,
  2. List<String>? linkIds,
  3. int? maxResults,
  4. String? nextToken,
  5. String? provider,
  6. String? siteId,
  7. String? type,
})

Gets information about one or more links in a specified global network.

If you specify the site ID, you cannot specify the type or provider in the same request. You can specify the type and provider in the same request.

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

Parameter globalNetworkId : The ID of the global network.

Parameter linkIds : One or more link IDs. The maximum is 10.

Parameter maxResults : The maximum number of results to return.

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

Parameter provider : The link provider.

Parameter siteId : The ID of the site.

Parameter type : The link type.

Implementation

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