AWS SDK for C++  0.12.9
AWS SDK for C++
EncryptRequest.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 #include <aws/kms/KMS_EXPORTS.h>
17 #include <aws/kms/KMSRequest.h>
19 #include <aws/core/utils/Array.h>
22 
23 namespace Aws
24 {
25 namespace KMS
26 {
27 namespace Model
28 {
29 
33  {
34  public:
36  Aws::String SerializePayload() const override;
37 
38  Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
39 
50  inline const Aws::String& GetKeyId() const{ return m_keyId; }
51 
62  inline void SetKeyId(const Aws::String& value) { m_keyIdHasBeenSet = true; m_keyId = value; }
63 
74  inline void SetKeyId(Aws::String&& value) { m_keyIdHasBeenSet = true; m_keyId = value; }
75 
86  inline void SetKeyId(const char* value) { m_keyIdHasBeenSet = true; m_keyId.assign(value); }
87 
98  inline EncryptRequest& WithKeyId(const Aws::String& value) { SetKeyId(value); return *this;}
99 
110  inline EncryptRequest& WithKeyId(Aws::String&& value) { SetKeyId(value); return *this;}
111 
122  inline EncryptRequest& WithKeyId(const char* value) { SetKeyId(value); return *this;}
123 
127  inline const Aws::Utils::ByteBuffer& GetPlaintext() const{ return m_plaintext; }
128 
132  inline void SetPlaintext(const Aws::Utils::ByteBuffer& value) { m_plaintextHasBeenSet = true; m_plaintext = value; }
133 
137  inline void SetPlaintext(Aws::Utils::ByteBuffer&& value) { m_plaintextHasBeenSet = true; m_plaintext = value; }
138 
142  inline EncryptRequest& WithPlaintext(const Aws::Utils::ByteBuffer& value) { SetPlaintext(value); return *this;}
143 
147  inline EncryptRequest& WithPlaintext(Aws::Utils::ByteBuffer&& value) { SetPlaintext(value); return *this;}
148 
156  inline const Aws::Map<Aws::String, Aws::String>& GetEncryptionContext() const{ return m_encryptionContext; }
157 
165  inline void SetEncryptionContext(const Aws::Map<Aws::String, Aws::String>& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext = value; }
166 
174  inline void SetEncryptionContext(Aws::Map<Aws::String, Aws::String>&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext = value; }
175 
183  inline EncryptRequest& WithEncryptionContext(const Aws::Map<Aws::String, Aws::String>& value) { SetEncryptionContext(value); return *this;}
184 
192  inline EncryptRequest& WithEncryptionContext(Aws::Map<Aws::String, Aws::String>&& value) { SetEncryptionContext(value); return *this;}
193 
201  inline EncryptRequest& AddEncryptionContext(const Aws::String& key, const Aws::String& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
202 
210  inline EncryptRequest& AddEncryptionContext(Aws::String&& key, const Aws::String& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
211 
219  inline EncryptRequest& AddEncryptionContext(const Aws::String& key, Aws::String&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
220 
228  inline EncryptRequest& AddEncryptionContext(Aws::String&& key, Aws::String&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
229 
237  inline EncryptRequest& AddEncryptionContext(const char* key, Aws::String&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
238 
246  inline EncryptRequest& AddEncryptionContext(Aws::String&& key, const char* value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
247 
255  inline EncryptRequest& AddEncryptionContext(const char* key, const char* value) { m_encryptionContextHasBeenSet = true; m_encryptionContext[key] = value; return *this; }
256 
262  inline const Aws::Vector<Aws::String>& GetGrantTokens() const{ return m_grantTokens; }
263 
269  inline void SetGrantTokens(const Aws::Vector<Aws::String>& value) { m_grantTokensHasBeenSet = true; m_grantTokens = value; }
270 
276  inline void SetGrantTokens(Aws::Vector<Aws::String>&& value) { m_grantTokensHasBeenSet = true; m_grantTokens = value; }
277 
283  inline EncryptRequest& WithGrantTokens(const Aws::Vector<Aws::String>& value) { SetGrantTokens(value); return *this;}
284 
290  inline EncryptRequest& WithGrantTokens(Aws::Vector<Aws::String>&& value) { SetGrantTokens(value); return *this;}
291 
297  inline EncryptRequest& AddGrantTokens(const Aws::String& value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; }
298 
304  inline EncryptRequest& AddGrantTokens(Aws::String&& value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; }
305 
311  inline EncryptRequest& AddGrantTokens(const char* value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; }
312 
313  private:
314  Aws::String m_keyId;
315  bool m_keyIdHasBeenSet;
316  Aws::Utils::ByteBuffer m_plaintext;
317  bool m_plaintextHasBeenSet;
318  Aws::Map<Aws::String, Aws::String> m_encryptionContext;
319  bool m_encryptionContextHasBeenSet;
320  Aws::Vector<Aws::String> m_grantTokens;
321  bool m_grantTokensHasBeenSet;
322  };
323 
324 } // namespace Model
325 } // namespace KMS
326 } // namespace Aws
void SetKeyId(Aws::String &&value)
void SetPlaintext(const Aws::Utils::ByteBuffer &value)
EncryptRequest & AddEncryptionContext(Aws::String &&key, const char *value)
const Aws::String & GetKeyId() const
EncryptRequest & WithPlaintext(Aws::Utils::ByteBuffer &&value)
EncryptRequest & AddEncryptionContext(const Aws::String &key, Aws::String &&value)
EncryptRequest & WithKeyId(const Aws::String &value)
EncryptRequest & AddEncryptionContext(const Aws::String &key, const Aws::String &value)
EncryptRequest & WithEncryptionContext(const Aws::Map< Aws::String, Aws::String > &value)
void SetKeyId(const Aws::String &value)
EncryptRequest & AddGrantTokens(Aws::String &&value)
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
EncryptRequest & AddEncryptionContext(const char *key, const char *value)
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
Definition: HttpTypes.h:63
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
Definition: AWSMap.h:28
void SetPlaintext(Aws::Utils::ByteBuffer &&value)
EncryptRequest & WithGrantTokens(const Aws::Vector< Aws::String > &value)
const Aws::Map< Aws::String, Aws::String > & GetEncryptionContext() const
EncryptRequest & WithKeyId(const char *value)
void SetEncryptionContext(Aws::Map< Aws::String, Aws::String > &&value)
EncryptRequest & WithEncryptionContext(Aws::Map< Aws::String, Aws::String > &&value)
void SetEncryptionContext(const Aws::Map< Aws::String, Aws::String > &value)
const Aws::Vector< Aws::String > & GetGrantTokens() const
EncryptRequest & WithKeyId(Aws::String &&value)
void SetGrantTokens(Aws::Vector< Aws::String > &&value)
EncryptRequest & AddEncryptionContext(Aws::String &&key, Aws::String &&value)
void SetGrantTokens(const Aws::Vector< Aws::String > &value)
EncryptRequest & AddGrantTokens(const char *value)
EncryptRequest & AddEncryptionContext(const char *key, Aws::String &&value)
const Aws::Utils::ByteBuffer & GetPlaintext() const
EncryptRequest & WithGrantTokens(Aws::Vector< Aws::String > &&value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
#define AWS_KMS_API
Definition: KMS_EXPORTS.h:34
EncryptRequest & AddEncryptionContext(Aws::String &&key, const Aws::String &value)
EncryptRequest & AddGrantTokens(const Aws::String &value)
void SetKeyId(const char *value)
EncryptRequest & WithPlaintext(const Aws::Utils::ByteBuffer &value)
JSON (JavaScript Object Notation).