1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/route53/model/CreateQueryLoggingConfigResult.h>
7 #include <aws/core/utils/xml/XmlSerializer.h>
8 #include <aws/core/AmazonWebServiceResult.h>
9 #include <aws/core/utils/StringUtils.h>
10 #include <aws/core/utils/memory/stl/AWSStringStream.h>
11 
12 #include <utility>
13 
14 using namespace Aws::Route53::Model;
15 using namespace Aws::Utils::Xml;
16 using namespace Aws::Utils;
17 using namespace Aws;
18 
CreateQueryLoggingConfigResult()19 CreateQueryLoggingConfigResult::CreateQueryLoggingConfigResult()
20 {
21 }
22 
CreateQueryLoggingConfigResult(const Aws::AmazonWebServiceResult<XmlDocument> & result)23 CreateQueryLoggingConfigResult::CreateQueryLoggingConfigResult(const Aws::AmazonWebServiceResult<XmlDocument>& result)
24 {
25   *this = result;
26 }
27 
operator =(const Aws::AmazonWebServiceResult<XmlDocument> & result)28 CreateQueryLoggingConfigResult& CreateQueryLoggingConfigResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
29 {
30   const XmlDocument& xmlDocument = result.GetPayload();
31   XmlNode resultNode = xmlDocument.GetRootElement();
32 
33   if(!resultNode.IsNull())
34   {
35     XmlNode queryLoggingConfigNode = resultNode.FirstChild("QueryLoggingConfig");
36     if(!queryLoggingConfigNode.IsNull())
37     {
38       m_queryLoggingConfig = queryLoggingConfigNode;
39     }
40   }
41 
42   const auto& headers = result.GetHeaderValueCollection();
43   const auto& locationIter = headers.find("location");
44   if(locationIter != headers.end())
45   {
46     m_location = locationIter->second;
47   }
48 
49   return *this;
50 }
51