/** * 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::SageMakerGeospatial::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetRasterDataCollectionResult::GetRasterDataCollectionResult() : m_type(DataCollectionType::NOT_SET) { } GetRasterDataCollectionResult::GetRasterDataCollectionResult(const Aws::AmazonWebServiceResult& result) : m_type(DataCollectionType::NOT_SET) { *this = result; } GetRasterDataCollectionResult& GetRasterDataCollectionResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); } if(jsonValue.ValueExists("DescriptionPageUrl")) { m_descriptionPageUrl = jsonValue.GetString("DescriptionPageUrl"); } if(jsonValue.ValueExists("ImageSourceBands")) { Aws::Utils::Array imageSourceBandsJsonList = jsonValue.GetArray("ImageSourceBands"); for(unsigned imageSourceBandsIndex = 0; imageSourceBandsIndex < imageSourceBandsJsonList.GetLength(); ++imageSourceBandsIndex) { m_imageSourceBands.push_back(imageSourceBandsJsonList[imageSourceBandsIndex].AsString()); } } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("SupportedFilters")) { Aws::Utils::Array supportedFiltersJsonList = jsonValue.GetArray("SupportedFilters"); for(unsigned supportedFiltersIndex = 0; supportedFiltersIndex < supportedFiltersJsonList.GetLength(); ++supportedFiltersIndex) { m_supportedFilters.push_back(supportedFiltersJsonList[supportedFiltersIndex].AsObject()); } } 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("Type")) { m_type = DataCollectionTypeMapper::GetDataCollectionTypeForName(jsonValue.GetString("Type")); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }