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/GetSchemaVersionResult.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 GetSchemaVersionResult()19GetSchemaVersionResult::GetSchemaVersionResult() : 20 m_dataFormat(DataFormat::NOT_SET), 21 m_versionNumber(0), 22 m_status(SchemaVersionStatus::NOT_SET) 23 { 24 } 25 GetSchemaVersionResult(const Aws::AmazonWebServiceResult<JsonValue> & result)26GetSchemaVersionResult::GetSchemaVersionResult(const Aws::AmazonWebServiceResult<JsonValue>& result) : 27 m_dataFormat(DataFormat::NOT_SET), 28 m_versionNumber(0), 29 m_status(SchemaVersionStatus::NOT_SET) 30 { 31 *this = result; 32 } 33 operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)34GetSchemaVersionResult& GetSchemaVersionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) 35 { 36 JsonView jsonValue = result.GetPayload().View(); 37 if(jsonValue.ValueExists("SchemaVersionId")) 38 { 39 m_schemaVersionId = jsonValue.GetString("SchemaVersionId"); 40 41 } 42 43 if(jsonValue.ValueExists("SchemaDefinition")) 44 { 45 m_schemaDefinition = jsonValue.GetString("SchemaDefinition"); 46 47 } 48 49 if(jsonValue.ValueExists("DataFormat")) 50 { 51 m_dataFormat = DataFormatMapper::GetDataFormatForName(jsonValue.GetString("DataFormat")); 52 53 } 54 55 if(jsonValue.ValueExists("SchemaArn")) 56 { 57 m_schemaArn = jsonValue.GetString("SchemaArn"); 58 59 } 60 61 if(jsonValue.ValueExists("VersionNumber")) 62 { 63 m_versionNumber = jsonValue.GetInt64("VersionNumber"); 64 65 } 66 67 if(jsonValue.ValueExists("Status")) 68 { 69 m_status = SchemaVersionStatusMapper::GetSchemaVersionStatusForName(jsonValue.GetString("Status")); 70 71 } 72 73 if(jsonValue.ValueExists("CreatedTime")) 74 { 75 m_createdTime = jsonValue.GetString("CreatedTime"); 76 77 } 78 79 80 81 return *this; 82 } 83