91 lines
1.7 KiB
C++
91 lines
1.7 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/codeartifact/model/PackageSummary.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace CodeArtifact
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
PackageSummary::PackageSummary() :
|
|||
|
|
m_format(PackageFormat::NOT_SET),
|
|||
|
|
m_formatHasBeenSet(false),
|
|||
|
|
m_namespaceHasBeenSet(false),
|
|||
|
|
m_packageHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
PackageSummary::PackageSummary(JsonView jsonValue) :
|
|||
|
|
m_format(PackageFormat::NOT_SET),
|
|||
|
|
m_formatHasBeenSet(false),
|
|||
|
|
m_namespaceHasBeenSet(false),
|
|||
|
|
m_packageHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = jsonValue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
PackageSummary& PackageSummary::operator =(JsonView jsonValue)
|
|||
|
|
{
|
|||
|
|
if(jsonValue.ValueExists("format"))
|
|||
|
|
{
|
|||
|
|
m_format = PackageFormatMapper::GetPackageFormatForName(jsonValue.GetString("format"));
|
|||
|
|
|
|||
|
|
m_formatHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("namespace"))
|
|||
|
|
{
|
|||
|
|
m_namespace = jsonValue.GetString("namespace");
|
|||
|
|
|
|||
|
|
m_namespaceHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("package"))
|
|||
|
|
{
|
|||
|
|
m_package = jsonValue.GetString("package");
|
|||
|
|
|
|||
|
|
m_packageHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
JsonValue PackageSummary::Jsonize() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_formatHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("format", PackageFormatMapper::GetNameForPackageFormat(m_format));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_namespaceHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("namespace", m_namespace);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_packageHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("package", m_package);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace CodeArtifact
|
|||
|
|
} // namespace Aws
|