getCodeFile method
Returns the INDEXED content of one file — read_file over the chunks the search tiers hold, for pulling up code an agent just found.
Returns the INDEXED content of one file — read_file over the chunks the search tiers hold, for pulling up code an agent just found. It is NOT byte-verbatim: the git object plane is the source of record for exact bytes, history and blame. A file absent from the index is a 404, so an agent can tell "not indexed" from "empty file".
Parameters:
Implementation
Future<FileContent?> getCodeFile({ String? pathParam, String? repo, }) async {
final response = await getCodeFileWithHttpInfo( pathParam: pathParam, repo: repo, );
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), 'FileContent',) as FileContent;
}
return null;
}