111 lines
2.3 KiB
C++
111 lines
2.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/kendra/model/DescribeDataSourceResult.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
#include <aws/core/AmazonWebServiceResult.h>
|
|
#include <aws/core/utils/StringUtils.h>
|
|
#include <aws/core/utils/UnreferencedParam.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::kendra::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
using namespace Aws;
|
|
|
|
DescribeDataSourceResult::DescribeDataSourceResult() :
|
|
m_type(DataSourceType::NOT_SET),
|
|
m_status(DataSourceStatus::NOT_SET)
|
|
{
|
|
}
|
|
|
|
DescribeDataSourceResult::DescribeDataSourceResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
|
|
m_type(DataSourceType::NOT_SET),
|
|
m_status(DataSourceStatus::NOT_SET)
|
|
{
|
|
*this = result;
|
|
}
|
|
|
|
DescribeDataSourceResult& DescribeDataSourceResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
|
|
{
|
|
JsonView jsonValue = result.GetPayload().View();
|
|
if(jsonValue.ValueExists("Id"))
|
|
{
|
|
m_id = jsonValue.GetString("Id");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("IndexId"))
|
|
{
|
|
m_indexId = jsonValue.GetString("IndexId");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Name"))
|
|
{
|
|
m_name = jsonValue.GetString("Name");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Type"))
|
|
{
|
|
m_type = DataSourceTypeMapper::GetDataSourceTypeForName(jsonValue.GetString("Type"));
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Configuration"))
|
|
{
|
|
m_configuration = jsonValue.GetObject("Configuration");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("CreatedAt"))
|
|
{
|
|
m_createdAt = jsonValue.GetDouble("CreatedAt");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("UpdatedAt"))
|
|
{
|
|
m_updatedAt = jsonValue.GetDouble("UpdatedAt");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Description"))
|
|
{
|
|
m_description = jsonValue.GetString("Description");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Status"))
|
|
{
|
|
m_status = DataSourceStatusMapper::GetDataSourceStatusForName(jsonValue.GetString("Status"));
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Schedule"))
|
|
{
|
|
m_schedule = jsonValue.GetString("Schedule");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("RoleArn"))
|
|
{
|
|
m_roleArn = jsonValue.GetString("RoleArn");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ErrorMessage"))
|
|
{
|
|
m_errorMessage = jsonValue.GetString("ErrorMessage");
|
|
|
|
}
|
|
|
|
|
|
|
|
return *this;
|
|
}
|