AWS SDK for C++

AWS SDK for C++ Version 1.11.719

Loading...
Searching...
No Matches
EncryptRequest.h
1
6#pragma once
7#include <aws/core/utils/Array.h>
8#include <aws/core/utils/memory/stl/AWSMap.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/memory/stl/AWSVector.h>
11#include <aws/kms/KMSRequest.h>
12#include <aws/kms/KMS_EXPORTS.h>
13#include <aws/kms/model/EncryptionAlgorithmSpec.h>
14
15#include <utility>
16
17namespace Aws {
18namespace KMS {
19namespace Model {
20
23class EncryptRequest : public KMSRequest {
24 public:
25 AWS_KMS_API EncryptRequest() = default;
26
27 // Service request name is the Operation name which will send this request out,
28 // each operation should has unique request name, so that we can get operation's name from this request.
29 // Note: this is not true for response, multiple operations may have the same response name,
30 // so we can not get operation's name from response.
31 inline virtual const char* GetServiceRequestName() const override { return "Encrypt"; }
32
33 AWS_KMS_API Aws::String SerializePayload() const override;
34
36
38
54 inline const Aws::String& GetKeyId() const { return m_keyId; }
55 inline bool KeyIdHasBeenSet() const { return m_keyIdHasBeenSet; }
56 template <typename KeyIdT = Aws::String>
57 void SetKeyId(KeyIdT&& value) {
58 m_keyIdHasBeenSet = true;
59 m_keyId = std::forward<KeyIdT>(value);
60 }
61 template <typename KeyIdT = Aws::String>
62 EncryptRequest& WithKeyId(KeyIdT&& value) {
63 SetKeyId(std::forward<KeyIdT>(value));
64 return *this;
65 }
67
69
72 inline const Aws::Utils::CryptoBuffer& GetPlaintext() const { return m_plaintext; }
73 inline bool PlaintextHasBeenSet() const { return m_plaintextHasBeenSet; }
74 template <typename PlaintextT = Aws::Utils::CryptoBuffer>
75 void SetPlaintext(PlaintextT&& value) {
76 m_plaintextHasBeenSet = true;
77 m_plaintext = std::forward<PlaintextT>(value);
78 }
79 template <typename PlaintextT = Aws::Utils::CryptoBuffer>
80 EncryptRequest& WithPlaintext(PlaintextT&& value) {
81 SetPlaintext(std::forward<PlaintextT>(value));
82 return *this;
83 }
85
87
106 inline const Aws::Map<Aws::String, Aws::String>& GetEncryptionContext() const { return m_encryptionContext; }
107 inline bool EncryptionContextHasBeenSet() const { return m_encryptionContextHasBeenSet; }
108 template <typename EncryptionContextT = Aws::Map<Aws::String, Aws::String>>
109 void SetEncryptionContext(EncryptionContextT&& value) {
110 m_encryptionContextHasBeenSet = true;
111 m_encryptionContext = std::forward<EncryptionContextT>(value);
112 }
113 template <typename EncryptionContextT = Aws::Map<Aws::String, Aws::String>>
114 EncryptRequest& WithEncryptionContext(EncryptionContextT&& value) {
115 SetEncryptionContext(std::forward<EncryptionContextT>(value));
116 return *this;
117 }
118 template <typename EncryptionContextKeyT = Aws::String, typename EncryptionContextValueT = Aws::String>
119 EncryptRequest& AddEncryptionContext(EncryptionContextKeyT&& key, EncryptionContextValueT&& value) {
120 m_encryptionContextHasBeenSet = true;
121 m_encryptionContext.emplace(std::forward<EncryptionContextKeyT>(key), std::forward<EncryptionContextValueT>(value));
122 return *this;
123 }
125
127
136 inline const Aws::Vector<Aws::String>& GetGrantTokens() const { return m_grantTokens; }
137 inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
138 template <typename GrantTokensT = Aws::Vector<Aws::String>>
139 void SetGrantTokens(GrantTokensT&& value) {
140 m_grantTokensHasBeenSet = true;
141 m_grantTokens = std::forward<GrantTokensT>(value);
142 }
143 template <typename GrantTokensT = Aws::Vector<Aws::String>>
144 EncryptRequest& WithGrantTokens(GrantTokensT&& value) {
145 SetGrantTokens(std::forward<GrantTokensT>(value));
146 return *this;
147 }
148 template <typename GrantTokensT = Aws::String>
149 EncryptRequest& AddGrantTokens(GrantTokensT&& value) {
150 m_grantTokensHasBeenSet = true;
151 m_grantTokens.emplace_back(std::forward<GrantTokensT>(value));
152 return *this;
153 }
155
157
166 inline EncryptionAlgorithmSpec GetEncryptionAlgorithm() const { return m_encryptionAlgorithm; }
167 inline bool EncryptionAlgorithmHasBeenSet() const { return m_encryptionAlgorithmHasBeenSet; }
169 m_encryptionAlgorithmHasBeenSet = true;
170 m_encryptionAlgorithm = value;
171 }
174 return *this;
175 }
177
179
185 inline bool GetDryRun() const { return m_dryRun; }
186 inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
187 inline void SetDryRun(bool value) {
188 m_dryRunHasBeenSet = true;
189 m_dryRun = value;
190 }
191 inline EncryptRequest& WithDryRun(bool value) {
192 SetDryRun(value);
193 return *this;
194 }
196 private:
197 Aws::String m_keyId;
198
199 Aws::Utils::CryptoBuffer m_plaintext{};
200
201 Aws::Map<Aws::String, Aws::String> m_encryptionContext;
202
203 Aws::Vector<Aws::String> m_grantTokens;
204
206
207 bool m_dryRun{false};
208 bool m_keyIdHasBeenSet = false;
209 bool m_plaintextHasBeenSet = false;
210 bool m_encryptionContextHasBeenSet = false;
211 bool m_grantTokensHasBeenSet = false;
212 bool m_encryptionAlgorithmHasBeenSet = false;
213 bool m_dryRunHasBeenSet = false;
214};
215
216} // namespace Model
217} // namespace KMS
218} // 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