getFeedServiceStatus method
Future<FeedServiceStatusContract?>
getFeedServiceStatus(
- FeedServiceEnum service, {
- bool? withHttpCode,
General status of data feed services FREE TIER
Which is the general health of the data feed service? Returns: Status of the service in general, regardless of the airports
Parameters:
-
FeedServiceEnum service (required): Data feed service name
-
bool withHttpCode: If true, reflect status of the service in the HTTP code of the response (if the service is down, HTTP code will be 503).
Implementation
Future<FeedServiceStatusContract?> getFeedServiceStatus(
FeedServiceEnum service, {
bool? withHttpCode,
}) async {
final response = await getFeedServiceStatusWithHttpInfo(
service,
withHttpCode: withHttpCode,
);
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),
'FeedServiceStatusContract',
) as FeedServiceStatusContract;
}
return null;
}