代码修改后的版本,全部提交

This commit is contained in:
ss001
2026-02-07 15:48:27 +08:00
parent cccbaa37c9
commit c2cda58c65
15604 changed files with 2455502 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using COSXML.Common;
using COSXML.Model.Tag;
using COSXML.Network;
using System;
using System.Collections.Generic;
using System.Text;
namespace COSXML.Model.Bucket
{
public sealed class PutBucketLoggingRequest : BucketRequest
{
private BucketLoggingStatus bucketLoggingStatus;
public PutBucketLoggingRequest(string bucket):base(bucket)
{
this.method = CosRequestMethod.PUT;
this.queryParameters.Add("logging", null);
this.bucketLoggingStatus = new BucketLoggingStatus();
}
public void SetTarget(string targetBucket, string targetPrefix)
{
if (targetPrefix == null && targetPrefix == null) return;
if (bucketLoggingStatus.loggingEnabled == null)
{
bucketLoggingStatus.loggingEnabled = new BucketLoggingStatus.LoggingEnabled();
}
if(targetBucket != null) bucketLoggingStatus.loggingEnabled.targetBucket = targetBucket;
if(targetPrefix != null) bucketLoggingStatus.loggingEnabled.targetPrefix = targetPrefix;
}
public override Network.RequestBody GetRequestBody()
{
string content = Transfer.XmlBuilder.BuildBucketLogging(bucketLoggingStatus);
byte[] data = Encoding.UTF8.GetBytes(content);
ByteRequestBody body = new ByteRequestBody(data);
return body;
}
}
}