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-kendra/source/model/DataSourceSummary.cpp

135 lines
2.6 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/kendra/model/DataSourceSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace kendra
{
namespace Model
{
DataSourceSummary::DataSourceSummary() :
m_nameHasBeenSet(false),
m_idHasBeenSet(false),
m_type(DataSourceType::NOT_SET),
m_typeHasBeenSet(false),
m_createdAtHasBeenSet(false),
m_updatedAtHasBeenSet(false),
m_status(DataSourceStatus::NOT_SET),
m_statusHasBeenSet(false)
{
}
DataSourceSummary::DataSourceSummary(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_idHasBeenSet(false),
m_type(DataSourceType::NOT_SET),
m_typeHasBeenSet(false),
m_createdAtHasBeenSet(false),
m_updatedAtHasBeenSet(false),
m_status(DataSourceStatus::NOT_SET),
m_statusHasBeenSet(false)
{
*this = jsonValue;
}
DataSourceSummary& DataSourceSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Name"))
{
m_name = jsonValue.GetString("Name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("Id"))
{
m_id = jsonValue.GetString("Id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("Type"))
{
m_type = DataSourceTypeMapper::GetDataSourceTypeForName(jsonValue.GetString("Type"));
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("CreatedAt"))
{
m_createdAt = jsonValue.GetDouble("CreatedAt");
m_createdAtHasBeenSet = true;
}
if(jsonValue.ValueExists("UpdatedAt"))
{
m_updatedAt = jsonValue.GetDouble("UpdatedAt");
m_updatedAtHasBeenSet = true;
}
if(jsonValue.ValueExists("Status"))
{
m_status = DataSourceStatusMapper::GetDataSourceStatusForName(jsonValue.GetString("Status"));
m_statusHasBeenSet = true;
}
return *this;
}
JsonValue DataSourceSummary::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_idHasBeenSet)
{
payload.WithString("Id", m_id);
}
if(m_typeHasBeenSet)
{
payload.WithString("Type", DataSourceTypeMapper::GetNameForDataSourceType(m_type));
}
if(m_createdAtHasBeenSet)
{
payload.WithDouble("CreatedAt", m_createdAt.SecondsWithMSPrecision());
}
if(m_updatedAtHasBeenSet)
{
payload.WithDouble("UpdatedAt", m_updatedAt.SecondsWithMSPrecision());
}
if(m_statusHasBeenSet)
{
payload.WithString("Status", DataSourceStatusMapper::GetNameForDataSourceStatus(m_status));
}
return payload;
}
} // namespace Model
} // namespace kendra
} // namespace Aws