AWS SDK for C++

AWS SDK for C++ Version 1.11.811

Loading...
Searching...
No Matches
CreateGrantRequest.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/kms/KMSRequest.h>
10#include <aws/kms/KMS_EXPORTS.h>
11#include <aws/kms/model/GrantConstraints.h>
12#include <aws/kms/model/GrantOperation.h>
13
14#include <utility>
15
16namespace Aws {
17namespace KMS {
18namespace Model {
19
23 public:
24 AWS_KMS_API CreateGrantRequest() = default;
25
26 // Service request name is the Operation name which will send this request out,
27 // each operation should has unique request name, so that we can get operation's name from this request.
28 // Note: this is not true for response, multiple operations may have the same response name,
29 // so we can not get operation's name from response.
30 inline virtual const char* GetServiceRequestName() const override { return "CreateGrant"; }
31
32 AWS_KMS_API Aws::String SerializePayload() const override;
33
35
37
47 inline const Aws::String& GetKeyId() const { return m_keyId; }
48 inline bool KeyIdHasBeenSet() const { return m_keyIdHasBeenSet; }
49 template <typename KeyIdT = Aws::String>
50 void SetKeyId(KeyIdT&& value) {
51 m_keyIdHasBeenSet = true;
52 m_keyId = std::forward<KeyIdT>(value);
53 }
54 template <typename KeyIdT = Aws::String>
55 CreateGrantRequest& WithKeyId(KeyIdT&& value) {
56 SetKeyId(std::forward<KeyIdT>(value));
57 return *this;
58 }
60
62
73 inline const Aws::String& GetGranteePrincipal() const { return m_granteePrincipal; }
74 inline bool GranteePrincipalHasBeenSet() const { return m_granteePrincipalHasBeenSet; }
75 template <typename GranteePrincipalT = Aws::String>
76 void SetGranteePrincipal(GranteePrincipalT&& value) {
77 m_granteePrincipalHasBeenSet = true;
78 m_granteePrincipal = std::forward<GranteePrincipalT>(value);
79 }
80 template <typename GranteePrincipalT = Aws::String>
81 CreateGrantRequest& WithGranteePrincipal(GranteePrincipalT&& value) {
82 SetGranteePrincipal(std::forward<GranteePrincipalT>(value));
83 return *this;
84 }
86
88
105 inline const Aws::String& GetRetiringPrincipal() const { return m_retiringPrincipal; }
106 inline bool RetiringPrincipalHasBeenSet() const { return m_retiringPrincipalHasBeenSet; }
107 template <typename RetiringPrincipalT = Aws::String>
108 void SetRetiringPrincipal(RetiringPrincipalT&& value) {
109 m_retiringPrincipalHasBeenSet = true;
110 m_retiringPrincipal = std::forward<RetiringPrincipalT>(value);
111 }
112 template <typename RetiringPrincipalT = Aws::String>
113 CreateGrantRequest& WithRetiringPrincipal(RetiringPrincipalT&& value) {
114 SetRetiringPrincipal(std::forward<RetiringPrincipalT>(value));
115 return *this;
116 }
118
120
130 inline const Aws::Vector<GrantOperation>& GetOperations() const { return m_operations; }
131 inline bool OperationsHasBeenSet() const { return m_operationsHasBeenSet; }
132 template <typename OperationsT = Aws::Vector<GrantOperation>>
133 void SetOperations(OperationsT&& value) {
134 m_operationsHasBeenSet = true;
135 m_operations = std::forward<OperationsT>(value);
136 }
137 template <typename OperationsT = Aws::Vector<GrantOperation>>
138 CreateGrantRequest& WithOperations(OperationsT&& value) {
139 SetOperations(std::forward<OperationsT>(value));
140 return *this;
141 }
143 m_operationsHasBeenSet = true;
144 m_operations.push_back(value);
145 return *this;
146 }
148
150
191 inline const GrantConstraints& GetConstraints() const { return m_constraints; }
192 inline bool ConstraintsHasBeenSet() const { return m_constraintsHasBeenSet; }
193 template <typename ConstraintsT = GrantConstraints>
194 void SetConstraints(ConstraintsT&& value) {
195 m_constraintsHasBeenSet = true;
196 m_constraints = std::forward<ConstraintsT>(value);
197 }
198 template <typename ConstraintsT = GrantConstraints>
199 CreateGrantRequest& WithConstraints(ConstraintsT&& value) {
200 SetConstraints(std::forward<ConstraintsT>(value));
201 return *this;
202 }
204
206
215 inline const Aws::Vector<Aws::String>& GetGrantTokens() const { return m_grantTokens; }
216 inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
217 template <typename GrantTokensT = Aws::Vector<Aws::String>>
218 void SetGrantTokens(GrantTokensT&& value) {
219 m_grantTokensHasBeenSet = true;
220 m_grantTokens = std::forward<GrantTokensT>(value);
221 }
222 template <typename GrantTokensT = Aws::Vector<Aws::String>>
223 CreateGrantRequest& WithGrantTokens(GrantTokensT&& value) {
224 SetGrantTokens(std::forward<GrantTokensT>(value));
225 return *this;
226 }
227 template <typename GrantTokensT = Aws::String>
228 CreateGrantRequest& AddGrantTokens(GrantTokensT&& value) {
229 m_grantTokensHasBeenSet = true;
230 m_grantTokens.emplace_back(std::forward<GrantTokensT>(value));
231 return *this;
232 }
234
236
252 inline const Aws::String& GetName() const { return m_name; }
253 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
254 template <typename NameT = Aws::String>
255 void SetName(NameT&& value) {
256 m_nameHasBeenSet = true;
257 m_name = std::forward<NameT>(value);
258 }
259 template <typename NameT = Aws::String>
260 CreateGrantRequest& WithName(NameT&& value) {
261 SetName(std::forward<NameT>(value));
262 return *this;
263 }
265
267
273 inline bool GetDryRun() const { return m_dryRun; }
274 inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
275 inline void SetDryRun(bool value) {
276 m_dryRunHasBeenSet = true;
277 m_dryRun = value;
278 }
279 inline CreateGrantRequest& WithDryRun(bool value) {
280 SetDryRun(value);
281 return *this;
282 }
284
286
296 inline const Aws::String& GetGranteeServicePrincipal() const { return m_granteeServicePrincipal; }
297 inline bool GranteeServicePrincipalHasBeenSet() const { return m_granteeServicePrincipalHasBeenSet; }
298 template <typename GranteeServicePrincipalT = Aws::String>
299 void SetGranteeServicePrincipal(GranteeServicePrincipalT&& value) {
300 m_granteeServicePrincipalHasBeenSet = true;
301 m_granteeServicePrincipal = std::forward<GranteeServicePrincipalT>(value);
302 }
303 template <typename GranteeServicePrincipalT = Aws::String>
304 CreateGrantRequest& WithGranteeServicePrincipal(GranteeServicePrincipalT&& value) {
305 SetGranteeServicePrincipal(std::forward<GranteeServicePrincipalT>(value));
306 return *this;
307 }
309
311
318 inline const Aws::String& GetRetiringServicePrincipal() const { return m_retiringServicePrincipal; }
319 inline bool RetiringServicePrincipalHasBeenSet() const { return m_retiringServicePrincipalHasBeenSet; }
320 template <typename RetiringServicePrincipalT = Aws::String>
321 void SetRetiringServicePrincipal(RetiringServicePrincipalT&& value) {
322 m_retiringServicePrincipalHasBeenSet = true;
323 m_retiringServicePrincipal = std::forward<RetiringServicePrincipalT>(value);
324 }
325 template <typename RetiringServicePrincipalT = Aws::String>
326 CreateGrantRequest& WithRetiringServicePrincipal(RetiringServicePrincipalT&& value) {
327 SetRetiringServicePrincipal(std::forward<RetiringServicePrincipalT>(value));
328 return *this;
329 }
331 private:
332 Aws::String m_keyId;
333
334 Aws::String m_granteePrincipal;
335
336 Aws::String m_retiringPrincipal;
337
338 Aws::Vector<GrantOperation> m_operations;
339
340 GrantConstraints m_constraints;
341
342 Aws::Vector<Aws::String> m_grantTokens;
343
344 Aws::String m_name;
345
346 bool m_dryRun{false};
347
348 Aws::String m_granteeServicePrincipal;
349
350 Aws::String m_retiringServicePrincipal;
351 bool m_keyIdHasBeenSet = false;
352 bool m_granteePrincipalHasBeenSet = false;
353 bool m_retiringPrincipalHasBeenSet = false;
354 bool m_operationsHasBeenSet = false;
355 bool m_constraintsHasBeenSet = false;
356 bool m_grantTokensHasBeenSet = false;
357 bool m_nameHasBeenSet = false;
358 bool m_dryRunHasBeenSet = false;
359 bool m_granteeServicePrincipalHasBeenSet = false;
360 bool m_retiringServicePrincipalHasBeenSet = false;
361};
362
363} // namespace Model
364} // namespace KMS
365} // namespace Aws
CreateGrantRequest & WithGranteeServicePrincipal(GranteeServicePrincipalT &&value)
void SetGranteeServicePrincipal(GranteeServicePrincipalT &&value)
const GrantConstraints & GetConstraints() const
AWS_KMS_API Aws::String SerializePayload() const override
void SetRetiringServicePrincipal(RetiringServicePrincipalT &&value)
CreateGrantRequest & AddOperations(GrantOperation value)
const Aws::String & GetKeyId() const
CreateGrantRequest & AddGrantTokens(GrantTokensT &&value)
CreateGrantRequest & WithKeyId(KeyIdT &&value)
CreateGrantRequest & WithOperations(OperationsT &&value)
const Aws::Vector< Aws::String > & GetGrantTokens() const
AWS_KMS_API CreateGrantRequest()=default
CreateGrantRequest & WithDryRun(bool value)
CreateGrantRequest & WithRetiringPrincipal(RetiringPrincipalT &&value)
CreateGrantRequest & WithConstraints(ConstraintsT &&value)
AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
void SetRetiringPrincipal(RetiringPrincipalT &&value)
void SetConstraints(ConstraintsT &&value)
const Aws::String & GetRetiringPrincipal() const
CreateGrantRequest & WithRetiringServicePrincipal(RetiringServicePrincipalT &&value)
CreateGrantRequest & WithGrantTokens(GrantTokensT &&value)
const Aws::String & GetName() const
void SetGrantTokens(GrantTokensT &&value)
CreateGrantRequest & WithGranteePrincipal(GranteePrincipalT &&value)
const Aws::String & GetGranteeServicePrincipal() const
CreateGrantRequest & WithName(NameT &&value)
const Aws::Vector< GrantOperation > & GetOperations() const
void SetOperations(OperationsT &&value)
void SetGranteePrincipal(GranteePrincipalT &&value)
virtual const char * GetServiceRequestName() const override
const Aws::String & GetGranteePrincipal() const
const Aws::String & GetRetiringServicePrincipal() const
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector