getModel method

Future<GetModel200Response?> getModel(
  1. String id, {
  2. Future<void>? abortTrigger,
})

Get one model

Cost: 10 credits. Priced above /authors/id, /methods/id and /datasets/id because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries is_delisted=1 and days_since_gone.

Parameters:

Implementation

Future<GetModel200Response?> getModel(String id, { Future<void>? abortTrigger, }) async {
  final response = await getModelWithHttpInfo(id, abortTrigger: abortTrigger,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetModel200Response',) as GetModel200Response;

  }
  return null;
}