1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/s3-crt/model/SseKmsEncryptedObjects.h>
7 #include <aws/core/utils/xml/XmlSerializer.h>
8 #include <aws/core/utils/StringUtils.h>
9 #include <aws/core/utils/memory/stl/AWSStringStream.h>
10 
11 #include <utility>
12 
13 using namespace Aws::Utils::Xml;
14 using namespace Aws::Utils;
15 
16 namespace Aws
17 {
18 namespace S3Crt
19 {
20 namespace Model
21 {
22 
SseKmsEncryptedObjects()23 SseKmsEncryptedObjects::SseKmsEncryptedObjects() :
24     m_status(SseKmsEncryptedObjectsStatus::NOT_SET),
25     m_statusHasBeenSet(false)
26 {
27 }
28 
SseKmsEncryptedObjects(const XmlNode & xmlNode)29 SseKmsEncryptedObjects::SseKmsEncryptedObjects(const XmlNode& xmlNode) :
30     m_status(SseKmsEncryptedObjectsStatus::NOT_SET),
31     m_statusHasBeenSet(false)
32 {
33   *this = xmlNode;
34 }
35 
operator =(const XmlNode & xmlNode)36 SseKmsEncryptedObjects& SseKmsEncryptedObjects::operator =(const XmlNode& xmlNode)
37 {
38   XmlNode resultNode = xmlNode;
39 
40   if(!resultNode.IsNull())
41   {
42     XmlNode statusNode = resultNode.FirstChild("Status");
43     if(!statusNode.IsNull())
44     {
45       m_status = SseKmsEncryptedObjectsStatusMapper::GetSseKmsEncryptedObjectsStatusForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()).c_str()).c_str());
46       m_statusHasBeenSet = true;
47     }
48   }
49 
50   return *this;
51 }
52 
AddToNode(XmlNode & parentNode) const53 void SseKmsEncryptedObjects::AddToNode(XmlNode& parentNode) const
54 {
55   Aws::StringStream ss;
56   if(m_statusHasBeenSet)
57   {
58    XmlNode statusNode = parentNode.CreateChildElement("Status");
59    statusNode.SetText(SseKmsEncryptedObjectsStatusMapper::GetNameForSseKmsEncryptedObjectsStatus(m_status));
60   }
61 
62 }
63 
64 } // namespace Model
65 } // namespace S3Crt
66 } // namespace Aws
67