128 lines
2.7 KiB
C++
128 lines
2.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/lightsail/model/CertificateSummary.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace Lightsail
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
CertificateSummary::CertificateSummary() :
|
|
m_certificateArnHasBeenSet(false),
|
|
m_certificateNameHasBeenSet(false),
|
|
m_domainNameHasBeenSet(false),
|
|
m_certificateDetailHasBeenSet(false),
|
|
m_tagsHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
CertificateSummary::CertificateSummary(JsonView jsonValue) :
|
|
m_certificateArnHasBeenSet(false),
|
|
m_certificateNameHasBeenSet(false),
|
|
m_domainNameHasBeenSet(false),
|
|
m_certificateDetailHasBeenSet(false),
|
|
m_tagsHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
CertificateSummary& CertificateSummary::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("certificateArn"))
|
|
{
|
|
m_certificateArn = jsonValue.GetString("certificateArn");
|
|
|
|
m_certificateArnHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("certificateName"))
|
|
{
|
|
m_certificateName = jsonValue.GetString("certificateName");
|
|
|
|
m_certificateNameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("domainName"))
|
|
{
|
|
m_domainName = jsonValue.GetString("domainName");
|
|
|
|
m_domainNameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("certificateDetail"))
|
|
{
|
|
m_certificateDetail = jsonValue.GetObject("certificateDetail");
|
|
|
|
m_certificateDetailHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("tags"))
|
|
{
|
|
Array<JsonView> tagsJsonList = jsonValue.GetArray("tags");
|
|
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
|
|
{
|
|
m_tags.push_back(tagsJsonList[tagsIndex].AsObject());
|
|
}
|
|
m_tagsHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue CertificateSummary::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_certificateArnHasBeenSet)
|
|
{
|
|
payload.WithString("certificateArn", m_certificateArn);
|
|
|
|
}
|
|
|
|
if(m_certificateNameHasBeenSet)
|
|
{
|
|
payload.WithString("certificateName", m_certificateName);
|
|
|
|
}
|
|
|
|
if(m_domainNameHasBeenSet)
|
|
{
|
|
payload.WithString("domainName", m_domainName);
|
|
|
|
}
|
|
|
|
if(m_certificateDetailHasBeenSet)
|
|
{
|
|
payload.WithObject("certificateDetail", m_certificateDetail.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_tagsHasBeenSet)
|
|
{
|
|
Array<JsonValue> tagsJsonList(m_tags.size());
|
|
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
|
|
{
|
|
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
|
|
}
|
|
payload.WithArray("tags", std::move(tagsJsonList));
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace Lightsail
|
|
} // namespace Aws
|