getDocument method
Gets a single document.
Throws a http.ClientException if there were problems communicating with
the API service. Throws a ServiceException if the API method failed for
any reason.
Implementation
Future<Document> getDocument(GetDocumentRequest request) async {
final url = _endPoint.replace(
path: '/v1/${request.name}',
queryParameters: {
if (request.mask?.fieldPaths case final $1? when $1.isNotDefault)
'mask.fieldPaths': $1,
if (request.transaction case final $1?) 'transaction': encodeBytes($1)!,
if (request.readTime case final $1?) 'readTime': $1.toJson(),
},
);
final response = await _client.get(url);
return Document.fromJson(response);
}