/** * 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::GroundStation::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetMissionProfileResult::GetMissionProfileResult() : m_contactPostPassDurationSeconds(0), m_contactPrePassDurationSeconds(0), m_minimumViableContactDurationSeconds(0) { } GetMissionProfileResult::GetMissionProfileResult(const Aws::AmazonWebServiceResult& result) : m_contactPostPassDurationSeconds(0), m_contactPrePassDurationSeconds(0), m_minimumViableContactDurationSeconds(0) { *this = result; } GetMissionProfileResult& GetMissionProfileResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("contactPostPassDurationSeconds")) { m_contactPostPassDurationSeconds = jsonValue.GetInteger("contactPostPassDurationSeconds"); } if(jsonValue.ValueExists("contactPrePassDurationSeconds")) { m_contactPrePassDurationSeconds = jsonValue.GetInteger("contactPrePassDurationSeconds"); } if(jsonValue.ValueExists("dataflowEdges")) { Aws::Utils::Array dataflowEdgesJsonList = jsonValue.GetArray("dataflowEdges"); for(unsigned dataflowEdgesIndex = 0; dataflowEdgesIndex < dataflowEdgesJsonList.GetLength(); ++dataflowEdgesIndex) { Aws::Utils::Array dataflowEdgeJsonList = dataflowEdgesJsonList[dataflowEdgesIndex].AsArray(); Aws::Vector dataflowEdgeList; dataflowEdgeList.reserve((size_t)dataflowEdgeJsonList.GetLength()); for(unsigned dataflowEdgeIndex = 0; dataflowEdgeIndex < dataflowEdgeJsonList.GetLength(); ++dataflowEdgeIndex) { dataflowEdgeList.push_back(dataflowEdgeJsonList[dataflowEdgeIndex].AsString()); } m_dataflowEdges.push_back(std::move(dataflowEdgeList)); } } if(jsonValue.ValueExists("minimumViableContactDurationSeconds")) { m_minimumViableContactDurationSeconds = jsonValue.GetInteger("minimumViableContactDurationSeconds"); } if(jsonValue.ValueExists("missionProfileArn")) { m_missionProfileArn = jsonValue.GetString("missionProfileArn"); } if(jsonValue.ValueExists("missionProfileId")) { m_missionProfileId = jsonValue.GetString("missionProfileId"); } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } if(jsonValue.ValueExists("region")) { m_region = jsonValue.GetString("region"); } if(jsonValue.ValueExists("streamsKmsKey")) { m_streamsKmsKey = jsonValue.GetObject("streamsKmsKey"); } if(jsonValue.ValueExists("streamsKmsRole")) { m_streamsKmsRole = jsonValue.GetString("streamsKmsRole"); } 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("trackingConfigArn")) { m_trackingConfigArn = jsonValue.GetString("trackingConfigArn"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }