From 3dfc6685c335d0dbf8460ce393b821c9a720f05c Mon Sep 17 00:00:00 2001 From: luxy Date: Sat, 16 Sep 2023 17:11:26 +0800 Subject: [PATCH 1/2] a --- .../s3/model/CompleteMultipartUploadRequest.h | 224 +++++++++++++++++- .../aws/s3/model/ServerSideEncryption.h | 3 +- .../model/CompleteMultipartUploadRequest.cpp | 31 +++ .../model/CompleteMultipartUploadResult.cpp | 84 +++---- .../model/PutBucketEncryptionRequest.cpp | 1 + .../source/model/ServerSideEncryption.cpp | 7 + 6 files changed, 308 insertions(+), 42 deletions(-) diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h index 74770a7b1..3b8346ab9 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CompleteMultipartUploadRequest.h @@ -446,14 +446,236 @@ namespace Model inline bool HaveCallBackHasBeenSet() const { return m_haveCallBack; } inline void SetHaveCallBack(bool value) { m_haveCallBack = value;} + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline const Aws::String& GetSSECustomerAlgorithm() const{ return m_sSECustomerAlgorithm; } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline void SetSSECustomerAlgorithm(const Aws::String& value) { m_sSECustomerAlgorithmHasBeenSet = true; m_sSECustomerAlgorithm = value; } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline void SetSSECustomerAlgorithm(Aws::String&& value) { m_sSECustomerAlgorithmHasBeenSet = true; m_sSECustomerAlgorithm = std::move(value); } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline void SetSSECustomerAlgorithm(const char* value) { m_sSECustomerAlgorithmHasBeenSet = true; m_sSECustomerAlgorithm.assign(value); } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerAlgorithm(const Aws::String& value) { SetSSECustomerAlgorithm(value); return *this;} + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerAlgorithm(Aws::String&& value) { SetSSECustomerAlgorithm(std::move(value)); return *this;} + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerAlgorithm(const char* value) { SetSSECustomerAlgorithm(value); return *this;} + + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline const Aws::String& GetSSECustomerKey() const{ return m_sSECustomerKey; } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline bool SSECustomerKeyHasBeenSet() const { return m_sSECustomerKeyHasBeenSet; } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline void SetSSECustomerKey(const Aws::String& value) { m_sSECustomerKeyHasBeenSet = true; m_sSECustomerKey = value; } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline void SetSSECustomerKey(Aws::String&& value) { m_sSECustomerKeyHasBeenSet = true; m_sSECustomerKey = std::move(value); } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline void SetSSECustomerKey(const char* value) { m_sSECustomerKeyHasBeenSet = true; m_sSECustomerKey.assign(value); } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerKey(const Aws::String& value) { SetSSECustomerKey(value); return *this;} + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerKey(Aws::String&& value) { SetSSECustomerKey(std::move(value)); return *this;} + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerKey(const char* value) { SetSSECustomerKey(value); return *this;} + + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline const Aws::String& GetSSECustomerKeyMD5() const{ return m_sSECustomerKeyMD5; } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline void SetSSECustomerKeyMD5(const Aws::String& value) { m_sSECustomerKeyMD5HasBeenSet = true; m_sSECustomerKeyMD5 = value; } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline void SetSSECustomerKeyMD5(Aws::String&& value) { m_sSECustomerKeyMD5HasBeenSet = true; m_sSECustomerKeyMD5 = std::move(value); } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline void SetSSECustomerKeyMD5(const char* value) { m_sSECustomerKeyMD5HasBeenSet = true; m_sSECustomerKeyMD5.assign(value); } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerKeyMD5(const Aws::String& value) { SetSSECustomerKeyMD5(value); return *this;} + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerKeyMD5(Aws::String&& value) { SetSSECustomerKeyMD5(std::move(value)); return *this;} + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline CompleteMultipartUploadRequest& WithSSECustomerKeyMD5(const char* value) { SetSSECustomerKeyMD5(value); return *this;} + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline const ServerSideEncryption& GetServerSideEncryption() const{ return m_serverSideEncryption; } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline bool ServerSideEncryptionHasBeenSet() const { return m_serverSideEncryptionHasBeenSet; } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline void SetServerSideEncryption(const ServerSideEncryption& value) { m_serverSideEncryptionHasBeenSet = true; m_serverSideEncryption = value; } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline void SetServerSideEncryption(ServerSideEncryption&& value) { m_serverSideEncryptionHasBeenSet = true; m_serverSideEncryption = std::move(value); } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline CompleteMultipartUploadRequest& WithServerSideEncryption(const ServerSideEncryption& value) { SetServerSideEncryption(value); return *this;} + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline CompleteMultipartUploadRequest& WithServerSideEncryption(ServerSideEncryption&& value) { SetServerSideEncryption(std::move(value)); return *this;} + + private: + ServerSideEncryption m_serverSideEncryption; + bool m_serverSideEncryptionHasBeenSet; + Aws::String m_sSECustomerAlgorithm; + bool m_sSECustomerAlgorithmHasBeenSet; + Aws::String m_sSECustomerKey; + bool m_sSECustomerKeyHasBeenSet; - private: + Aws::String m_sSECustomerKeyMD5; + bool m_sSECustomerKeyMD5HasBeenSet; bool m_haveCallBack; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryption.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryption.h index 3b5b7ed8a..788ad37a5 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryption.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/ServerSideEncryption.h @@ -17,7 +17,8 @@ namespace Model { NOT_SET, AES256, - aws_kms + aws_kms, + SM4 }; namespace ServerSideEncryptionMapper diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp index 09d0ecf64..a77a28ee8 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadRequest.cpp @@ -32,6 +32,11 @@ CompleteMultipartUploadRequest::CompleteMultipartUploadRequest() : m_callBackUrlHasBeenSet(false), m_callBackBodyHasBeenSet(false), m_callBackBodyTypeHasBeenSet(false), + m_serverSideEncryption(ServerSideEncryption::NOT_SET), + m_sSECustomerAlgorithmHasBeenSet(false), + m_sSECustomerKeyHasBeenSet(false), + m_sSECustomerKeyMD5HasBeenSet(false), + m_serverSideEncryptionHasBeenSet(false), m_haveCallBack(false) { } @@ -148,5 +153,31 @@ Aws::Http::HeaderValueCollection CompleteMultipartUploadRequest::GetRequestSpeci ss.str(""); } + if(m_serverSideEncryptionHasBeenSet) + { + headers.emplace("x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); + } + + if(m_sSECustomerAlgorithmHasBeenSet) + { + ss << m_sSECustomerAlgorithm; + headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); + ss.str(""); + } + + if(m_sSECustomerKeyHasBeenSet) + { + ss << m_sSECustomerKey; + headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); + ss.str(""); + } + + if(m_sSECustomerKeyMD5HasBeenSet) + { + ss << m_sSECustomerKeyMD5; + headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); + ss.str(""); + } + return headers; } diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp index 3361ba48f..629d34704 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CompleteMultipartUploadResult.cpp @@ -86,47 +86,51 @@ CompleteMultipartUploadResult& CompleteMultipartUploadResult::operator =(Aws::Am m_requestCharged = RequestChargedMapper::GetRequestChargedForName(requestChargedIter->second); } - /* 解析body */ - std::stringstream ss; - ss << body_tmp.GetUnderlyingStream().rdbuf(); - std::string str = ss.str(); - m_body = str.c_str(); - - /* 尝试解析xml,解析失败也没有关系 */ - Aws::Http::HeaderValueCollection m_responseHeaders; - Aws::Http::HttpResponseCode m_responseCode = Aws::Http::HttpResponseCode::OK; - - Aws::Client::XmlOutcome out(Aws::AmazonWebServiceResult( - Aws::Utils::Xml::XmlDocument::CreateFromXmlStream(ss), - m_responseHeaders, m_responseCode)); - - const Aws::Utils::Xml::XmlDocument& xmlDocument = out.GetResult().GetPayload(); - - Aws::Utils::Xml::XmlNode resultNode = xmlDocument.GetRootElement(); - if (!resultNode.IsNull()) - { - Aws::Utils::Xml::XmlNode locationNode = resultNode.FirstChild("Location"); - if (!locationNode.IsNull()) - { - m_location = Aws::Utils::Xml::DecodeEscapedXmlText(locationNode.GetText()); - } - Aws::Utils::Xml::XmlNode bucketNode = resultNode.FirstChild("Bucket"); - if (!bucketNode.IsNull()) - { - m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(locationNode.GetText()); - - } - Aws::Utils::Xml::XmlNode keyNode = resultNode.FirstChild("Key"); - if (!keyNode.IsNull()) - { - m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); - } - Aws::Utils::Xml::XmlNode eTagNode = resultNode.FirstChild("ETag"); - if (!eTagNode.IsNull()) - { - m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); - } + /* 解析body */ + if(body_tmp.GetUnderlyingStream().rdbuf()->in_avail() != 0) + { + std::stringstream ss; + ss << body_tmp.GetUnderlyingStream().rdbuf(); + std::string str = ss.str(); + m_body = str.c_str(); + + /* 尝试解析xml,解析失败也没有关系 */ + Aws::Http::HeaderValueCollection m_responseHeaders; + Aws::Http::HttpResponseCode m_responseCode = Aws::Http::HttpResponseCode::OK; + + Aws::Client::XmlOutcome out(Aws::AmazonWebServiceResult( + Aws::Utils::Xml::XmlDocument::CreateFromXmlStream(ss), + m_responseHeaders, m_responseCode)); + + const Aws::Utils::Xml::XmlDocument& xmlDocument = out.GetResult().GetPayload(); + + Aws::Utils::Xml::XmlNode resultNode = xmlDocument.GetRootElement(); + if (!resultNode.IsNull()) + { + Aws::Utils::Xml::XmlNode locationNode = resultNode.FirstChild("Location"); + if (!locationNode.IsNull()) + { + m_location = Aws::Utils::Xml::DecodeEscapedXmlText(locationNode.GetText()); + } + Aws::Utils::Xml::XmlNode bucketNode = resultNode.FirstChild("Bucket"); + if (!bucketNode.IsNull()) + { + m_bucket = Aws::Utils::Xml::DecodeEscapedXmlText(locationNode.GetText()); + + } + Aws::Utils::Xml::XmlNode keyNode = resultNode.FirstChild("Key"); + if (!keyNode.IsNull()) + { + m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText()); + } + Aws::Utils::Xml::XmlNode eTagNode = resultNode.FirstChild("ETag"); + if (!eTagNode.IsNull()) + { + m_eTag = Aws::Utils::Xml::DecodeEscapedXmlText(eTagNode.GetText()); + } + } } + return *this; } diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp index 6e65af8a5..8ca2b0e8d 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/PutBucketEncryptionRequest.cpp @@ -37,6 +37,7 @@ Aws::String PutBucketEncryptionRequest::SerializePayload() const { return payloadDoc.ConvertToString(); } + std::cout< Date: Mon, 18 Sep 2023 10:38:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=A1=B6=E5=8A=A0?= =?UTF-8?q?=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aws/s3/model/AppendObjectRequest.h | 228 ++++++++++++++++++ .../source/model/AppendObjectRequest.cpp | 30 +++ 2 files changed, 258 insertions(+) diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/AppendObjectRequest.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/AppendObjectRequest.h index f4db898b5..ae8031bcf 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/AppendObjectRequest.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/AppendObjectRequest.h @@ -929,8 +929,236 @@ namespace Model */ inline AppendObjectRequest& WithTagging(const char* value) { SetTagging(value); return *this;} + +/** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline const Aws::String& GetSSECustomerAlgorithm() const{ return m_sSECustomerAlgorithm; } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline bool SSECustomerAlgorithmHasBeenSet() const { return m_sSECustomerAlgorithmHasBeenSet; } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline void SetSSECustomerAlgorithm(const Aws::String& value) { m_sSECustomerAlgorithmHasBeenSet = true; m_sSECustomerAlgorithm = value; } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline void SetSSECustomerAlgorithm(Aws::String&& value) { m_sSECustomerAlgorithmHasBeenSet = true; m_sSECustomerAlgorithm = std::move(value); } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline void SetSSECustomerAlgorithm(const char* value) { m_sSECustomerAlgorithmHasBeenSet = true; m_sSECustomerAlgorithm.assign(value); } + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline AppendObjectRequest& WithSSECustomerAlgorithm(const Aws::String& value) { SetSSECustomerAlgorithm(value); return *this;} + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline AppendObjectRequest& WithSSECustomerAlgorithm(Aws::String&& value) { SetSSECustomerAlgorithm(std::move(value)); return *this;} + + /** + *

Specifies the algorithm to use to when encrypting the object (for example, + * AES256).

+ */ + inline AppendObjectRequest& WithSSECustomerAlgorithm(const char* value) { SetSSECustomerAlgorithm(value); return *this;} + + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline const Aws::String& GetSSECustomerKey() const{ return m_sSECustomerKey; } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline bool SSECustomerKeyHasBeenSet() const { return m_sSECustomerKeyHasBeenSet; } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline void SetSSECustomerKey(const Aws::String& value) { m_sSECustomerKeyHasBeenSet = true; m_sSECustomerKey = value; } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline void SetSSECustomerKey(Aws::String&& value) { m_sSECustomerKeyHasBeenSet = true; m_sSECustomerKey = std::move(value); } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline void SetSSECustomerKey(const char* value) { m_sSECustomerKeyHasBeenSet = true; m_sSECustomerKey.assign(value); } + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline AppendObjectRequest& WithSSECustomerKey(const Aws::String& value) { SetSSECustomerKey(value); return *this;} + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline AppendObjectRequest& WithSSECustomerKey(Aws::String&& value) { SetSSECustomerKey(std::move(value)); return *this;} + + /** + *

Specifies the customer-provided encryption key for Amazon S3 to use in + * encrypting data. This value is used to store the object and then it is + * discarded; Amazon S3 does not store the encryption key. The key must be + * appropriate for use with the algorithm specified in the + * x-amz-server-side-encryption-customer-algorithm header.

+ */ + inline AppendObjectRequest& WithSSECustomerKey(const char* value) { SetSSECustomerKey(value); return *this;} + + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline const Aws::String& GetSSECustomerKeyMD5() const{ return m_sSECustomerKeyMD5; } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline bool SSECustomerKeyMD5HasBeenSet() const { return m_sSECustomerKeyMD5HasBeenSet; } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline void SetSSECustomerKeyMD5(const Aws::String& value) { m_sSECustomerKeyMD5HasBeenSet = true; m_sSECustomerKeyMD5 = value; } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline void SetSSECustomerKeyMD5(Aws::String&& value) { m_sSECustomerKeyMD5HasBeenSet = true; m_sSECustomerKeyMD5 = std::move(value); } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline void SetSSECustomerKeyMD5(const char* value) { m_sSECustomerKeyMD5HasBeenSet = true; m_sSECustomerKeyMD5.assign(value); } + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline AppendObjectRequest& WithSSECustomerKeyMD5(const Aws::String& value) { SetSSECustomerKeyMD5(value); return *this;} + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline AppendObjectRequest& WithSSECustomerKeyMD5(Aws::String&& value) { SetSSECustomerKeyMD5(std::move(value)); return *this;} + + /** + *

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. + * Amazon S3 uses this header for a message integrity check to ensure that the + * encryption key was transmitted without error.

+ */ + inline AppendObjectRequest& WithSSECustomerKeyMD5(const char* value) { SetSSECustomerKeyMD5(value); return *this;} + +/** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline const ServerSideEncryption& GetServerSideEncryption() const{ return m_serverSideEncryption; } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline bool ServerSideEncryptionHasBeenSet() const { return m_serverSideEncryptionHasBeenSet; } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline void SetServerSideEncryption(const ServerSideEncryption& value) { m_serverSideEncryptionHasBeenSet = true; m_serverSideEncryption = value; } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline void SetServerSideEncryption(ServerSideEncryption&& value) { m_serverSideEncryptionHasBeenSet = true; m_serverSideEncryption = std::move(value); } + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline AppendObjectRequest& WithServerSideEncryption(const ServerSideEncryption& value) { SetServerSideEncryption(value); return *this;} + + /** + *

The server-side encryption algorithm used when storing this object in Amazon + * S3 (for example, AES256, aws:kms).

+ */ + inline AppendObjectRequest& WithServerSideEncryption(ServerSideEncryption&& value) { SetServerSideEncryption(std::move(value)); return *this;} + + private: + ServerSideEncryption m_serverSideEncryption; + bool m_serverSideEncryptionHasBeenSet; + + Aws::String m_sSECustomerAlgorithm; + bool m_sSECustomerAlgorithmHasBeenSet; + + Aws::String m_sSECustomerKey; + bool m_sSECustomerKeyHasBeenSet; + + Aws::String m_sSECustomerKeyMD5; + bool m_sSECustomerKeyMD5HasBeenSet; + Aws::String m_tag; bool m_tagHasBeenSet; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/AppendObjectRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/AppendObjectRequest.cpp index 323c0795f..251f2e7af 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/AppendObjectRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/AppendObjectRequest.cpp @@ -40,6 +40,10 @@ AppendObjectRequest::AppendObjectRequest() : m_metaDataValueHasBeenSet(false), m_metaDataKeyHasBeenSet(false), m_position("0"), + m_sSECustomerAlgorithmHasBeenSet(false), + m_sSECustomerKeyHasBeenSet(false), + m_sSECustomerKeyMD5HasBeenSet(false), + m_serverSideEncryptionHasBeenSet(false), m_tagHasBeenSet(false) { } @@ -168,5 +172,31 @@ Aws::Http::HeaderValueCollection AppendObjectRequest::GetRequestSpecificHeaders( ss.str(""); } + if(m_serverSideEncryptionHasBeenSet) + { + headers.emplace("x-amz-server-side-encryption", ServerSideEncryptionMapper::GetNameForServerSideEncryption(m_serverSideEncryption)); + } + + if(m_sSECustomerAlgorithmHasBeenSet) + { + ss << m_sSECustomerAlgorithm; + headers.emplace("x-amz-server-side-encryption-customer-algorithm", ss.str()); + ss.str(""); + } + + if(m_sSECustomerKeyHasBeenSet) + { + ss << m_sSECustomerKey; + headers.emplace("x-amz-server-side-encryption-customer-key", ss.str()); + ss.str(""); + } + + if(m_sSECustomerKeyMD5HasBeenSet) + { + ss << m_sSECustomerKeyMD5; + headers.emplace("x-amz-server-side-encryption-customer-key-md5", ss.str()); + ss.str(""); + } + return headers; } -- Gitee