listPartsQuery method

Future<ListPartsOutput> listPartsQuery(
  1. String? bucket,
  2. String? object,
  3. String? uploadId,
  4. int? marker,
)

Called by listParts to fetch a batch of part-info

Implementation

Future<ListPartsOutput> listPartsQuery(
  String? bucket,
  String? object,
  String? uploadId,
  int? marker,
) async {
  final queries = <String, dynamic>{'uploadId': uploadId};

  if (marker != null && marker != 0) {
    queries['part-number-marker'] = marker.toString();
  }

  final resp = await _client.request(
    method: 'GET',
    bucket: bucket,
    object: object,
    queries: queries,
  );

  validate(resp);

  final node = xml.XmlDocument.parse(resp.body);
  return ListPartsOutput.fromXml(node.root as XmlElement);
}