1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/rds/model/DescribeDBLogFilesDetails.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 RDS
19 {
20 namespace Model
21 {
22
DescribeDBLogFilesDetails()23 DescribeDBLogFilesDetails::DescribeDBLogFilesDetails() :
24 m_logFileNameHasBeenSet(false),
25 m_lastWritten(0),
26 m_lastWrittenHasBeenSet(false),
27 m_size(0),
28 m_sizeHasBeenSet(false)
29 {
30 }
31
DescribeDBLogFilesDetails(const XmlNode & xmlNode)32 DescribeDBLogFilesDetails::DescribeDBLogFilesDetails(const XmlNode& xmlNode) :
33 m_logFileNameHasBeenSet(false),
34 m_lastWritten(0),
35 m_lastWrittenHasBeenSet(false),
36 m_size(0),
37 m_sizeHasBeenSet(false)
38 {
39 *this = xmlNode;
40 }
41
operator =(const XmlNode & xmlNode)42 DescribeDBLogFilesDetails& DescribeDBLogFilesDetails::operator =(const XmlNode& xmlNode)
43 {
44 XmlNode resultNode = xmlNode;
45
46 if(!resultNode.IsNull())
47 {
48 XmlNode logFileNameNode = resultNode.FirstChild("LogFileName");
49 if(!logFileNameNode.IsNull())
50 {
51 m_logFileName = Aws::Utils::Xml::DecodeEscapedXmlText(logFileNameNode.GetText());
52 m_logFileNameHasBeenSet = true;
53 }
54 XmlNode lastWrittenNode = resultNode.FirstChild("LastWritten");
55 if(!lastWrittenNode.IsNull())
56 {
57 m_lastWritten = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(lastWrittenNode.GetText()).c_str()).c_str());
58 m_lastWrittenHasBeenSet = true;
59 }
60 XmlNode sizeNode = resultNode.FirstChild("Size");
61 if(!sizeNode.IsNull())
62 {
63 m_size = StringUtils::ConvertToInt64(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sizeNode.GetText()).c_str()).c_str());
64 m_sizeHasBeenSet = true;
65 }
66 }
67
68 return *this;
69 }
70
OutputToStream(Aws::OStream & oStream,const char * location,unsigned index,const char * locationValue) const71 void DescribeDBLogFilesDetails::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
72 {
73 if(m_logFileNameHasBeenSet)
74 {
75 oStream << location << index << locationValue << ".LogFileName=" << StringUtils::URLEncode(m_logFileName.c_str()) << "&";
76 }
77
78 if(m_lastWrittenHasBeenSet)
79 {
80 oStream << location << index << locationValue << ".LastWritten=" << m_lastWritten << "&";
81 }
82
83 if(m_sizeHasBeenSet)
84 {
85 oStream << location << index << locationValue << ".Size=" << m_size << "&";
86 }
87
88 }
89
OutputToStream(Aws::OStream & oStream,const char * location) const90 void DescribeDBLogFilesDetails::OutputToStream(Aws::OStream& oStream, const char* location) const
91 {
92 if(m_logFileNameHasBeenSet)
93 {
94 oStream << location << ".LogFileName=" << StringUtils::URLEncode(m_logFileName.c_str()) << "&";
95 }
96 if(m_lastWrittenHasBeenSet)
97 {
98 oStream << location << ".LastWritten=" << m_lastWritten << "&";
99 }
100 if(m_sizeHasBeenSet)
101 {
102 oStream << location << ".Size=" << m_size << "&";
103 }
104 }
105
106 } // namespace Model
107 } // namespace RDS
108 } // namespace Aws
109