/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::GlueDataBrew::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeDatasetResult::DescribeDatasetResult() : m_format(InputFormat::NOT_SET), m_source(Source::NOT_SET) { } DescribeDatasetResult::DescribeDatasetResult(const Aws::AmazonWebServiceResult& result) : m_format(InputFormat::NOT_SET), m_source(Source::NOT_SET) { *this = result; } DescribeDatasetResult& DescribeDatasetResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("CreatedBy")) { m_createdBy = jsonValue.GetString("CreatedBy"); } if(jsonValue.ValueExists("CreateDate")) { m_createDate = jsonValue.GetDouble("CreateDate"); } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("Format")) { m_format = InputFormatMapper::GetInputFormatForName(jsonValue.GetString("Format")); } if(jsonValue.ValueExists("FormatOptions")) { m_formatOptions = jsonValue.GetObject("FormatOptions"); } if(jsonValue.ValueExists("Input")) { m_input = jsonValue.GetObject("Input"); } if(jsonValue.ValueExists("LastModifiedDate")) { m_lastModifiedDate = jsonValue.GetDouble("LastModifiedDate"); } if(jsonValue.ValueExists("LastModifiedBy")) { m_lastModifiedBy = jsonValue.GetString("LastModifiedBy"); } if(jsonValue.ValueExists("Source")) { m_source = SourceMapper::GetSourceForName(jsonValue.GetString("Source")); } if(jsonValue.ValueExists("PathOptions")) { m_pathOptions = jsonValue.GetObject("PathOptions"); } if(jsonValue.ValueExists("Tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } } if(jsonValue.ValueExists("ResourceArn")) { m_resourceArn = jsonValue.GetString("ResourceArn"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }