1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/glue/model/RegisterSchemaVersionResult.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::Glue::Model;
15 using namespace Aws::Utils::Json;
16 using namespace Aws::Utils;
17 using namespace Aws;
18 
RegisterSchemaVersionResult()19 RegisterSchemaVersionResult::RegisterSchemaVersionResult() :
20     m_versionNumber(0),
21     m_status(SchemaVersionStatus::NOT_SET)
22 {
23 }
24 
RegisterSchemaVersionResult(const Aws::AmazonWebServiceResult<JsonValue> & result)25 RegisterSchemaVersionResult::RegisterSchemaVersionResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
26     m_versionNumber(0),
27     m_status(SchemaVersionStatus::NOT_SET)
28 {
29   *this = result;
30 }
31 
operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)32 RegisterSchemaVersionResult& RegisterSchemaVersionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
33 {
34   JsonView jsonValue = result.GetPayload().View();
35   if(jsonValue.ValueExists("SchemaVersionId"))
36   {
37     m_schemaVersionId = jsonValue.GetString("SchemaVersionId");
38 
39   }
40 
41   if(jsonValue.ValueExists("VersionNumber"))
42   {
43     m_versionNumber = jsonValue.GetInt64("VersionNumber");
44 
45   }
46 
47   if(jsonValue.ValueExists("Status"))
48   {
49     m_status = SchemaVersionStatusMapper::GetSchemaVersionStatusForName(jsonValue.GetString("Status"));
50 
51   }
52 
53 
54 
55   return *this;
56 }
57