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-rds-data/source/model/StructValue.cpp

69 lines
1.5 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/rds-data/model/StructValue.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/rds-data/model/Value.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace RDSDataService
{
namespace Model
{
StructValue::StructValue() :
m_attributesHasBeenSet(false)
{
}
StructValue::StructValue(JsonView jsonValue) :
m_attributesHasBeenSet(false)
{
*this = jsonValue;
}
StructValue& StructValue::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("attributes"))
{
Array<JsonView> attributesJsonList = jsonValue.GetArray("attributes");
for(unsigned attributesIndex = 0; attributesIndex < attributesJsonList.GetLength(); ++attributesIndex)
{
m_attributes.push_back(attributesJsonList[attributesIndex].AsObject());
}
m_attributesHasBeenSet = true;
}
return *this;
}
JsonValue StructValue::Jsonize() const
{
JsonValue payload;
if(m_attributesHasBeenSet)
{
Array<JsonValue> attributesJsonList(m_attributes.size());
for(unsigned attributesIndex = 0; attributesIndex < attributesJsonList.GetLength(); ++attributesIndex)
{
attributesJsonList[attributesIndex].AsObject(m_attributes[attributesIndex].Jsonize());
}
payload.WithArray("attributes", std::move(attributesJsonList));
}
return payload;
}
} // namespace Model
} // namespace RDSDataService
} // namespace Aws