1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/organizations/Organizations_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/core/utils/DateTime.h>
10 #include <aws/organizations/model/EffectivePolicyType.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Json
18 {
19   class JsonValue;
20   class JsonView;
21 } // namespace Json
22 } // namespace Utils
23 namespace Organizations
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>Contains rules to be applied to the affected accounts. The effective policy
30    * is the aggregation of any policies the account inherits, plus any policy
31    * directly attached to the account.</p><p><h3>See Also:</h3>   <a
32    * href="http://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EffectivePolicy">AWS
33    * API Reference</a></p>
34    */
35   class AWS_ORGANIZATIONS_API EffectivePolicy
36   {
37   public:
38     EffectivePolicy();
39     EffectivePolicy(Aws::Utils::Json::JsonView jsonValue);
40     EffectivePolicy& operator=(Aws::Utils::Json::JsonView jsonValue);
41     Aws::Utils::Json::JsonValue Jsonize() const;
42 
43 
44     /**
45      * <p>The text content of the policy.</p>
46      */
GetPolicyContent()47     inline const Aws::String& GetPolicyContent() const{ return m_policyContent; }
48 
49     /**
50      * <p>The text content of the policy.</p>
51      */
PolicyContentHasBeenSet()52     inline bool PolicyContentHasBeenSet() const { return m_policyContentHasBeenSet; }
53 
54     /**
55      * <p>The text content of the policy.</p>
56      */
SetPolicyContent(const Aws::String & value)57     inline void SetPolicyContent(const Aws::String& value) { m_policyContentHasBeenSet = true; m_policyContent = value; }
58 
59     /**
60      * <p>The text content of the policy.</p>
61      */
SetPolicyContent(Aws::String && value)62     inline void SetPolicyContent(Aws::String&& value) { m_policyContentHasBeenSet = true; m_policyContent = std::move(value); }
63 
64     /**
65      * <p>The text content of the policy.</p>
66      */
SetPolicyContent(const char * value)67     inline void SetPolicyContent(const char* value) { m_policyContentHasBeenSet = true; m_policyContent.assign(value); }
68 
69     /**
70      * <p>The text content of the policy.</p>
71      */
WithPolicyContent(const Aws::String & value)72     inline EffectivePolicy& WithPolicyContent(const Aws::String& value) { SetPolicyContent(value); return *this;}
73 
74     /**
75      * <p>The text content of the policy.</p>
76      */
WithPolicyContent(Aws::String && value)77     inline EffectivePolicy& WithPolicyContent(Aws::String&& value) { SetPolicyContent(std::move(value)); return *this;}
78 
79     /**
80      * <p>The text content of the policy.</p>
81      */
WithPolicyContent(const char * value)82     inline EffectivePolicy& WithPolicyContent(const char* value) { SetPolicyContent(value); return *this;}
83 
84 
85     /**
86      * <p>The time of the last update to this policy.</p>
87      */
GetLastUpdatedTimestamp()88     inline const Aws::Utils::DateTime& GetLastUpdatedTimestamp() const{ return m_lastUpdatedTimestamp; }
89 
90     /**
91      * <p>The time of the last update to this policy.</p>
92      */
LastUpdatedTimestampHasBeenSet()93     inline bool LastUpdatedTimestampHasBeenSet() const { return m_lastUpdatedTimestampHasBeenSet; }
94 
95     /**
96      * <p>The time of the last update to this policy.</p>
97      */
SetLastUpdatedTimestamp(const Aws::Utils::DateTime & value)98     inline void SetLastUpdatedTimestamp(const Aws::Utils::DateTime& value) { m_lastUpdatedTimestampHasBeenSet = true; m_lastUpdatedTimestamp = value; }
99 
100     /**
101      * <p>The time of the last update to this policy.</p>
102      */
SetLastUpdatedTimestamp(Aws::Utils::DateTime && value)103     inline void SetLastUpdatedTimestamp(Aws::Utils::DateTime&& value) { m_lastUpdatedTimestampHasBeenSet = true; m_lastUpdatedTimestamp = std::move(value); }
104 
105     /**
106      * <p>The time of the last update to this policy.</p>
107      */
WithLastUpdatedTimestamp(const Aws::Utils::DateTime & value)108     inline EffectivePolicy& WithLastUpdatedTimestamp(const Aws::Utils::DateTime& value) { SetLastUpdatedTimestamp(value); return *this;}
109 
110     /**
111      * <p>The time of the last update to this policy.</p>
112      */
WithLastUpdatedTimestamp(Aws::Utils::DateTime && value)113     inline EffectivePolicy& WithLastUpdatedTimestamp(Aws::Utils::DateTime&& value) { SetLastUpdatedTimestamp(std::move(value)); return *this;}
114 
115 
116     /**
117      * <p>The account ID of the policy target. </p>
118      */
GetTargetId()119     inline const Aws::String& GetTargetId() const{ return m_targetId; }
120 
121     /**
122      * <p>The account ID of the policy target. </p>
123      */
TargetIdHasBeenSet()124     inline bool TargetIdHasBeenSet() const { return m_targetIdHasBeenSet; }
125 
126     /**
127      * <p>The account ID of the policy target. </p>
128      */
SetTargetId(const Aws::String & value)129     inline void SetTargetId(const Aws::String& value) { m_targetIdHasBeenSet = true; m_targetId = value; }
130 
131     /**
132      * <p>The account ID of the policy target. </p>
133      */
SetTargetId(Aws::String && value)134     inline void SetTargetId(Aws::String&& value) { m_targetIdHasBeenSet = true; m_targetId = std::move(value); }
135 
136     /**
137      * <p>The account ID of the policy target. </p>
138      */
SetTargetId(const char * value)139     inline void SetTargetId(const char* value) { m_targetIdHasBeenSet = true; m_targetId.assign(value); }
140 
141     /**
142      * <p>The account ID of the policy target. </p>
143      */
WithTargetId(const Aws::String & value)144     inline EffectivePolicy& WithTargetId(const Aws::String& value) { SetTargetId(value); return *this;}
145 
146     /**
147      * <p>The account ID of the policy target. </p>
148      */
WithTargetId(Aws::String && value)149     inline EffectivePolicy& WithTargetId(Aws::String&& value) { SetTargetId(std::move(value)); return *this;}
150 
151     /**
152      * <p>The account ID of the policy target. </p>
153      */
WithTargetId(const char * value)154     inline EffectivePolicy& WithTargetId(const char* value) { SetTargetId(value); return *this;}
155 
156 
157     /**
158      * <p>The policy type.</p>
159      */
GetPolicyType()160     inline const EffectivePolicyType& GetPolicyType() const{ return m_policyType; }
161 
162     /**
163      * <p>The policy type.</p>
164      */
PolicyTypeHasBeenSet()165     inline bool PolicyTypeHasBeenSet() const { return m_policyTypeHasBeenSet; }
166 
167     /**
168      * <p>The policy type.</p>
169      */
SetPolicyType(const EffectivePolicyType & value)170     inline void SetPolicyType(const EffectivePolicyType& value) { m_policyTypeHasBeenSet = true; m_policyType = value; }
171 
172     /**
173      * <p>The policy type.</p>
174      */
SetPolicyType(EffectivePolicyType && value)175     inline void SetPolicyType(EffectivePolicyType&& value) { m_policyTypeHasBeenSet = true; m_policyType = std::move(value); }
176 
177     /**
178      * <p>The policy type.</p>
179      */
WithPolicyType(const EffectivePolicyType & value)180     inline EffectivePolicy& WithPolicyType(const EffectivePolicyType& value) { SetPolicyType(value); return *this;}
181 
182     /**
183      * <p>The policy type.</p>
184      */
WithPolicyType(EffectivePolicyType && value)185     inline EffectivePolicy& WithPolicyType(EffectivePolicyType&& value) { SetPolicyType(std::move(value)); return *this;}
186 
187   private:
188 
189     Aws::String m_policyContent;
190     bool m_policyContentHasBeenSet;
191 
192     Aws::Utils::DateTime m_lastUpdatedTimestamp;
193     bool m_lastUpdatedTimestampHasBeenSet;
194 
195     Aws::String m_targetId;
196     bool m_targetIdHasBeenSet;
197 
198     EffectivePolicyType m_policyType;
199     bool m_policyTypeHasBeenSet;
200   };
201 
202 } // namespace Model
203 } // namespace Organizations
204 } // namespace Aws
205