-
xuty authored8ad96389
models.dart 87.58 KiB
import 'package:xml/xml.dart';
XmlElement getProp(XmlElement xml, String name) {
final result = xml.findElements(name);
return result.isNotEmpty ? result.first : null;
}
/// Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy in the Amazon Simple Storage Service Developer Guide.
class AbortIncompleteMultipartUpload {
AbortIncompleteMultipartUpload.fromXml(XmlElement xml) {
daysAfterInitiation =
int.tryParse(getProp(xml, 'DaysAfterInitiation')?.text);
}
/// Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload.
int daysAfterInitiation;
}
/// Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see Amazon S3 Transfer Acceleration in the Amazon Simple Storage Service Developer Guide.
class AccelerateConfiguration {
AccelerateConfiguration.fromXml(XmlElement xml) {
status = getProp(xml, 'Status')?.text;
}
/// Specifies the transfer acceleration status of the bucket.
String status;
}
/// Contains the elements that set the ACL permissions for an object per grantee.
class AccessControlPolicy {
AccessControlPolicy.fromXml(XmlElement xml) {
grants = Grant.fromXml(getProp(xml, 'Grants'));
owner = Owner.fromXml(getProp(xml, 'Owner'));
}
/// A list of grants.
Grant grants;
/// Container for the bucket owner's display name and ID.
Owner owner;
}
/// A container for information about access control for replicas.
class AccessControlTranslation {
AccessControlTranslation.fromXml(XmlElement xml) {
owner = getProp(xml, 'Owner')?.text;
}
/// Specifies the replica ownership. For default and valid values, see PUT bucket replication in the Amazon Simple Storage Service API Reference.
String owner;
}
/// A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates in any combination, and an object must match all of the predicates for the filter to apply.
class AnalyticsAndOperator {
AnalyticsAndOperator.fromXml(XmlElement xml) {
prefix = getProp(xml, 'Prefix')?.text;
tags = Tag.fromXml(getProp(xml, 'Tags'));
}
/// The prefix to use when evaluating an AND predicate: The prefix that an object must have to be included in the metrics results.
String prefix;
/// The list of tags to use when evaluating an AND predicate.
Tag tags;
}
/// Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.
class AnalyticsConfiguration {
AnalyticsConfiguration.fromXml(XmlElement xml) {
filter = AnalyticsFilter.fromXml(getProp(xml, 'Filter'));