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-mq/source/model/BrokerInstance.cpp

98 lines
2.0 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/mq/model/BrokerInstance.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace MQ
{
namespace Model
{
BrokerInstance::BrokerInstance() :
m_consoleURLHasBeenSet(false),
m_endpointsHasBeenSet(false),
m_ipAddressHasBeenSet(false)
{
}
BrokerInstance::BrokerInstance(JsonView jsonValue) :
m_consoleURLHasBeenSet(false),
m_endpointsHasBeenSet(false),
m_ipAddressHasBeenSet(false)
{
*this = jsonValue;
}
BrokerInstance& BrokerInstance::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("consoleURL"))
{
m_consoleURL = jsonValue.GetString("consoleURL");
m_consoleURLHasBeenSet = true;
}
if(jsonValue.ValueExists("endpoints"))
{
Array<JsonView> endpointsJsonList = jsonValue.GetArray("endpoints");
for(unsigned endpointsIndex = 0; endpointsIndex < endpointsJsonList.GetLength(); ++endpointsIndex)
{
m_endpoints.push_back(endpointsJsonList[endpointsIndex].AsString());
}
m_endpointsHasBeenSet = true;
}
if(jsonValue.ValueExists("ipAddress"))
{
m_ipAddress = jsonValue.GetString("ipAddress");
m_ipAddressHasBeenSet = true;
}
return *this;
}
JsonValue BrokerInstance::Jsonize() const
{
JsonValue payload;
if(m_consoleURLHasBeenSet)
{
payload.WithString("consoleURL", m_consoleURL);
}
if(m_endpointsHasBeenSet)
{
Array<JsonValue> endpointsJsonList(m_endpoints.size());
for(unsigned endpointsIndex = 0; endpointsIndex < endpointsJsonList.GetLength(); ++endpointsIndex)
{
endpointsJsonList[endpointsIndex].AsString(m_endpoints[endpointsIndex]);
}
payload.WithArray("endpoints", std::move(endpointsJsonList));
}
if(m_ipAddressHasBeenSet)
{
payload.WithString("ipAddress", m_ipAddress);
}
return payload;
}
} // namespace Model
} // namespace MQ
} // namespace Aws