listBuckets method

Future<List<Bucket>> listBuckets()

List of buckets created.

Implementation

Future<List<Bucket>> listBuckets() async {
  final resp = await _client.request(
    method: 'GET',
    region: region ?? 'us-east-1',
  );
  validate(resp);
  final bucketsNode =
      xml.XmlDocument.parse(resp.body).findAllElements('Buckets').first;
  return bucketsNode.children
      .map((n) => Bucket.fromXml(n as XmlElement))
      .toList();
}