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-dynamodb/source/model/Condition.cpp

84 lines
2.2 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/dynamodb/model/Condition.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace DynamoDB
{
namespace Model
{
Condition::Condition() :
m_attributeValueListHasBeenSet(false),
m_comparisonOperator(ComparisonOperator::NOT_SET),
m_comparisonOperatorHasBeenSet(false)
{
}
Condition::Condition(JsonView jsonValue) :
m_attributeValueListHasBeenSet(false),
m_comparisonOperator(ComparisonOperator::NOT_SET),
m_comparisonOperatorHasBeenSet(false)
{
*this = jsonValue;
}
Condition& Condition::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("AttributeValueList"))
{
Array<JsonView> attributeValueListJsonList = jsonValue.GetArray("AttributeValueList");
for(unsigned attributeValueListIndex = 0; attributeValueListIndex < attributeValueListJsonList.GetLength(); ++attributeValueListIndex)
{
m_attributeValueList.push_back(attributeValueListJsonList[attributeValueListIndex].AsObject());
}
m_attributeValueListHasBeenSet = true;
}
if(jsonValue.ValueExists("ComparisonOperator"))
{
m_comparisonOperator = ComparisonOperatorMapper::GetComparisonOperatorForName(jsonValue.GetString("ComparisonOperator"));
m_comparisonOperatorHasBeenSet = true;
}
return *this;
}
JsonValue Condition::Jsonize() const
{
JsonValue payload;
if(m_attributeValueListHasBeenSet)
{
Array<JsonValue> attributeValueListJsonList(m_attributeValueList.size());
for(unsigned attributeValueListIndex = 0; attributeValueListIndex < attributeValueListJsonList.GetLength(); ++attributeValueListIndex)
{
attributeValueListJsonList[attributeValueListIndex].AsObject(m_attributeValueList[attributeValueListIndex].Jsonize());
}
payload.WithArray("AttributeValueList", std::move(attributeValueListJsonList));
}
if(m_comparisonOperatorHasBeenSet)
{
payload.WithString("ComparisonOperator", ComparisonOperatorMapper::GetNameForComparisonOperator(m_comparisonOperator));
}
return payload;
}
} // namespace Model
} // namespace DynamoDB
} // namespace Aws