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-dlm/source/model/LifecyclePolicySummary.cpp

114 lines
2.3 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/dlm/model/LifecyclePolicySummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace DLM
{
namespace Model
{
LifecyclePolicySummary::LifecyclePolicySummary() :
m_policyIdHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_state(GettablePolicyStateValues::NOT_SET),
m_stateHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
LifecyclePolicySummary::LifecyclePolicySummary(JsonView jsonValue) :
m_policyIdHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_state(GettablePolicyStateValues::NOT_SET),
m_stateHasBeenSet(false),
m_tagsHasBeenSet(false)
{
*this = jsonValue;
}
LifecyclePolicySummary& LifecyclePolicySummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("PolicyId"))
{
m_policyId = jsonValue.GetString("PolicyId");
m_policyIdHasBeenSet = true;
}
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("State"))
{
m_state = GettablePolicyStateValuesMapper::GetGettablePolicyStateValuesForName(jsonValue.GetString("State"));
m_stateHasBeenSet = true;
}
if(jsonValue.ValueExists("Tags"))
{
Aws::Map<Aws::String, JsonView> tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects();
for(auto& tagsItem : tagsJsonMap)
{
m_tags[tagsItem.first] = tagsItem.second.AsString();
}
m_tagsHasBeenSet = true;
}
return *this;
}
JsonValue LifecyclePolicySummary::Jsonize() const
{
JsonValue payload;
if(m_policyIdHasBeenSet)
{
payload.WithString("PolicyId", m_policyId);
}
if(m_descriptionHasBeenSet)
{
payload.WithString("Description", m_description);
}
if(m_stateHasBeenSet)
{
payload.WithString("State", GettablePolicyStateValuesMapper::GetNameForGettablePolicyStateValues(m_state));
}
if(m_tagsHasBeenSet)
{
JsonValue tagsJsonMap;
for(auto& tagsItem : m_tags)
{
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
}
payload.WithObject("Tags", std::move(tagsJsonMap));
}
return payload;
}
} // namespace Model
} // namespace DLM
} // namespace Aws