AWS SDK for C++

AWS SDK for C++ Version 1.11.718

Loading...
Searching...
No Matches
GenerateDataKeyRequest.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSMap.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/kms/KMSRequest.h>
11#include <aws/kms/KMS_EXPORTS.h>
12#include <aws/kms/model/DataKeySpec.h>
13#include <aws/kms/model/RecipientInfo.h>
14
15#include <utility>
16
17namespace Aws {
18namespace KMS {
19namespace Model {
20
24 public:
25 AWS_KMS_API GenerateDataKeyRequest() = 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 "GenerateDataKey"; }
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>
63 SetKeyId(std::forward<KeyIdT>(value));
64 return *this;
65 }
67
69
83 inline const Aws::Map<Aws::String, Aws::String>& GetEncryptionContext() const { return m_encryptionContext; }
84 inline bool EncryptionContextHasBeenSet() const { return m_encryptionContextHasBeenSet; }
85 template <typename EncryptionContextT = Aws::Map<Aws::String, Aws::String>>
86 void SetEncryptionContext(EncryptionContextT&& value) {
87 m_encryptionContextHasBeenSet = true;
88 m_encryptionContext = std::forward<EncryptionContextT>(value);
89 }
90 template <typename EncryptionContextT = Aws::Map<Aws::String, Aws::String>>
91 GenerateDataKeyRequest& WithEncryptionContext(EncryptionContextT&& value) {
92 SetEncryptionContext(std::forward<EncryptionContextT>(value));
93 return *this;
94 }
95 template <typename EncryptionContextKeyT = Aws::String, typename EncryptionContextValueT = Aws::String>
96 GenerateDataKeyRequest& AddEncryptionContext(EncryptionContextKeyT&& key, EncryptionContextValueT&& value) {
97 m_encryptionContextHasBeenSet = true;
98 m_encryptionContext.emplace(std::forward<EncryptionContextKeyT>(key), std::forward<EncryptionContextValueT>(value));
99 return *this;
100 }
102
104
111 inline int GetNumberOfBytes() const { return m_numberOfBytes; }
112 inline bool NumberOfBytesHasBeenSet() const { return m_numberOfBytesHasBeenSet; }
113 inline void SetNumberOfBytes(int value) {
114 m_numberOfBytesHasBeenSet = true;
115 m_numberOfBytes = value;
116 }
118 SetNumberOfBytes(value);
119 return *this;
120 }
122
124
131 inline DataKeySpec GetKeySpec() const { return m_keySpec; }
132 inline bool KeySpecHasBeenSet() const { return m_keySpecHasBeenSet; }
133 inline void SetKeySpec(DataKeySpec value) {
134 m_keySpecHasBeenSet = true;
135 m_keySpec = value;
136 }
138 SetKeySpec(value);
139 return *this;
140 }
142
144
153 inline const Aws::Vector<Aws::String>& GetGrantTokens() const { return m_grantTokens; }
154 inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
155 template <typename GrantTokensT = Aws::Vector<Aws::String>>
156 void SetGrantTokens(GrantTokensT&& value) {
157 m_grantTokensHasBeenSet = true;
158 m_grantTokens = std::forward<GrantTokensT>(value);
159 }
160 template <typename GrantTokensT = Aws::Vector<Aws::String>>
162 SetGrantTokens(std::forward<GrantTokensT>(value));
163 return *this;
164 }
165 template <typename GrantTokensT = Aws::String>
166 GenerateDataKeyRequest& AddGrantTokens(GrantTokensT&& value) {
167 m_grantTokensHasBeenSet = true;
168 m_grantTokens.emplace_back(std::forward<GrantTokensT>(value));
169 return *this;
170 }
172
174
198 inline const RecipientInfo& GetRecipient() const { return m_recipient; }
199 inline bool RecipientHasBeenSet() const { return m_recipientHasBeenSet; }
200 template <typename RecipientT = RecipientInfo>
201 void SetRecipient(RecipientT&& value) {
202 m_recipientHasBeenSet = true;
203 m_recipient = std::forward<RecipientT>(value);
204 }
205 template <typename RecipientT = RecipientInfo>
207 SetRecipient(std::forward<RecipientT>(value));
208 return *this;
209 }
211
213
219 inline bool GetDryRun() const { return m_dryRun; }
220 inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
221 inline void SetDryRun(bool value) {
222 m_dryRunHasBeenSet = true;
223 m_dryRun = value;
224 }
225 inline GenerateDataKeyRequest& WithDryRun(bool value) {
226 SetDryRun(value);
227 return *this;
228 }
230 private:
231 Aws::String m_keyId;
232
233 Aws::Map<Aws::String, Aws::String> m_encryptionContext;
234
235 int m_numberOfBytes{0};
236
238
239 Aws::Vector<Aws::String> m_grantTokens;
240
241 RecipientInfo m_recipient;
242
243 bool m_dryRun{false};
244 bool m_keyIdHasBeenSet = false;
245 bool m_encryptionContextHasBeenSet = false;
246 bool m_numberOfBytesHasBeenSet = false;
247 bool m_keySpecHasBeenSet = false;
248 bool m_grantTokensHasBeenSet = false;
249 bool m_recipientHasBeenSet = false;
250 bool m_dryRunHasBeenSet = false;
251};
252
253} // namespace Model
254} // namespace KMS
255} // namespace Aws
AWS_KMS_API GenerateDataKeyRequest()=default
virtual const char * GetServiceRequestName() const override
const Aws::Map< Aws::String, Aws::String > & GetEncryptionContext() const
GenerateDataKeyRequest & WithKeySpec(DataKeySpec value)
GenerateDataKeyRequest & WithDryRun(bool value)
AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
void SetEncryptionContext(EncryptionContextT &&value)
GenerateDataKeyRequest & AddEncryptionContext(EncryptionContextKeyT &&key, EncryptionContextValueT &&value)
GenerateDataKeyRequest & AddGrantTokens(GrantTokensT &&value)
GenerateDataKeyRequest & WithGrantTokens(GrantTokensT &&value)
GenerateDataKeyRequest & WithEncryptionContext(EncryptionContextT &&value)
GenerateDataKeyRequest & WithNumberOfBytes(int value)
GenerateDataKeyRequest & WithRecipient(RecipientT &&value)
const Aws::Vector< Aws::String > & GetGrantTokens() const
AWS_KMS_API Aws::String SerializePayload() const override
GenerateDataKeyRequest & WithKeyId(KeyIdT &&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