getDocumentationParts method

Future<DocumentationParts> getDocumentationParts({
  1. required String restApiId,
  2. int? limit,
  3. LocationStatusType? locationStatus,
  4. String? nameQuery,
  5. String? path,
  6. String? position,
  7. DocumentationPartType? type,
})

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

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

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

Parameter locationStatus : The status of the API documentation parts to retrieve. Valid values are DOCUMENTED for retrieving DocumentationPart resources with content and UNDOCUMENTED for DocumentationPart resources without content.

Parameter nameQuery : The name of API entities of the to-be-retrieved documentation parts.

Parameter path : The path of API entities of the to-be-retrieved documentation parts.

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

Parameter type : The type of API entities of the to-be-retrieved documentation parts.

Implementation

Future<DocumentationParts> getDocumentationParts({
  required String restApiId,
  int? limit,
  LocationStatusType? locationStatus,
  String? nameQuery,
  String? path,
  String? position,
  DocumentationPartType? type,
}) async {
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  final $query = <String, List<String>>{
    if (limit != null) 'limit': [limit.toString()],
    if (locationStatus != null) 'locationStatus': [locationStatus.toValue()],
    if (nameQuery != null) 'name': [nameQuery],
    if (path != null) 'path': [path],
    if (position != null) 'position': [position],
    if (type != null) 'type': [type.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/restapis/${Uri.encodeComponent(restApiId)}/documentation/parts',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DocumentationParts.fromJson(response);
}