AWS SDK for C++

AWS SDK for C++ Version 1.11.718

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
71 inline const Aws::String& GetGranteePrincipal() const { return m_granteePrincipal; }
72 inline bool GranteePrincipalHasBeenSet() const { return m_granteePrincipalHasBeenSet; }
73 template <typename GranteePrincipalT = Aws::String>
74 void SetGranteePrincipal(GranteePrincipalT&& value) {
75 m_granteePrincipalHasBeenSet = true;
76 m_granteePrincipal = std::forward<GranteePrincipalT>(value);
77 }
78 template <typename GranteePrincipalT = Aws::String>
79 CreateGrantRequest& WithGranteePrincipal(GranteePrincipalT&& value) {
80 SetGranteePrincipal(std::forward<GranteePrincipalT>(value));
81 return *this;
82 }
84
86
102 inline const Aws::String& GetRetiringPrincipal() const { return m_retiringPrincipal; }
103 inline bool RetiringPrincipalHasBeenSet() const { return m_retiringPrincipalHasBeenSet; }
104 template <typename RetiringPrincipalT = Aws::String>
105 void SetRetiringPrincipal(RetiringPrincipalT&& value) {
106 m_retiringPrincipalHasBeenSet = true;
107 m_retiringPrincipal = std::forward<RetiringPrincipalT>(value);
108 }
109 template <typename RetiringPrincipalT = Aws::String>
110 CreateGrantRequest& WithRetiringPrincipal(RetiringPrincipalT&& value) {
111 SetRetiringPrincipal(std::forward<RetiringPrincipalT>(value));
112 return *this;
113 }
115
117
127 inline const Aws::Vector<GrantOperation>& GetOperations() const { return m_operations; }
128 inline bool OperationsHasBeenSet() const { return m_operationsHasBeenSet; }
129 template <typename OperationsT = Aws::Vector<GrantOperation>>
130 void SetOperations(OperationsT&& value) {
131 m_operationsHasBeenSet = true;
132 m_operations = std::forward<OperationsT>(value);
133 }
134 template <typename OperationsT = Aws::Vector<GrantOperation>>
135 CreateGrantRequest& WithOperations(OperationsT&& value) {
136 SetOperations(std::forward<OperationsT>(value));
137 return *this;
138 }
140 m_operationsHasBeenSet = true;
141 m_operations.push_back(value);
142 return *this;
143 }
145
147
176 inline const GrantConstraints& GetConstraints() const { return m_constraints; }
177 inline bool ConstraintsHasBeenSet() const { return m_constraintsHasBeenSet; }
178 template <typename ConstraintsT = GrantConstraints>
179 void SetConstraints(ConstraintsT&& value) {
180 m_constraintsHasBeenSet = true;
181 m_constraints = std::forward<ConstraintsT>(value);
182 }
183 template <typename ConstraintsT = GrantConstraints>
184 CreateGrantRequest& WithConstraints(ConstraintsT&& value) {
185 SetConstraints(std::forward<ConstraintsT>(value));
186 return *this;
187 }
189
191
200 inline const Aws::Vector<Aws::String>& GetGrantTokens() const { return m_grantTokens; }
201 inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
202 template <typename GrantTokensT = Aws::Vector<Aws::String>>
203 void SetGrantTokens(GrantTokensT&& value) {
204 m_grantTokensHasBeenSet = true;
205 m_grantTokens = std::forward<GrantTokensT>(value);
206 }
207 template <typename GrantTokensT = Aws::Vector<Aws::String>>
208 CreateGrantRequest& WithGrantTokens(GrantTokensT&& value) {
209 SetGrantTokens(std::forward<GrantTokensT>(value));
210 return *this;
211 }
212 template <typename GrantTokensT = Aws::String>
213 CreateGrantRequest& AddGrantTokens(GrantTokensT&& value) {
214 m_grantTokensHasBeenSet = true;
215 m_grantTokens.emplace_back(std::forward<GrantTokensT>(value));
216 return *this;
217 }
219
221
237 inline const Aws::String& GetName() const { return m_name; }
238 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
239 template <typename NameT = Aws::String>
240 void SetName(NameT&& value) {
241 m_nameHasBeenSet = true;
242 m_name = std::forward<NameT>(value);
243 }
244 template <typename NameT = Aws::String>
245 CreateGrantRequest& WithName(NameT&& value) {
246 SetName(std::forward<NameT>(value));
247 return *this;
248 }
250
252
258 inline bool GetDryRun() const { return m_dryRun; }
259 inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
260 inline void SetDryRun(bool value) {
261 m_dryRunHasBeenSet = true;
262 m_dryRun = value;
263 }
264 inline CreateGrantRequest& WithDryRun(bool value) {
265 SetDryRun(value);
266 return *this;
267 }
269 private:
270 Aws::String m_keyId;
271
272 Aws::String m_granteePrincipal;
273
274 Aws::String m_retiringPrincipal;
275
276 Aws::Vector<GrantOperation> m_operations;
277
278 GrantConstraints m_constraints;
279
280 Aws::Vector<Aws::String> m_grantTokens;
281
282 Aws::String m_name;
283
284 bool m_dryRun{false};
285 bool m_keyIdHasBeenSet = false;
286 bool m_granteePrincipalHasBeenSet = false;
287 bool m_retiringPrincipalHasBeenSet = false;
288 bool m_operationsHasBeenSet = false;
289 bool m_constraintsHasBeenSet = false;
290 bool m_grantTokensHasBeenSet = false;
291 bool m_nameHasBeenSet = false;
292 bool m_dryRunHasBeenSet = false;
293};
294
295} // namespace Model
296} // namespace KMS
297} // namespace Aws
const GrantConstraints & GetConstraints() const
AWS_KMS_API Aws::String SerializePayload() const override
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 & WithGrantTokens(GrantTokensT &&value)
const Aws::String & GetName() const
void SetGrantTokens(GrantTokensT &&value)
CreateGrantRequest & WithGranteePrincipal(GranteePrincipalT &&value)
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
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