getOne method
Returns a single log by its id.
Implementation
Future<LogModel> getOne(
String id, {
Map<String, dynamic> query = const {},
Map<String, String> headers = const {},
}) async {
if (id.isEmpty) {
throw ClientException(
url: client.buildUrl("/api/logs/"),
statusCode: 404,
response: <String, dynamic>{
"code": 404,
"message": "Missing required log id.",
"data": <String, dynamic>{},
},
);
}
return client
.send(
"/api/logs/${Uri.encodeComponent(id)}",
query: query,
headers: headers,
)
.then((data) => LogModel.fromJson(data as Map<String, dynamic>? ?? {}));
}