123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Xml.Serialization;
- namespace COSXML.Model.Tag
- {
- [XmlRoot]
- public sealed class InventoryConfiguration
- {
- [XmlElement("Id")]
- public string id;
- [XmlElement("IsEnabled")]
- public bool isEnabled;
- [XmlElement("IncludedObjectVersions")]
- public string includedObjectVersions;
- [XmlElement("Filter")]
- public Filter filter;
- [XmlElement("OptionalFields")]
- public OptionalFields optionalFields;
- [XmlElement("Schedule")]
- public Schedule schedule;
- [XmlElement("Destination")]
- public Destination destination;
- public string GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{InventoryConfiguration:\n");
- stringBuilder.Append("Id").Append(id).Append("\n");
- stringBuilder.Append("IsEnabled:").Append(isEnabled).Append("\n");
- if (destination != null)
- {
- stringBuilder.Append(destination.GetInfo()).Append("\n");
- }
- if (schedule != null)
- {
- stringBuilder.Append(schedule.GetInfo()).Append("\n");
- }
- if (filter != null)
- {
- stringBuilder.Append(filter.GetInfo()).Append("\n");
- }
- stringBuilder.Append("IncludedObjectVersions:").Append(includedObjectVersions).Append("\n");
- if (optionalFields != null)
- {
- stringBuilder.Append(optionalFields.GetInfo()).Append("\n");
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- public sealed class Filter
- {
- [XmlElement("Prefix")]
- public string prefix;
- public string GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{Filter:\n");
- stringBuilder.Append("Prefix:").Append(prefix).Append("\n");
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
- public sealed class OptionalFields
- {
- [XmlElement("Field")]
- public List<string> fields;
- public string GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{OptionalFields:\n");
- if (fields != null)
- {
- foreach (string field in fields)
- {
- stringBuilder.Append("Field:").Append(field).Append("\n");
- }
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
- public sealed class Schedule
- {
- [XmlElement("Frequency")]
- public string frequency;
- public string GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{Schedule:\n");
- stringBuilder.Append("Frequency:").Append(frequency).Append("\n");
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
- public sealed class Destination
- {
- [XmlElement("COSBucketDestination")]
- public COSBucketDestination cosBucketDestination;
- public string GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{Destination:\n");
- if (cosBucketDestination != null)
- {
- stringBuilder.Append(cosBucketDestination.GetInfo()).Append("\n");
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
- public sealed class COSBucketDestination
- {
- [XmlElement("Format")]
- public string format;
- [XmlElement("AccountId")]
- public string accountId;
- [XmlElement("Bucket")]
- public string bucket;
- [XmlElement("Prefix")]
- public string prefix;
- [XmlElement("Encryption")]
- public Encryption encryption;
- public string GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{COSBucketDestination:\n");
- stringBuilder.Append("Format:").Append(format).Append("\n");
- stringBuilder.Append("AccountId:").Append(accountId).Append("\n");
- stringBuilder.Append("Bucket:").Append(bucket).Append("\n");
- stringBuilder.Append("Prefix:").Append(prefix).Append("\n");
- if (encryption != null)
- {
- stringBuilder.Append(encryption.GetInfo()).Append("\n");
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
- public sealed class Encryption
- {
- [XmlElement("SSE-COS")]
- public string sSECOS;
- public String GetInfo()
- {
- StringBuilder stringBuilder = new StringBuilder("{Encryption:\n");
- stringBuilder.Append("SSE-COS:").Append(sSECOS).Append("\n");
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
- }
- }
|