This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-ssm/source/model/GetPatchBaselineResult.cpp

145 lines
4.1 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ssm/model/GetPatchBaselineResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::SSM::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
GetPatchBaselineResult::GetPatchBaselineResult() :
m_operatingSystem(OperatingSystem::NOT_SET),
m_approvedPatchesComplianceLevel(PatchComplianceLevel::NOT_SET),
m_approvedPatchesEnableNonSecurity(false),
m_rejectedPatchesAction(PatchAction::NOT_SET)
{
}
GetPatchBaselineResult::GetPatchBaselineResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
m_operatingSystem(OperatingSystem::NOT_SET),
m_approvedPatchesComplianceLevel(PatchComplianceLevel::NOT_SET),
m_approvedPatchesEnableNonSecurity(false),
m_rejectedPatchesAction(PatchAction::NOT_SET)
{
*this = result;
}
GetPatchBaselineResult& GetPatchBaselineResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("BaselineId"))
{
m_baselineId = jsonValue.GetString("BaselineId");
}
if(jsonValue.ValueExists("Name"))
{
m_name = jsonValue.GetString("Name");
}
if(jsonValue.ValueExists("OperatingSystem"))
{
m_operatingSystem = OperatingSystemMapper::GetOperatingSystemForName(jsonValue.GetString("OperatingSystem"));
}
if(jsonValue.ValueExists("GlobalFilters"))
{
m_globalFilters = jsonValue.GetObject("GlobalFilters");
}
if(jsonValue.ValueExists("ApprovalRules"))
{
m_approvalRules = jsonValue.GetObject("ApprovalRules");
}
if(jsonValue.ValueExists("ApprovedPatches"))
{
Array<JsonView> approvedPatchesJsonList = jsonValue.GetArray("ApprovedPatches");
for(unsigned approvedPatchesIndex = 0; approvedPatchesIndex < approvedPatchesJsonList.GetLength(); ++approvedPatchesIndex)
{
m_approvedPatches.push_back(approvedPatchesJsonList[approvedPatchesIndex].AsString());
}
}
if(jsonValue.ValueExists("ApprovedPatchesComplianceLevel"))
{
m_approvedPatchesComplianceLevel = PatchComplianceLevelMapper::GetPatchComplianceLevelForName(jsonValue.GetString("ApprovedPatchesComplianceLevel"));
}
if(jsonValue.ValueExists("ApprovedPatchesEnableNonSecurity"))
{
m_approvedPatchesEnableNonSecurity = jsonValue.GetBool("ApprovedPatchesEnableNonSecurity");
}
if(jsonValue.ValueExists("RejectedPatches"))
{
Array<JsonView> rejectedPatchesJsonList = jsonValue.GetArray("RejectedPatches");
for(unsigned rejectedPatchesIndex = 0; rejectedPatchesIndex < rejectedPatchesJsonList.GetLength(); ++rejectedPatchesIndex)
{
m_rejectedPatches.push_back(rejectedPatchesJsonList[rejectedPatchesIndex].AsString());
}
}
if(jsonValue.ValueExists("RejectedPatchesAction"))
{
m_rejectedPatchesAction = PatchActionMapper::GetPatchActionForName(jsonValue.GetString("RejectedPatchesAction"));
}
if(jsonValue.ValueExists("PatchGroups"))
{
Array<JsonView> patchGroupsJsonList = jsonValue.GetArray("PatchGroups");
for(unsigned patchGroupsIndex = 0; patchGroupsIndex < patchGroupsJsonList.GetLength(); ++patchGroupsIndex)
{
m_patchGroups.push_back(patchGroupsJsonList[patchGroupsIndex].AsString());
}
}
if(jsonValue.ValueExists("CreatedDate"))
{
m_createdDate = jsonValue.GetDouble("CreatedDate");
}
if(jsonValue.ValueExists("ModifiedDate"))
{
m_modifiedDate = jsonValue.GetDouble("ModifiedDate");
}
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
}
if(jsonValue.ValueExists("Sources"))
{
Array<JsonView> sourcesJsonList = jsonValue.GetArray("Sources");
for(unsigned sourcesIndex = 0; sourcesIndex < sourcesJsonList.GetLength(); ++sourcesIndex)
{
m_sources.push_back(sourcesJsonList[sourcesIndex].AsObject());
}
}
return *this;
}