1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/mgn/model/MarkAsArchivedResult.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 #include <aws/core/AmazonWebServiceResult.h>
9 #include <aws/core/utils/StringUtils.h>
10 #include <aws/core/utils/UnreferencedParam.h>
11 
12 #include <utility>
13 
14 using namespace Aws::mgn::Model;
15 using namespace Aws::Utils::Json;
16 using namespace Aws::Utils;
17 using namespace Aws;
18 
MarkAsArchivedResult()19 MarkAsArchivedResult::MarkAsArchivedResult() :
20     m_isArchived(false)
21 {
22 }
23 
MarkAsArchivedResult(const Aws::AmazonWebServiceResult<JsonValue> & result)24 MarkAsArchivedResult::MarkAsArchivedResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
25     m_isArchived(false)
26 {
27   *this = result;
28 }
29 
operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)30 MarkAsArchivedResult& MarkAsArchivedResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
31 {
32   JsonView jsonValue = result.GetPayload().View();
33   if(jsonValue.ValueExists("arn"))
34   {
35     m_arn = jsonValue.GetString("arn");
36 
37   }
38 
39   if(jsonValue.ValueExists("dataReplicationInfo"))
40   {
41     m_dataReplicationInfo = jsonValue.GetObject("dataReplicationInfo");
42 
43   }
44 
45   if(jsonValue.ValueExists("isArchived"))
46   {
47     m_isArchived = jsonValue.GetBool("isArchived");
48 
49   }
50 
51   if(jsonValue.ValueExists("launchedInstance"))
52   {
53     m_launchedInstance = jsonValue.GetObject("launchedInstance");
54 
55   }
56 
57   if(jsonValue.ValueExists("lifeCycle"))
58   {
59     m_lifeCycle = jsonValue.GetObject("lifeCycle");
60 
61   }
62 
63   if(jsonValue.ValueExists("sourceProperties"))
64   {
65     m_sourceProperties = jsonValue.GetObject("sourceProperties");
66 
67   }
68 
69   if(jsonValue.ValueExists("sourceServerID"))
70   {
71     m_sourceServerID = jsonValue.GetString("sourceServerID");
72 
73   }
74 
75   if(jsonValue.ValueExists("tags"))
76   {
77     Aws::Map<Aws::String, JsonView> tagsJsonMap = jsonValue.GetObject("tags").GetAllObjects();
78     for(auto& tagsItem : tagsJsonMap)
79     {
80       m_tags[tagsItem.first] = tagsItem.second.AsString();
81     }
82   }
83 
84 
85 
86   return *this;
87 }
88