storage method

  1. @override
Future<StorageMetrics> storage({
  1. String? authorization,
})
override

Implementation

@override
Future<StorageMetrics> storage({String? authorization}) async {
  final response = await _client.request(
    method: 'GET',
    path: '/dashboard/storage',
    headers: {'authorization': authorization},
  );

  final _body = await response.transform(utf8.decoder).join();

  if (jsonDecode(_body) case {'data': final Map data}) {
    return StorageMetrics.fromJson(Map.from((data as Map)));
  }

  throw Exception('Invalid response');
}