83 lines
1.7 KiB
C++
83 lines
1.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/eks/model/EncryptionConfig.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace EKS
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
EncryptionConfig::EncryptionConfig() :
|
|
m_resourcesHasBeenSet(false),
|
|
m_providerHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
EncryptionConfig::EncryptionConfig(JsonView jsonValue) :
|
|
m_resourcesHasBeenSet(false),
|
|
m_providerHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
EncryptionConfig& EncryptionConfig::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("resources"))
|
|
{
|
|
Array<JsonView> resourcesJsonList = jsonValue.GetArray("resources");
|
|
for(unsigned resourcesIndex = 0; resourcesIndex < resourcesJsonList.GetLength(); ++resourcesIndex)
|
|
{
|
|
m_resources.push_back(resourcesJsonList[resourcesIndex].AsString());
|
|
}
|
|
m_resourcesHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("provider"))
|
|
{
|
|
m_provider = jsonValue.GetObject("provider");
|
|
|
|
m_providerHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue EncryptionConfig::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_resourcesHasBeenSet)
|
|
{
|
|
Array<JsonValue> resourcesJsonList(m_resources.size());
|
|
for(unsigned resourcesIndex = 0; resourcesIndex < resourcesJsonList.GetLength(); ++resourcesIndex)
|
|
{
|
|
resourcesJsonList[resourcesIndex].AsString(m_resources[resourcesIndex]);
|
|
}
|
|
payload.WithArray("resources", std::move(resourcesJsonList));
|
|
|
|
}
|
|
|
|
if(m_providerHasBeenSet)
|
|
{
|
|
payload.WithObject("provider", m_provider.Jsonize());
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace EKS
|
|
} // namespace Aws
|