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-servicediscovery/source/model/Namespace.cpp

182 lines
3.4 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/servicediscovery/model/Namespace.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace ServiceDiscovery
{
namespace Model
{
Namespace::Namespace() :
m_idHasBeenSet(false),
m_arnHasBeenSet(false),
m_nameHasBeenSet(false),
m_type(NamespaceType::NOT_SET),
m_typeHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_serviceCount(0),
m_serviceCountHasBeenSet(false),
m_propertiesHasBeenSet(false),
m_createDateHasBeenSet(false),
m_creatorRequestIdHasBeenSet(false)
{
}
Namespace::Namespace(JsonView jsonValue) :
m_idHasBeenSet(false),
m_arnHasBeenSet(false),
m_nameHasBeenSet(false),
m_type(NamespaceType::NOT_SET),
m_typeHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_serviceCount(0),
m_serviceCountHasBeenSet(false),
m_propertiesHasBeenSet(false),
m_createDateHasBeenSet(false),
m_creatorRequestIdHasBeenSet(false)
{
*this = jsonValue;
}
Namespace& Namespace::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Id"))
{
m_id = jsonValue.GetString("Id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("Arn"))
{
m_arn = jsonValue.GetString("Arn");
m_arnHasBeenSet = true;
}
if(jsonValue.ValueExists("Name"))
{
m_name = jsonValue.GetString("Name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("Type"))
{
m_type = NamespaceTypeMapper::GetNamespaceTypeForName(jsonValue.GetString("Type"));
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("ServiceCount"))
{
m_serviceCount = jsonValue.GetInteger("ServiceCount");
m_serviceCountHasBeenSet = true;
}
if(jsonValue.ValueExists("Properties"))
{
m_properties = jsonValue.GetObject("Properties");
m_propertiesHasBeenSet = true;
}
if(jsonValue.ValueExists("CreateDate"))
{
m_createDate = jsonValue.GetDouble("CreateDate");
m_createDateHasBeenSet = true;
}
if(jsonValue.ValueExists("CreatorRequestId"))
{
m_creatorRequestId = jsonValue.GetString("CreatorRequestId");
m_creatorRequestIdHasBeenSet = true;
}
return *this;
}
JsonValue Namespace::Jsonize() const
{
JsonValue payload;
if(m_idHasBeenSet)
{
payload.WithString("Id", m_id);
}
if(m_arnHasBeenSet)
{
payload.WithString("Arn", m_arn);
}
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_typeHasBeenSet)
{
payload.WithString("Type", NamespaceTypeMapper::GetNameForNamespaceType(m_type));
}
if(m_descriptionHasBeenSet)
{
payload.WithString("Description", m_description);
}
if(m_serviceCountHasBeenSet)
{
payload.WithInteger("ServiceCount", m_serviceCount);
}
if(m_propertiesHasBeenSet)
{
payload.WithObject("Properties", m_properties.Jsonize());
}
if(m_createDateHasBeenSet)
{
payload.WithDouble("CreateDate", m_createDate.SecondsWithMSPrecision());
}
if(m_creatorRequestIdHasBeenSet)
{
payload.WithString("CreatorRequestId", m_creatorRequestId);
}
return payload;
}
} // namespace Model
} // namespace ServiceDiscovery
} // namespace Aws