/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::DynamoDB::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; ExecuteStatementRequest::ExecuteStatementRequest() : m_statementHasBeenSet(false), m_parametersHasBeenSet(false), m_consistentRead(false), m_consistentReadHasBeenSet(false), m_nextTokenHasBeenSet(false), m_returnConsumedCapacity(ReturnConsumedCapacity::NOT_SET), m_returnConsumedCapacityHasBeenSet(false), m_limit(0), m_limitHasBeenSet(false), m_returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure::NOT_SET), m_returnValuesOnConditionCheckFailureHasBeenSet(false) { } Aws::String ExecuteStatementRequest::SerializePayload() 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_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } if(m_returnConsumedCapacityHasBeenSet) { payload.WithString("ReturnConsumedCapacity", ReturnConsumedCapacityMapper::GetNameForReturnConsumedCapacity(m_returnConsumedCapacity)); } if(m_limitHasBeenSet) { payload.WithInteger("Limit", m_limit); } if(m_returnValuesOnConditionCheckFailureHasBeenSet) { payload.WithString("ReturnValuesOnConditionCheckFailure", ReturnValuesOnConditionCheckFailureMapper::GetNameForReturnValuesOnConditionCheckFailure(m_returnValuesOnConditionCheckFailure)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection ExecuteStatementRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "DynamoDB_20120810.ExecuteStatement")); return headers; }