AWS SDK for C++  0.14.3
AWS SDK for C++
AttributeValue.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
16 
20 #include <aws/core/utils/Array.h>
22 
23 namespace Aws
24 {
25 namespace DynamoDB
26 {
27 namespace Model
28 {
29 class AttributeValueValue;
30 
33 {
34 public:
36  explicit AttributeValue(const Aws::String& s) { SetS(s); }
37  explicit AttributeValue(const Aws::Vector<Aws::String>& ss) { SetSS(ss); }
38  AttributeValue(const Aws::Utils::Json::JsonValue& jsonValue) { *this = jsonValue; }
39 
41  const Aws::String& GetS() const;
45  AttributeValue& SetS(const Aws::String& s);
48  AttributeValue& SetS(const char* n) { return SetS(Aws::String(n)); }
49 
51  const Aws::String& GetN() const;
55  AttributeValue& SetN(const Aws::String& n);
59  AttributeValue& SetN(const char* n) { return SetN(Aws::String(n)); }
60 
62  const Aws::Utils::ByteBuffer& GetB() const;
66  AttributeValue& SetB(const Aws::Utils::ByteBuffer& b);
67 
69  const Aws::Vector<Aws::String>& GetSS() const;
73  AttributeValue& SetSS(const Aws::Vector<Aws::String>& ss);
77  AttributeValue& AddSItem(const Aws::String& sItem);
81  AttributeValue& AddSItem(const char* sItem) { return AddSItem(Aws::String(sItem)); }
82 
84  const Aws::Vector<Aws::String>& GetNS() const;
88  AttributeValue& SetNS(const Aws::Vector<Aws::String>& ns);
92  AttributeValue& AddNItem(const Aws::String& nItem);
96  AttributeValue& AddNItem(const char* nItem) { return AddNItem(Aws::String(nItem)); }
97 
99  const Aws::Vector<Aws::Utils::ByteBuffer>& GetBS() const;
107  AttributeValue& AddBItem(const Aws::Utils::ByteBuffer& bItem);
111  AttributeValue& AddBItem(const unsigned char* bItem, size_t size);
112 
118  AttributeValue& SetM(const Aws::Map<Aws::String, const std::shared_ptr<AttributeValue>>& map);
122  AttributeValue& AddMEntry(const Aws::String& key, const std::shared_ptr<AttributeValue>& value);
126  AttributeValue& AddMEntry(const char* key, const std::shared_ptr<AttributeValue>& value) { return AddMEntry(Aws::String(key), value); }
127 
129  const Aws::Vector<std::shared_ptr<AttributeValue>>& GetL() const;
133  AttributeValue& SetL(const Aws::Vector<std::shared_ptr<AttributeValue>>& list);
137  AttributeValue& AddLItem(const std::shared_ptr<AttributeValue>& listItem);
138 
140  bool GetBool() const;
144  AttributeValue& SetBool(bool value);
145 
147  bool GetNull() const;
151  AttributeValue& SetNull(bool value);
152 
153  AttributeValue& operator = (const Aws::Utils::Json::JsonValue&);
154 
155  bool operator == (const AttributeValue& other) const;
156  inline bool operator != (const AttributeValue& other) const { return !(*this == other); }
157 
158  Aws::String SerializeAttribute() const;
159  Aws::Utils::Json::JsonValue Jsonize() const;
160 
161 private:
162  std::shared_ptr<AttributeValueValue> m_value;
163 };
164 
165 } // namespace Model
166 } // namespace DynamoDB
167 } // namespace Aws
AttributeValue & AddMEntry(const char *key, const std::shared_ptr< AttributeValue > &value)
AttributeValue & AddNItem(const char *nItem)
AttributeValue(const Aws::Utils::Json::JsonValue &jsonValue)
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
Definition: AWSMap.h:28
#define AWS_DYNAMODB_API
AttributeValue & AddSItem(const char *sItem)
AttributeValue(const Aws::String &s)
AttributeValue(const Aws::Vector< Aws::String > &ss)
AttributeValue & SetN(const char *n)
http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html ...
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
AttributeValue & SetS(const char *n)
JSON (JavaScript Object Notation).