123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using COSXML.Common;
- using COSXML.Model.Tag;
- using COSXML.Network;
- namespace COSXML.Model.Bucket
- {
- public sealed class PutBucketVersioningRequest : BucketRequest
- {
- private VersioningConfiguration versioningConfiguration;
- public PutBucketVersioningRequest(string bucket)
- : base(bucket)
- {
- this.method = CosRequestMethod.PUT;
- this.queryParameters.Add("versioning", null);
- versioningConfiguration = new VersioningConfiguration();
- }
- public override Network.RequestBody GetRequestBody()
- {
- return GetXmlRequestBody(versioningConfiguration);
- }
- public void IsEnableVersionConfig(bool isEnable)
- {
- if (isEnable)
- {
- versioningConfiguration.status = "Enabled";
- }
- else
- {
- versioningConfiguration.status = "Suspended";
- }
- }
- }
- }
|