getResources method

Future<Resources> getResources({
  1. required String restApiId,
  2. List<String>? embed,
  3. int? limit,
  4. String? position,
})

Lists information about a collection of Resource resources.

May throw BadRequestException. May throw UnauthorizedException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter restApiId : Required The string identifier of the associated RestApi.

Parameter embed : A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This embed parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the "methods" string. For example, GET /restapis/{restapi_id}/resources?embed=methods.

Parameter limit : The maximum number of returned results per page. The default value is 25 and the maximum value is 500.

Parameter position : The current pagination position in the paged result set.

Implementation

Future<Resources> getResources({
  required String restApiId,
  List<String>? embed,
  int? limit,
  String? position,
}) async {
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $query = <String, List<String>>{
    if (embed != null) 'embed': embed,
    if (limit != null) 'limit': [limit.toString()],
    if (position != null) 'position': [position],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/restapis/${Uri.encodeComponent(restApiId)}/resources',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return Resources.fromJson(response);
}