AWS SDK for C++

AWS SDK for C++ Version 1.11.719

Loading...
Searching...
No Matches
AssumeRoleRequest.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/sts/STSRequest.h>
10#include <aws/sts/STS_EXPORTS.h>
11#include <aws/sts/model/PolicyDescriptorType.h>
12#include <aws/sts/model/ProvidedContext.h>
13#include <aws/sts/model/Tag.h>
14
15#include <utility>
16
17namespace Aws {
18namespace STS {
19namespace Model {
20
24 public:
25 AWS_STS_API AssumeRoleRequest() = 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 "AssumeRole"; }
32
33 AWS_STS_API Aws::String SerializePayload() const override;
34
35 protected:
36 AWS_STS_API void DumpBodyToUrl(Aws::Http::URI& uri) const override;
37
38 public:
40
43 inline const Aws::String& GetRoleArn() const { return m_roleArn; }
44 inline bool RoleArnHasBeenSet() const { return m_roleArnHasBeenSet; }
45 template <typename RoleArnT = Aws::String>
46 void SetRoleArn(RoleArnT&& value) {
47 m_roleArnHasBeenSet = true;
48 m_roleArn = std::forward<RoleArnT>(value);
49 }
50 template <typename RoleArnT = Aws::String>
51 AssumeRoleRequest& WithRoleArn(RoleArnT&& value) {
52 SetRoleArn(std::forward<RoleArnT>(value));
53 return *this;
54 }
56
58
78 inline const Aws::String& GetRoleSessionName() const { return m_roleSessionName; }
79 inline bool RoleSessionNameHasBeenSet() const { return m_roleSessionNameHasBeenSet; }
80 template <typename RoleSessionNameT = Aws::String>
81 void SetRoleSessionName(RoleSessionNameT&& value) {
82 m_roleSessionNameHasBeenSet = true;
83 m_roleSessionName = std::forward<RoleSessionNameT>(value);
84 }
85 template <typename RoleSessionNameT = Aws::String>
86 AssumeRoleRequest& WithRoleSessionName(RoleSessionNameT&& value) {
87 SetRoleSessionName(std::forward<RoleSessionNameT>(value));
88 return *this;
89 }
91
93
118 inline const Aws::Vector<PolicyDescriptorType>& GetPolicyArns() const { return m_policyArns; }
119 inline bool PolicyArnsHasBeenSet() const { return m_policyArnsHasBeenSet; }
120 template <typename PolicyArnsT = Aws::Vector<PolicyDescriptorType>>
121 void SetPolicyArns(PolicyArnsT&& value) {
122 m_policyArnsHasBeenSet = true;
123 m_policyArns = std::forward<PolicyArnsT>(value);
124 }
125 template <typename PolicyArnsT = Aws::Vector<PolicyDescriptorType>>
126 AssumeRoleRequest& WithPolicyArns(PolicyArnsT&& value) {
127 SetPolicyArns(std::forward<PolicyArnsT>(value));
128 return *this;
129 }
130 template <typename PolicyArnsT = PolicyDescriptorType>
131 AssumeRoleRequest& AddPolicyArns(PolicyArnsT&& value) {
132 m_policyArnsHasBeenSet = true;
133 m_policyArns.emplace_back(std::forward<PolicyArnsT>(value));
134 return *this;
135 }
137
139
165 inline const Aws::String& GetPolicy() const { return m_policy; }
166 inline bool PolicyHasBeenSet() const { return m_policyHasBeenSet; }
167 template <typename PolicyT = Aws::String>
168 void SetPolicy(PolicyT&& value) {
169 m_policyHasBeenSet = true;
170 m_policy = std::forward<PolicyT>(value);
171 }
172 template <typename PolicyT = Aws::String>
173 AssumeRoleRequest& WithPolicy(PolicyT&& value) {
174 SetPolicy(std::forward<PolicyT>(value));
175 return *this;
176 }
178
180
208 inline int GetDurationSeconds() const { return m_durationSeconds; }
209 inline bool DurationSecondsHasBeenSet() const { return m_durationSecondsHasBeenSet; }
210 inline void SetDurationSeconds(int value) {
211 m_durationSecondsHasBeenSet = true;
212 m_durationSeconds = value;
213 }
215 SetDurationSeconds(value);
216 return *this;
217 }
219
221
254 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
255 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
256 template <typename TagsT = Aws::Vector<Tag>>
257 void SetTags(TagsT&& value) {
258 m_tagsHasBeenSet = true;
259 m_tags = std::forward<TagsT>(value);
260 }
261 template <typename TagsT = Aws::Vector<Tag>>
262 AssumeRoleRequest& WithTags(TagsT&& value) {
263 SetTags(std::forward<TagsT>(value));
264 return *this;
265 }
266 template <typename TagsT = Tag>
267 AssumeRoleRequest& AddTags(TagsT&& value) {
268 m_tagsHasBeenSet = true;
269 m_tags.emplace_back(std::forward<TagsT>(value));
270 return *this;
271 }
273
275
285 inline const Aws::Vector<Aws::String>& GetTransitiveTagKeys() const { return m_transitiveTagKeys; }
286 inline bool TransitiveTagKeysHasBeenSet() const { return m_transitiveTagKeysHasBeenSet; }
287 template <typename TransitiveTagKeysT = Aws::Vector<Aws::String>>
288 void SetTransitiveTagKeys(TransitiveTagKeysT&& value) {
289 m_transitiveTagKeysHasBeenSet = true;
290 m_transitiveTagKeys = std::forward<TransitiveTagKeysT>(value);
291 }
292 template <typename TransitiveTagKeysT = Aws::Vector<Aws::String>>
293 AssumeRoleRequest& WithTransitiveTagKeys(TransitiveTagKeysT&& value) {
294 SetTransitiveTagKeys(std::forward<TransitiveTagKeysT>(value));
295 return *this;
296 }
297 template <typename TransitiveTagKeysT = Aws::String>
298 AssumeRoleRequest& AddTransitiveTagKeys(TransitiveTagKeysT&& value) {
299 m_transitiveTagKeysHasBeenSet = true;
300 m_transitiveTagKeys.emplace_back(std::forward<TransitiveTagKeysT>(value));
301 return *this;
302 }
304
306
323 inline const Aws::String& GetExternalId() const { return m_externalId; }
324 inline bool ExternalIdHasBeenSet() const { return m_externalIdHasBeenSet; }
325 template <typename ExternalIdT = Aws::String>
326 void SetExternalId(ExternalIdT&& value) {
327 m_externalIdHasBeenSet = true;
328 m_externalId = std::forward<ExternalIdT>(value);
329 }
330 template <typename ExternalIdT = Aws::String>
331 AssumeRoleRequest& WithExternalId(ExternalIdT&& value) {
332 SetExternalId(std::forward<ExternalIdT>(value));
333 return *this;
334 }
336
338
349 inline const Aws::String& GetSerialNumber() const { return m_serialNumber; }
350 inline bool SerialNumberHasBeenSet() const { return m_serialNumberHasBeenSet; }
351 template <typename SerialNumberT = Aws::String>
352 void SetSerialNumber(SerialNumberT&& value) {
353 m_serialNumberHasBeenSet = true;
354 m_serialNumber = std::forward<SerialNumberT>(value);
355 }
356 template <typename SerialNumberT = Aws::String>
357 AssumeRoleRequest& WithSerialNumber(SerialNumberT&& value) {
358 SetSerialNumber(std::forward<SerialNumberT>(value));
359 return *this;
360 }
362
364
372 inline const Aws::String& GetTokenCode() const { return m_tokenCode; }
373 inline bool TokenCodeHasBeenSet() const { return m_tokenCodeHasBeenSet; }
374 template <typename TokenCodeT = Aws::String>
375 void SetTokenCode(TokenCodeT&& value) {
376 m_tokenCodeHasBeenSet = true;
377 m_tokenCode = std::forward<TokenCodeT>(value);
378 }
379 template <typename TokenCodeT = Aws::String>
380 AssumeRoleRequest& WithTokenCode(TokenCodeT&& value) {
381 SetTokenCode(std::forward<TokenCodeT>(value));
382 return *this;
383 }
385
387
408 inline const Aws::String& GetSourceIdentity() const { return m_sourceIdentity; }
409 inline bool SourceIdentityHasBeenSet() const { return m_sourceIdentityHasBeenSet; }
410 template <typename SourceIdentityT = Aws::String>
411 void SetSourceIdentity(SourceIdentityT&& value) {
412 m_sourceIdentityHasBeenSet = true;
413 m_sourceIdentity = std::forward<SourceIdentityT>(value);
414 }
415 template <typename SourceIdentityT = Aws::String>
416 AssumeRoleRequest& WithSourceIdentity(SourceIdentityT&& value) {
417 SetSourceIdentity(std::forward<SourceIdentityT>(value));
418 return *this;
419 }
421
423
433 inline const Aws::Vector<ProvidedContext>& GetProvidedContexts() const { return m_providedContexts; }
434 inline bool ProvidedContextsHasBeenSet() const { return m_providedContextsHasBeenSet; }
435 template <typename ProvidedContextsT = Aws::Vector<ProvidedContext>>
436 void SetProvidedContexts(ProvidedContextsT&& value) {
437 m_providedContextsHasBeenSet = true;
438 m_providedContexts = std::forward<ProvidedContextsT>(value);
439 }
440 template <typename ProvidedContextsT = Aws::Vector<ProvidedContext>>
441 AssumeRoleRequest& WithProvidedContexts(ProvidedContextsT&& value) {
442 SetProvidedContexts(std::forward<ProvidedContextsT>(value));
443 return *this;
444 }
445 template <typename ProvidedContextsT = ProvidedContext>
446 AssumeRoleRequest& AddProvidedContexts(ProvidedContextsT&& value) {
447 m_providedContextsHasBeenSet = true;
448 m_providedContexts.emplace_back(std::forward<ProvidedContextsT>(value));
449 return *this;
450 }
452 private:
453 Aws::String m_roleArn;
454
455 Aws::String m_roleSessionName;
456
458
459 Aws::String m_policy;
460
461 int m_durationSeconds{0};
462
463 Aws::Vector<Tag> m_tags;
464
465 Aws::Vector<Aws::String> m_transitiveTagKeys;
466
467 Aws::String m_externalId;
468
469 Aws::String m_serialNumber;
470
471 Aws::String m_tokenCode;
472
473 Aws::String m_sourceIdentity;
474
475 Aws::Vector<ProvidedContext> m_providedContexts;
476 bool m_roleArnHasBeenSet = false;
477 bool m_roleSessionNameHasBeenSet = false;
478 bool m_policyArnsHasBeenSet = false;
479 bool m_policyHasBeenSet = false;
480 bool m_durationSecondsHasBeenSet = false;
481 bool m_tagsHasBeenSet = false;
482 bool m_transitiveTagKeysHasBeenSet = false;
483 bool m_externalIdHasBeenSet = false;
484 bool m_serialNumberHasBeenSet = false;
485 bool m_tokenCodeHasBeenSet = false;
486 bool m_sourceIdentityHasBeenSet = false;
487 bool m_providedContextsHasBeenSet = false;
488};
489
490} // namespace Model
491} // namespace STS
492} // namespace Aws
virtual const char * GetServiceRequestName() const override
void SetSerialNumber(SerialNumberT &&value)
const Aws::String & GetRoleArn() const
AssumeRoleRequest & WithTags(TagsT &&value)
void SetTransitiveTagKeys(TransitiveTagKeysT &&value)
const Aws::String & GetSerialNumber() const
AssumeRoleRequest & AddProvidedContexts(ProvidedContextsT &&value)
AssumeRoleRequest & WithTokenCode(TokenCodeT &&value)
AssumeRoleRequest & AddTags(TagsT &&value)
AssumeRoleRequest & AddPolicyArns(PolicyArnsT &&value)
void SetTokenCode(TokenCodeT &&value)
AssumeRoleRequest & WithPolicy(PolicyT &&value)
AssumeRoleRequest & WithRoleArn(RoleArnT &&value)
AssumeRoleRequest & WithRoleSessionName(RoleSessionNameT &&value)
AWS_STS_API AssumeRoleRequest()=default
AssumeRoleRequest & WithDurationSeconds(int value)
const Aws::String & GetPolicy() const
AWS_STS_API Aws::String SerializePayload() const override
const Aws::String & GetSourceIdentity() const
AssumeRoleRequest & WithPolicyArns(PolicyArnsT &&value)
const Aws::Vector< Aws::String > & GetTransitiveTagKeys() const
AssumeRoleRequest & WithSourceIdentity(SourceIdentityT &&value)
void SetPolicyArns(PolicyArnsT &&value)
AWS_STS_API void DumpBodyToUrl(Aws::Http::URI &uri) const override
void SetRoleSessionName(RoleSessionNameT &&value)
AssumeRoleRequest & WithSerialNumber(SerialNumberT &&value)
void SetExternalId(ExternalIdT &&value)
const Aws::String & GetTokenCode() const
AssumeRoleRequest & WithTransitiveTagKeys(TransitiveTagKeysT &&value)
AssumeRoleRequest & WithExternalId(ExternalIdT &&value)
AssumeRoleRequest & WithProvidedContexts(ProvidedContextsT &&value)
const Aws::String & GetExternalId() const
const Aws::Vector< Tag > & GetTags() const
void SetSourceIdentity(SourceIdentityT &&value)
AssumeRoleRequest & AddTransitiveTagKeys(TransitiveTagKeysT &&value)
const Aws::Vector< ProvidedContext > & GetProvidedContexts() const
const Aws::String & GetRoleSessionName() const
const Aws::Vector< PolicyDescriptorType > & GetPolicyArns() const
void SetProvidedContexts(ProvidedContextsT &&value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector