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/Instance.cpp

98 lines
1.9 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/servicediscovery/model/Instance.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
{
Instance::Instance() :
m_idHasBeenSet(false),
m_creatorRequestIdHasBeenSet(false),
m_attributesHasBeenSet(false)
{
}
Instance::Instance(JsonView jsonValue) :
m_idHasBeenSet(false),
m_creatorRequestIdHasBeenSet(false),
m_attributesHasBeenSet(false)
{
*this = jsonValue;
}
Instance& Instance::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Id"))
{
m_id = jsonValue.GetString("Id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("CreatorRequestId"))
{
m_creatorRequestId = jsonValue.GetString("CreatorRequestId");
m_creatorRequestIdHasBeenSet = true;
}
if(jsonValue.ValueExists("Attributes"))
{
Aws::Map<Aws::String, JsonView> attributesJsonMap = jsonValue.GetObject("Attributes").GetAllObjects();
for(auto& attributesItem : attributesJsonMap)
{
m_attributes[attributesItem.first] = attributesItem.second.AsString();
}
m_attributesHasBeenSet = true;
}
return *this;
}
JsonValue Instance::Jsonize() const
{
JsonValue payload;
if(m_idHasBeenSet)
{
payload.WithString("Id", m_id);
}
if(m_creatorRequestIdHasBeenSet)
{
payload.WithString("CreatorRequestId", m_creatorRequestId);
}
if(m_attributesHasBeenSet)
{
JsonValue attributesJsonMap;
for(auto& attributesItem : m_attributes)
{
attributesJsonMap.WithString(attributesItem.first, attributesItem.second);
}
payload.WithObject("Attributes", std::move(attributesJsonMap));
}
return payload;
}
} // namespace Model
} // namespace ServiceDiscovery
} // namespace Aws