UpdateItemRequest in the C++ SDK does not include SetReturnValuesOnConditionalCheckFailure

0

The recent news article "Amazon DynamoDB now simplifies and lowers the cost of handling failed conditional writes" (June 2023; [https://aws.amazon.com/about-aws/whats-new/2023/06/amazon-dynamodb-cost-failed-conditional-writes/]) says that the new ReturnValuesOnConditionCheckFailure parameter "is available in all AWS Regions and supported in all the AWS SDKs.."

However it doesn't seem to be in the C++ SDK... has this not been added yet, or am I missing something? (I have re-run vcpkg install "aws-sdk-cpp[dynamodb, ...] to ensure that I have the latest SDK version).

Liam
asked 8 months ago161 views
1 Answer
1
Accepted Answer

It is part of the C++ SDK as can be seen here in verision AWS SDK for C++ Version 1.11.180:

https://sdk.amazonaws.com/cpp/api/LATEST/aws-cpp-sdk-dynamodb/html/namespace_aws_1_1_dynamo_d_b_1_1_model.html#a1c72bcfe2e6857016f7aa40cf6a84d0c

#pragma once
#include <aws/dynamodb/DynamoDB_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
 
namespace Aws
{
namespace DynamoDB
{
namespace Model
{
  enum class ReturnValuesOnConditionCheckFailure
  {
    NOT_SET,
    ALL_OLD,
    NONE
  };
 
namespace ReturnValuesOnConditionCheckFailureMapper
{
AWS_DYNAMODB_API ReturnValuesOnConditionCheckFailure GetReturnValuesOnConditionCheckFailureForName(const Aws::String& name);
 
AWS_DYNAMODB_API Aws::String GetNameForReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure value);
} // namespace ReturnValuesOnConditionCheckFailureMapper
} // namespace Model
} // namespace DynamoDB
} // namespace Aws
profile pictureAWS
EXPERT
answered 8 months ago
  • Hi Leeroy, thanks for your answer. I was able to see the 'ReturnValuesOnConditionCheckFailure' but not a method on the UpdateItemRequest that allows me to set it (as there is for "SetReturnValues" or "SetReturnConsumedCapacity"). It looks as if my version of vcpkg itself was out-of-date, which in turn meant it wasn't downloading the latest AWS SDK. I'm updating now, so hopefully that will give me the latest SDK and I'll be able to see that method. Thanks for your help...

  • Hi again Leeroy; I've now updated my vkpg installation and have the 1.11.169 version of the SDK. I can now access the "SetReturnValuesOnConditionCheckFailure" method of the UpdateItemRequest, which is great - but I still have two problems:

    1. The NOT_SET value of ReturnValuesOnConditionCheckFailure can't be used (it's in the enumeration, but not in the documentation, and I get a ValidationException error response when I try to use it - I figured this ought to return the attributes that could not be set).
    2. When I use the ALL_OLD value, and my UpdateItem command fails because of a conditional check, the outcome gives me an error of CONDITIONAL_CHECK_FAILED but there is nothing in the 'outcome' response containing details of the item in the database that failed to update. The only place I could see which looked correct was outcome.GetResult().GetAttribute(), but that is empty. Do you have any idea what could be going on here or how I should get the details of the item that failed to update? Many thanks Liam

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions