1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/ec2/model/Ipv6Range.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 EC2
19 {
20 namespace Model
21 {
22
Ipv6Range()23 Ipv6Range::Ipv6Range() :
24 m_cidrIpv6HasBeenSet(false),
25 m_descriptionHasBeenSet(false)
26 {
27 }
28
Ipv6Range(const XmlNode & xmlNode)29 Ipv6Range::Ipv6Range(const XmlNode& xmlNode) :
30 m_cidrIpv6HasBeenSet(false),
31 m_descriptionHasBeenSet(false)
32 {
33 *this = xmlNode;
34 }
35
operator =(const XmlNode & xmlNode)36 Ipv6Range& Ipv6Range::operator =(const XmlNode& xmlNode)
37 {
38 XmlNode resultNode = xmlNode;
39
40 if(!resultNode.IsNull())
41 {
42 XmlNode cidrIpv6Node = resultNode.FirstChild("cidrIpv6");
43 if(!cidrIpv6Node.IsNull())
44 {
45 m_cidrIpv6 = Aws::Utils::Xml::DecodeEscapedXmlText(cidrIpv6Node.GetText());
46 m_cidrIpv6HasBeenSet = true;
47 }
48 XmlNode descriptionNode = resultNode.FirstChild("description");
49 if(!descriptionNode.IsNull())
50 {
51 m_description = Aws::Utils::Xml::DecodeEscapedXmlText(descriptionNode.GetText());
52 m_descriptionHasBeenSet = true;
53 }
54 }
55
56 return *this;
57 }
58
OutputToStream(Aws::OStream & oStream,const char * location,unsigned index,const char * locationValue) const59 void Ipv6Range::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
60 {
61 if(m_cidrIpv6HasBeenSet)
62 {
63 oStream << location << index << locationValue << ".CidrIpv6=" << StringUtils::URLEncode(m_cidrIpv6.c_str()) << "&";
64 }
65
66 if(m_descriptionHasBeenSet)
67 {
68 oStream << location << index << locationValue << ".Description=" << StringUtils::URLEncode(m_description.c_str()) << "&";
69 }
70
71 }
72
OutputToStream(Aws::OStream & oStream,const char * location) const73 void Ipv6Range::OutputToStream(Aws::OStream& oStream, const char* location) const
74 {
75 if(m_cidrIpv6HasBeenSet)
76 {
77 oStream << location << ".CidrIpv6=" << StringUtils::URLEncode(m_cidrIpv6.c_str()) << "&";
78 }
79 if(m_descriptionHasBeenSet)
80 {
81 oStream << location << ".Description=" << StringUtils::URLEncode(m_description.c_str()) << "&";
82 }
83 }
84
85 } // namespace Model
86 } // namespace EC2
87 } // namespace Aws
88