AWS SDK for C++  1.9.1
AWS SDK for C++
AttributeValue.h
Go to the documentation of this file.
1 
6 #pragma once
7 
11 #include <aws/core/utils/Array.h>
13 
14 namespace Aws
15 {
16 namespace DynamoDB
17 {
18 namespace Model
19 {
20 class AttributeValueValue;
21 
22 enum class ValueType {STRING, NUMBER, BYTEBUFFER, STRING_SET, NUMBER_SET, BYTEBUFFER_SET, ATTRIBUTE_MAP, ATTRIBUTE_LIST, BOOL, NULLVALUE};
23 
26 {
27 public:
29  explicit AttributeValue(const Aws::String& s) { SetS(s); }
30  explicit AttributeValue(const Aws::Vector<Aws::String>& ss) { SetSS(ss); }
31  AttributeValue(Aws::Utils::Json::JsonView jsonValue) { *this = jsonValue; }
32 
34  const Aws::String GetS() const;
41  AttributeValue& SetS(const char* n) { return SetS(Aws::String(n)); }
42 
44  const Aws::String GetN() const;
52  AttributeValue& SetN(const char* n) { return SetN(Aws::String(n)); }
56  AttributeValue& SetN(const int nItem) { return SetN(Aws::String(std::to_string(nItem).c_str())); }
60  AttributeValue& SetN(const float nItem) { return SetN(Aws::String(std::to_string(nItem).c_str())); }
64  AttributeValue& SetN(const double nItem) { return SetN(Aws::String(std::to_string(nItem).c_str())); }
65 
72 
86  AttributeValue& AddSItem(const char* sItem) { return AddSItem(Aws::String(sItem)); }
87 
101  AttributeValue& AddNItem(const char* nItem) { return AddNItem(Aws::String(nItem)); }
102 
116  AttributeValue& AddBItem(const unsigned char* bItem, size_t size);
117 
123  AttributeValue& SetM(const Aws::Map<Aws::String, const std::shared_ptr<AttributeValue>>& map);
127  AttributeValue& AddMEntry(const Aws::String& key, const std::shared_ptr<AttributeValue>& value);
131  AttributeValue& AddMEntry(const char* key, const std::shared_ptr<AttributeValue>& value) { return AddMEntry(Aws::String(key), value); }
132 
138  AttributeValue& SetL(const Aws::Vector<std::shared_ptr<AttributeValue>>& list);
142  AttributeValue& AddLItem(const std::shared_ptr<AttributeValue>& listItem);
143 
145  bool GetBool() const;
149  AttributeValue& SetBool(bool value);
150 
152  bool GetNull() const;
156  AttributeValue& SetNull(bool value);
157 
159 
160  bool operator == (const AttributeValue& other) const;
161  inline bool operator != (const AttributeValue& other) const { return !(*this == other); }
162 
166 
167 private:
168  std::shared_ptr<AttributeValueValue> m_value;
169 };
170 
171 } // namespace Model
172 } // namespace DynamoDB
173 } // namespace Aws
Aws::DynamoDB::Model::AttributeValue::GetType
ValueType GetType() const
Aws::DynamoDB::Model::AttributeValue::AddBItem
AttributeValue & AddBItem(const Aws::Utils::ByteBuffer &bItem)
Aws::DynamoDB::Model::AttributeValue::AddNItem
AttributeValue & AddNItem(const Aws::String &nItem)
Aws::DynamoDB::Model::AttributeValue::SetSS
AttributeValue & SetSS(const Aws::Vector< Aws::String > &ss)
Aws::DynamoDB::Model::AttributeValue::SetBool
AttributeValue & SetBool(bool value)
Aws::DynamoDB::Model::AttributeValue::SetL
AttributeValue & SetL(const Aws::Vector< std::shared_ptr< AttributeValue >> &list)
Aws::DynamoDB::Model::AttributeValue::AddMEntry
AttributeValue & AddMEntry(const char *key, const std::shared_ptr< AttributeValue > &value)
Definition: AttributeValue.h:131
Aws::DynamoDB::Model::AttributeValue::SetN
AttributeValue & SetN(const float nItem)
Definition: AttributeValue.h:60
Aws::DynamoDB::Model::AttributeValue::SetNS
AttributeValue & SetNS(const Aws::Vector< Aws::String > &ns)
Aws::DynamoDB::Model::AttributeValue::SetN
AttributeValue & SetN(const int nItem)
Definition: AttributeValue.h:56
Aws::DynamoDB::Model::AttributeValue
http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html
Definition: AttributeValue.h:26
Aws::DynamoDB::Model::AttributeValue::SetBS
AttributeValue & SetBS(const Aws::Vector< Aws::Utils::ByteBuffer > &bs)
Aws::DynamoDB::Model::AttributeValue::GetL
const Aws::Vector< std::shared_ptr< AttributeValue > > GetL() const
returns the Attribute List if the value is specialized to this type, otherwise an empty Vector
Aws::DynamoDB::Model::AttributeValue::AddSItem
AttributeValue & AddSItem(const Aws::String &sItem)
Aws::Vector
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:17
Aws::DynamoDB::Model::AttributeValue::SetB
AttributeValue & SetB(const Aws::Utils::ByteBuffer &b)
Aws::DynamoDB::Model::AttributeValue::AttributeValue
AttributeValue()
Definition: AttributeValue.h:28
AWSVector.h
Aws::DynamoDB::Model::AttributeValue::AddLItem
AttributeValue & AddLItem(const std::shared_ptr< AttributeValue > &listItem)
Aws::DynamoDB::Model::AttributeValue::SetM
AttributeValue & SetM(const Aws::Map< Aws::String, const std::shared_ptr< AttributeValue >> &map)
Aws::DynamoDB::Model::AttributeValue::AddMEntry
AttributeValue & AddMEntry(const Aws::String &key, const std::shared_ptr< AttributeValue > &value)
Aws::DynamoDB::Model::AttributeValue::GetNS
const Aws::Vector< Aws::String > GetNS() const
returns the Number Vector if the value is specialized to this type, otherwise an empty Vector
Aws::DynamoDB::Model::AttributeValue::AddSItem
AttributeValue & AddSItem(const char *sItem)
Definition: AttributeValue.h:86
Aws::DynamoDB::Model::AttributeValue::SetS
AttributeValue & SetS(const char *n)
Definition: AttributeValue.h:41
Aws::DynamoDB::Model::AttributeValue::GetS
const Aws::String GetS() const
returns the String value if the value is specialized to this type, otherwise an empty String
b
const cJSON *const b
Definition: cJSON.h:255
Aws::DynamoDB::Model::ValueType::STRING
@ STRING
Aws::DynamoDB::Model::AttributeValue::SetN
AttributeValue & SetN(const Aws::String &n)
Aws::DynamoDB::Model::AttributeValue::GetBS
const Aws::Vector< Aws::Utils::ByteBuffer > GetBS() const
returns the ByteBuffer Vector if the value is specialized to this type, otherwise an empty Vector
Aws::DynamoDB::Model::AttributeValue::SetN
AttributeValue & SetN(const char *n)
Definition: AttributeValue.h:52
Aws::DynamoDB::Model::AttributeValue::GetB
const Aws::Utils::ByteBuffer GetB() const
returns the ByteBuffer if the value is specialized to this type, otherwise an empty Buffer
Aws::Utils::Json::JsonView
Definition: JsonSerializer.h:222
Aws::Utils::Array< unsigned char >
Aws::DynamoDB::Model::AttributeValue::SerializeAttribute
Aws::String SerializeAttribute() const
AWSString.h
Aws::Utils::Json::JsonValue
Definition: JsonSerializer.h:30
Aws::DynamoDB::Model::AttributeValue::SetNull
AttributeValue & SetNull(bool value)
Aws::DynamoDB::Model::AttributeValue::GetM
const Aws::Map< Aws::String, const std::shared_ptr< AttributeValue > > GetM() const
returns the Attribute Map if the value is specialized to this type, otherwise an empty Map
DynamoDB_EXPORTS.h
Aws::DynamoDB::Model::AttributeValue::AddNItem
AttributeValue & AddNItem(const char *nItem)
Definition: AttributeValue.h:101
Aws::DynamoDB::Model::AttributeValue::AttributeValue
AttributeValue(const Aws::Vector< Aws::String > &ss)
Definition: AttributeValue.h:30
Aws::DynamoDB::Model::AttributeValue::GetN
const Aws::String GetN() const
returns the Number value if the value is specialized to this type, otherwise an empty String
Aws
Definition: AccessManagementClient.h:15
Aws::DynamoDB::Model::AttributeValue::GetBool
bool GetBool() const
returns the boolean if the value is specialized to this type, otherwise false
Aws::DynamoDB::Model::AttributeValue::GetNull
bool GetNull() const
returns Null-Set-Value if the value is specialized to this type, otherwise false
Array.h
Aws::DynamoDB::Model::AttributeValue::SetN
AttributeValue & SetN(const double nItem)
Definition: AttributeValue.h:64
Aws::String
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
AWS_DYNAMODB_API
#define AWS_DYNAMODB_API
Definition: DynamoDB_EXPORTS.h:28
Aws::DynamoDB::Model::ValueType
ValueType
Definition: AttributeValue.h:22
Aws::DynamoDB::Model::AttributeValue::AttributeValue
AttributeValue(Aws::Utils::Json::JsonView jsonValue)
Definition: AttributeValue.h:31
Aws::DynamoDB::Model::AttributeValue::AttributeValue
AttributeValue(const Aws::String &s)
Definition: AttributeValue.h:29
Aws::DynamoDB::Model::AttributeValue::SetS
AttributeValue & SetS(const Aws::String &s)
Aws::DynamoDB::Model::AttributeValue::GetSS
const Aws::Vector< Aws::String > GetSS() const
returns the String Vector if the value is specialized to this type, otherwise an empty Vector
JsonSerializer.h
Aws::Map
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
Definition: AWSMap.h:19
Aws::DynamoDB::Model::AttributeValue::AddBItem
AttributeValue & AddBItem(const unsigned char *bItem, size_t size)
Aws::DynamoDB::Model::AttributeValue::Jsonize
Aws::Utils::Json::JsonValue Jsonize() const