98 lines
2.0 KiB
C++
98 lines
2.0 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/glue/model/S3Target.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace Glue
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
S3Target::S3Target() :
|
|
m_pathHasBeenSet(false),
|
|
m_exclusionsHasBeenSet(false),
|
|
m_connectionNameHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
S3Target::S3Target(JsonView jsonValue) :
|
|
m_pathHasBeenSet(false),
|
|
m_exclusionsHasBeenSet(false),
|
|
m_connectionNameHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
S3Target& S3Target::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("Path"))
|
|
{
|
|
m_path = jsonValue.GetString("Path");
|
|
|
|
m_pathHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Exclusions"))
|
|
{
|
|
Array<JsonView> exclusionsJsonList = jsonValue.GetArray("Exclusions");
|
|
for(unsigned exclusionsIndex = 0; exclusionsIndex < exclusionsJsonList.GetLength(); ++exclusionsIndex)
|
|
{
|
|
m_exclusions.push_back(exclusionsJsonList[exclusionsIndex].AsString());
|
|
}
|
|
m_exclusionsHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ConnectionName"))
|
|
{
|
|
m_connectionName = jsonValue.GetString("ConnectionName");
|
|
|
|
m_connectionNameHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue S3Target::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_pathHasBeenSet)
|
|
{
|
|
payload.WithString("Path", m_path);
|
|
|
|
}
|
|
|
|
if(m_exclusionsHasBeenSet)
|
|
{
|
|
Array<JsonValue> exclusionsJsonList(m_exclusions.size());
|
|
for(unsigned exclusionsIndex = 0; exclusionsIndex < exclusionsJsonList.GetLength(); ++exclusionsIndex)
|
|
{
|
|
exclusionsJsonList[exclusionsIndex].AsString(m_exclusions[exclusionsIndex]);
|
|
}
|
|
payload.WithArray("Exclusions", std::move(exclusionsJsonList));
|
|
|
|
}
|
|
|
|
if(m_connectionNameHasBeenSet)
|
|
{
|
|
payload.WithString("ConnectionName", m_connectionName);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace Glue
|
|
} // namespace Aws
|