/** * 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::GuardDuty::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetThreatIntelSetResult::GetThreatIntelSetResult() : m_format(ThreatIntelSetFormat::NOT_SET), m_status(ThreatIntelSetStatus::NOT_SET) { } GetThreatIntelSetResult::GetThreatIntelSetResult(const Aws::AmazonWebServiceResult& result) : m_format(ThreatIntelSetFormat::NOT_SET), m_status(ThreatIntelSetStatus::NOT_SET) { *this = result; } GetThreatIntelSetResult& GetThreatIntelSetResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } if(jsonValue.ValueExists("format")) { m_format = ThreatIntelSetFormatMapper::GetThreatIntelSetFormatForName(jsonValue.GetString("format")); } if(jsonValue.ValueExists("location")) { m_location = jsonValue.GetString("location"); } if(jsonValue.ValueExists("status")) { m_status = ThreatIntelSetStatusMapper::GetThreatIntelSetStatusForName(jsonValue.GetString("status")); } if(jsonValue.ValueExists("tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }