AWS SDK for C++

AWS SDK for C++ Version 1.11.606

Loading...
Searching...
No Matches
EncryptRequest.h
1
6#pragma once
7#include <aws/kms/KMS_EXPORTS.h>
8#include <aws/kms/KMSRequest.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/Array.h>
11#include <aws/core/utils/memory/stl/AWSMap.h>
12#include <aws/core/utils/memory/stl/AWSVector.h>
13#include <aws/kms/model/EncryptionAlgorithmSpec.h>
14#include <utility>
15
16namespace Aws
17{
18namespace KMS
19{
20namespace Model
21{
22
26 {
27 public:
28 AWS_KMS_API EncryptRequest() = default;
29
30 // Service request name is the Operation name which will send this request out,
31 // each operation should has unique request name, so that we can get operation's name from this request.
32 // Note: this is not true for response, multiple operations may have the same response name,
33 // so we can not get operation's name from response.
34 inline virtual const char* GetServiceRequestName() const override { return "Encrypt"; }
35
36 AWS_KMS_API Aws::String SerializePayload() const override;
37
39
40
42
58 inline const Aws::String& GetKeyId() const { return m_keyId; }
59 inline bool KeyIdHasBeenSet() const { return m_keyIdHasBeenSet; }
60 template<typename KeyIdT = Aws::String>
61 void SetKeyId(KeyIdT&& value) { m_keyIdHasBeenSet = true; m_keyId = std::forward<KeyIdT>(value); }
62 template<typename KeyIdT = Aws::String>
63 EncryptRequest& WithKeyId(KeyIdT&& value) { SetKeyId(std::forward<KeyIdT>(value)); return *this;}
65
67
70 inline const Aws::Utils::CryptoBuffer& GetPlaintext() const { return m_plaintext; }
71 inline bool PlaintextHasBeenSet() const { return m_plaintextHasBeenSet; }
72 template<typename PlaintextT = Aws::Utils::CryptoBuffer>
73 void SetPlaintext(PlaintextT&& value) { m_plaintextHasBeenSet = true; m_plaintext = std::forward<PlaintextT>(value); }
74 template<typename PlaintextT = Aws::Utils::CryptoBuffer>
75 EncryptRequest& WithPlaintext(PlaintextT&& value) { SetPlaintext(std::forward<PlaintextT>(value)); return *this;}
77
79
98 inline const Aws::Map<Aws::String, Aws::String>& GetEncryptionContext() const { return m_encryptionContext; }
99 inline bool EncryptionContextHasBeenSet() const { return m_encryptionContextHasBeenSet; }
100 template<typename EncryptionContextT = Aws::Map<Aws::String, Aws::String>>
101 void SetEncryptionContext(EncryptionContextT&& value) { m_encryptionContextHasBeenSet = true; m_encryptionContext = std::forward<EncryptionContextT>(value); }
102 template<typename EncryptionContextT = Aws::Map<Aws::String, Aws::String>>
103 EncryptRequest& WithEncryptionContext(EncryptionContextT&& value) { SetEncryptionContext(std::forward<EncryptionContextT>(value)); return *this;}
104 template<typename EncryptionContextKeyT = Aws::String, typename EncryptionContextValueT = Aws::String>
105 EncryptRequest& AddEncryptionContext(EncryptionContextKeyT&& key, EncryptionContextValueT&& value) {
106 m_encryptionContextHasBeenSet = true; m_encryptionContext.emplace(std::forward<EncryptionContextKeyT>(key), std::forward<EncryptionContextValueT>(value)); return *this;
107 }
109
111
120 inline const Aws::Vector<Aws::String>& GetGrantTokens() const { return m_grantTokens; }
121 inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
122 template<typename GrantTokensT = Aws::Vector<Aws::String>>
123 void SetGrantTokens(GrantTokensT&& value) { m_grantTokensHasBeenSet = true; m_grantTokens = std::forward<GrantTokensT>(value); }
124 template<typename GrantTokensT = Aws::Vector<Aws::String>>
125 EncryptRequest& WithGrantTokens(GrantTokensT&& value) { SetGrantTokens(std::forward<GrantTokensT>(value)); return *this;}
126 template<typename GrantTokensT = Aws::String>
127 EncryptRequest& AddGrantTokens(GrantTokensT&& value) { m_grantTokensHasBeenSet = true; m_grantTokens.emplace_back(std::forward<GrantTokensT>(value)); return *this; }
129
131
140 inline EncryptionAlgorithmSpec GetEncryptionAlgorithm() const { return m_encryptionAlgorithm; }
141 inline bool EncryptionAlgorithmHasBeenSet() const { return m_encryptionAlgorithmHasBeenSet; }
142 inline void SetEncryptionAlgorithm(EncryptionAlgorithmSpec value) { m_encryptionAlgorithmHasBeenSet = true; m_encryptionAlgorithm = value; }
145
147
153 inline bool GetDryRun() const { return m_dryRun; }
154 inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
155 inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
156 inline EncryptRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
158 private:
159
160 Aws::String m_keyId;
161 bool m_keyIdHasBeenSet = false;
162
163 Aws::Utils::CryptoBuffer m_plaintext{};
164 bool m_plaintextHasBeenSet = false;
165
166 Aws::Map<Aws::String, Aws::String> m_encryptionContext;
167 bool m_encryptionContextHasBeenSet = false;
168
169 Aws::Vector<Aws::String> m_grantTokens;
170 bool m_grantTokensHasBeenSet = false;
171
173 bool m_encryptionAlgorithmHasBeenSet = false;
174
175 bool m_dryRun{false};
176 bool m_dryRunHasBeenSet = false;
177 };
178
179} // namespace Model
180} // namespace KMS
181} // namespace Aws
EncryptRequest & AddEncryptionContext(EncryptionContextKeyT &&key, EncryptionContextValueT &&value)
const Aws::Map< Aws::String, Aws::String > & GetEncryptionContext() const
EncryptRequest & WithEncryptionContext(EncryptionContextT &&value)
AWS_KMS_API Aws::String SerializePayload() const override
AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
void SetEncryptionAlgorithm(EncryptionAlgorithmSpec value)
EncryptionAlgorithmSpec GetEncryptionAlgorithm() const
const Aws::Vector< Aws::String > & GetGrantTokens() const
EncryptRequest & WithGrantTokens(GrantTokensT &&value)
EncryptRequest & AddGrantTokens(GrantTokensT &&value)
EncryptRequest & WithKeyId(KeyIdT &&value)
const Aws::Utils::CryptoBuffer & GetPlaintext() const
void SetPlaintext(PlaintextT &&value)
const Aws::String & GetKeyId() const
virtual const char * GetServiceRequestName() const override
EncryptRequest & WithDryRun(bool value)
void SetEncryptionContext(EncryptionContextT &&value)
void SetGrantTokens(GrantTokensT &&value)
AWS_KMS_API EncryptRequest()=default
EncryptRequest & WithPlaintext(PlaintextT &&value)
void SetKeyId(KeyIdT &&value)
EncryptRequest & WithEncryptionAlgorithm(EncryptionAlgorithmSpec value)
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector