/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace DynamoDB { namespace Model { BatchStatementRequest::BatchStatementRequest() : m_statementHasBeenSet(false), m_parametersHasBeenSet(false), m_consistentRead(false), m_consistentReadHasBeenSet(false), m_returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure::NOT_SET), m_returnValuesOnConditionCheckFailureHasBeenSet(false) { } BatchStatementRequest::BatchStatementRequest(JsonView jsonValue) : m_statementHasBeenSet(false), m_parametersHasBeenSet(false), m_consistentRead(false), m_consistentReadHasBeenSet(false), m_returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure::NOT_SET), m_returnValuesOnConditionCheckFailureHasBeenSet(false) { *this = jsonValue; } BatchStatementRequest& BatchStatementRequest::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Statement")) { m_statement = jsonValue.GetString("Statement"); m_statementHasBeenSet = true; } if(jsonValue.ValueExists("Parameters")) { Aws::Utils::Array parametersJsonList = jsonValue.GetArray("Parameters"); for(unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { m_parameters.push_back(parametersJsonList[parametersIndex].AsObject()); } m_parametersHasBeenSet = true; } if(jsonValue.ValueExists("ConsistentRead")) { m_consistentRead = jsonValue.GetBool("ConsistentRead"); m_consistentReadHasBeenSet = true; } if(jsonValue.ValueExists("ReturnValuesOnConditionCheckFailure")) { m_returnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailureMapper::GetReturnValuesOnConditionCheckFailureForName(jsonValue.GetString("ReturnValuesOnConditionCheckFailure")); m_returnValuesOnConditionCheckFailureHasBeenSet = true; } return *this; } JsonValue BatchStatementRequest::Jsonize() const { JsonValue payload; if(m_statementHasBeenSet) { payload.WithString("Statement", m_statement); } if(m_parametersHasBeenSet) { Aws::Utils::Array parametersJsonList(m_parameters.size()); for(unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex) { parametersJsonList[parametersIndex].AsObject(m_parameters[parametersIndex].Jsonize()); } payload.WithArray("Parameters", std::move(parametersJsonList)); } if(m_consistentReadHasBeenSet) { payload.WithBool("ConsistentRead", m_consistentRead); } if(m_returnValuesOnConditionCheckFailureHasBeenSet) { payload.WithString("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); } return payload; } } // namespace Model } // namespace DynamoDB } // namespace Aws