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-quicksight/source/model/ThemeVersion.cpp

175 lines
3.7 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/quicksight/model/ThemeVersion.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace QuickSight
{
namespace Model
{
ThemeVersion::ThemeVersion() :
m_versionNumber(0),
m_versionNumberHasBeenSet(false),
m_arnHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_baseThemeIdHasBeenSet(false),
m_createdTimeHasBeenSet(false),
m_configurationHasBeenSet(false),
m_errorsHasBeenSet(false),
m_status(ResourceStatus::NOT_SET),
m_statusHasBeenSet(false)
{
}
ThemeVersion::ThemeVersion(JsonView jsonValue) :
m_versionNumber(0),
m_versionNumberHasBeenSet(false),
m_arnHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_baseThemeIdHasBeenSet(false),
m_createdTimeHasBeenSet(false),
m_configurationHasBeenSet(false),
m_errorsHasBeenSet(false),
m_status(ResourceStatus::NOT_SET),
m_statusHasBeenSet(false)
{
*this = jsonValue;
}
ThemeVersion& ThemeVersion::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("VersionNumber"))
{
m_versionNumber = jsonValue.GetInt64("VersionNumber");
m_versionNumberHasBeenSet = true;
}
if(jsonValue.ValueExists("Arn"))
{
m_arn = jsonValue.GetString("Arn");
m_arnHasBeenSet = true;
}
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("BaseThemeId"))
{
m_baseThemeId = jsonValue.GetString("BaseThemeId");
m_baseThemeIdHasBeenSet = true;
}
if(jsonValue.ValueExists("CreatedTime"))
{
m_createdTime = jsonValue.GetDouble("CreatedTime");
m_createdTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("Configuration"))
{
m_configuration = jsonValue.GetObject("Configuration");
m_configurationHasBeenSet = true;
}
if(jsonValue.ValueExists("Errors"))
{
Array<JsonView> errorsJsonList = jsonValue.GetArray("Errors");
for(unsigned errorsIndex = 0; errorsIndex < errorsJsonList.GetLength(); ++errorsIndex)
{
m_errors.push_back(errorsJsonList[errorsIndex].AsObject());
}
m_errorsHasBeenSet = true;
}
if(jsonValue.ValueExists("Status"))
{
m_status = ResourceStatusMapper::GetResourceStatusForName(jsonValue.GetString("Status"));
m_statusHasBeenSet = true;
}
return *this;
}
JsonValue ThemeVersion::Jsonize() const
{
JsonValue payload;
if(m_versionNumberHasBeenSet)
{
payload.WithInt64("VersionNumber", m_versionNumber);
}
if(m_arnHasBeenSet)
{
payload.WithString("Arn", m_arn);
}
if(m_descriptionHasBeenSet)
{
payload.WithString("Description", m_description);
}
if(m_baseThemeIdHasBeenSet)
{
payload.WithString("BaseThemeId", m_baseThemeId);
}
if(m_createdTimeHasBeenSet)
{
payload.WithDouble("CreatedTime", m_createdTime.SecondsWithMSPrecision());
}
if(m_configurationHasBeenSet)
{
payload.WithObject("Configuration", m_configuration.Jsonize());
}
if(m_errorsHasBeenSet)
{
Array<JsonValue> errorsJsonList(m_errors.size());
for(unsigned errorsIndex = 0; errorsIndex < errorsJsonList.GetLength(); ++errorsIndex)
{
errorsJsonList[errorsIndex].AsObject(m_errors[errorsIndex].Jsonize());
}
payload.WithArray("Errors", std::move(errorsJsonList));
}
if(m_statusHasBeenSet)
{
payload.WithString("Status", ResourceStatusMapper::GetNameForResourceStatus(m_status));
}
return payload;
}
} // namespace Model
} // namespace QuickSight
} // namespace Aws