AWS SDK for C++

AWS SDK for C++ Version 1.11.832

Loading...
Searching...
No Matches
PolicyStatement.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/signin/Signin_EXPORTS.h>
11
12#include <utility>
13
14namespace Aws {
15namespace Utils {
16namespace Json {
17class JsonValue;
18class JsonView;
19} // namespace Json
20} // namespace Utils
21namespace Signin {
22namespace Model {
23
31 public:
32 AWS_SIGNIN_API PolicyStatement() = default;
35 AWS_SIGNIN_API Aws::Utils::Json::JsonValue Jsonize() const;
36
38
41 inline const Aws::String& GetEffect() const { return m_effect; }
42 inline bool EffectHasBeenSet() const { return m_effectHasBeenSet; }
43 template <typename EffectT = Aws::String>
44 void SetEffect(EffectT&& value) {
45 m_effectHasBeenSet = true;
46 m_effect = std::forward<EffectT>(value);
47 }
48 template <typename EffectT = Aws::String>
49 PolicyStatement& WithEffect(EffectT&& value) {
50 SetEffect(std::forward<EffectT>(value));
51 return *this;
52 }
54
56
59 inline const Aws::Map<Aws::String, Aws::String>& GetPrincipal() const { return m_principal; }
60 inline bool PrincipalHasBeenSet() const { return m_principalHasBeenSet; }
61 template <typename PrincipalT = Aws::Map<Aws::String, Aws::String>>
62 void SetPrincipal(PrincipalT&& value) {
63 m_principalHasBeenSet = true;
64 m_principal = std::forward<PrincipalT>(value);
65 }
66 template <typename PrincipalT = Aws::Map<Aws::String, Aws::String>>
67 PolicyStatement& WithPrincipal(PrincipalT&& value) {
68 SetPrincipal(std::forward<PrincipalT>(value));
69 return *this;
70 }
71 template <typename PrincipalKeyT = Aws::String, typename PrincipalValueT = Aws::String>
72 PolicyStatement& AddPrincipal(PrincipalKeyT&& key, PrincipalValueT&& value) {
73 m_principalHasBeenSet = true;
74 m_principal.emplace(std::forward<PrincipalKeyT>(key), std::forward<PrincipalValueT>(value));
75 return *this;
76 }
78
80
83 inline const Aws::Vector<Aws::String>& GetAction() const { return m_action; }
84 inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; }
85 template <typename ActionT = Aws::Vector<Aws::String>>
86 void SetAction(ActionT&& value) {
87 m_actionHasBeenSet = true;
88 m_action = std::forward<ActionT>(value);
89 }
90 template <typename ActionT = Aws::Vector<Aws::String>>
91 PolicyStatement& WithAction(ActionT&& value) {
92 SetAction(std::forward<ActionT>(value));
93 return *this;
94 }
95 template <typename ActionT = Aws::String>
96 PolicyStatement& AddAction(ActionT&& value) {
97 m_actionHasBeenSet = true;
98 m_action.emplace_back(std::forward<ActionT>(value));
99 return *this;
100 }
102
104
107 inline const Aws::String& GetResource() const { return m_resource; }
108 inline bool ResourceHasBeenSet() const { return m_resourceHasBeenSet; }
109 template <typename ResourceT = Aws::String>
110 void SetResource(ResourceT&& value) {
111 m_resourceHasBeenSet = true;
112 m_resource = std::forward<ResourceT>(value);
113 }
114 template <typename ResourceT = Aws::String>
115 PolicyStatement& WithResource(ResourceT&& value) {
116 SetResource(std::forward<ResourceT>(value));
117 return *this;
118 }
120
122
126 inline bool ConditionHasBeenSet() const { return m_conditionHasBeenSet; }
127 template <typename ConditionT = Aws::Map<Aws::String, Aws::Map<Aws::String, Aws::Vector<Aws::String>>>>
128 void SetCondition(ConditionT&& value) {
129 m_conditionHasBeenSet = true;
130 m_condition = std::forward<ConditionT>(value);
131 }
132 template <typename ConditionT = Aws::Map<Aws::String, Aws::Map<Aws::String, Aws::Vector<Aws::String>>>>
133 PolicyStatement& WithCondition(ConditionT&& value) {
134 SetCondition(std::forward<ConditionT>(value));
135 return *this;
136 }
137 template <typename ConditionKeyT = Aws::String, typename ConditionValueT = Aws::Map<Aws::String, Aws::Vector<Aws::String>>>
138 PolicyStatement& AddCondition(ConditionKeyT&& key, ConditionValueT&& value) {
139 m_conditionHasBeenSet = true;
140 m_condition.emplace(std::forward<ConditionKeyT>(key), std::forward<ConditionValueT>(value));
141 return *this;
142 }
144 private:
145 Aws::String m_effect;
146
148
150
151 Aws::String m_resource;
152
154 bool m_effectHasBeenSet = false;
155 bool m_principalHasBeenSet = false;
156 bool m_actionHasBeenSet = false;
157 bool m_resourceHasBeenSet = false;
158 bool m_conditionHasBeenSet = false;
159};
160
161} // namespace Model
162} // namespace Signin
163} // namespace Aws
const Aws::Map< Aws::String, Aws::Map< Aws::String, Aws::Vector< Aws::String > > > & GetCondition() const
PolicyStatement & AddAction(ActionT &&value)
PolicyStatement & WithEffect(EffectT &&value)
PolicyStatement & WithResource(ResourceT &&value)
PolicyStatement & AddCondition(ConditionKeyT &&key, ConditionValueT &&value)
PolicyStatement & AddPrincipal(PrincipalKeyT &&key, PrincipalValueT &&value)
void SetResource(ResourceT &&value)
PolicyStatement & WithPrincipal(PrincipalT &&value)
void SetCondition(ConditionT &&value)
PolicyStatement & WithAction(ActionT &&value)
void SetPrincipal(PrincipalT &&value)
AWS_SIGNIN_API PolicyStatement & operator=(Aws::Utils::Json::JsonView jsonValue)
AWS_SIGNIN_API PolicyStatement(Aws::Utils::Json::JsonView jsonValue)
AWS_SIGNIN_API PolicyStatement()=default
AWS_SIGNIN_API Aws::Utils::Json::JsonValue Jsonize() const
const Aws::String & GetResource() const
PolicyStatement & WithCondition(ConditionT &&value)
const Aws::String & GetEffect() const
const Aws::Map< Aws::String, Aws::String > & GetPrincipal() const
const Aws::Vector< Aws::String > & GetAction() const
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
Aws::Utils::Json::JsonValue JsonValue