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/organizations/OrganizationsRequest.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <utility> 11 12 namespace Aws 13 { 14 namespace Organizations 15 { 16 namespace Model 17 { 18 19 /** 20 */ 21 class AWS_ORGANIZATIONS_API AttachPolicyRequest : public OrganizationsRequest 22 { 23 public: 24 AttachPolicyRequest(); 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. GetServiceRequestName()30 inline virtual const char* GetServiceRequestName() const override { return "AttachPolicy"; } 31 32 Aws::String SerializePayload() const override; 33 34 Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; 35 36 37 /** 38 * <p>The unique identifier (ID) of the policy that you want to attach to the 39 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 40 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 41 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 42 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 43 */ GetPolicyId()44 inline const Aws::String& GetPolicyId() const{ return m_policyId; } 45 46 /** 47 * <p>The unique identifier (ID) of the policy that you want to attach to the 48 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 49 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 50 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 51 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 52 */ PolicyIdHasBeenSet()53 inline bool PolicyIdHasBeenSet() const { return m_policyIdHasBeenSet; } 54 55 /** 56 * <p>The unique identifier (ID) of the policy that you want to attach to the 57 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 58 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 59 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 60 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 61 */ SetPolicyId(const Aws::String & value)62 inline void SetPolicyId(const Aws::String& value) { m_policyIdHasBeenSet = true; m_policyId = value; } 63 64 /** 65 * <p>The unique identifier (ID) of the policy that you want to attach to the 66 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 67 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 68 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 69 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 70 */ SetPolicyId(Aws::String && value)71 inline void SetPolicyId(Aws::String&& value) { m_policyIdHasBeenSet = true; m_policyId = std::move(value); } 72 73 /** 74 * <p>The unique identifier (ID) of the policy that you want to attach to the 75 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 76 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 77 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 78 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 79 */ SetPolicyId(const char * value)80 inline void SetPolicyId(const char* value) { m_policyIdHasBeenSet = true; m_policyId.assign(value); } 81 82 /** 83 * <p>The unique identifier (ID) of the policy that you want to attach to the 84 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 85 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 86 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 87 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 88 */ WithPolicyId(const Aws::String & value)89 inline AttachPolicyRequest& WithPolicyId(const Aws::String& value) { SetPolicyId(value); return *this;} 90 91 /** 92 * <p>The unique identifier (ID) of the policy that you want to attach to the 93 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 94 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 95 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 96 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 97 */ WithPolicyId(Aws::String && value)98 inline AttachPolicyRequest& WithPolicyId(Aws::String&& value) { SetPolicyId(std::move(value)); return *this;} 99 100 /** 101 * <p>The unique identifier (ID) of the policy that you want to attach to the 102 * target. You can get the ID for the policy by calling the <a>ListPolicies</a> 103 * operation.</p> <p>The <a href="http://wikipedia.org/wiki/regex">regex 104 * pattern</a> for a policy ID string requires "p-" followed by from 8 to 128 105 * lowercase or uppercase letters, digits, or the underscore character (_).</p> 106 */ WithPolicyId(const char * value)107 inline AttachPolicyRequest& WithPolicyId(const char* value) { SetPolicyId(value); return *this;} 108 109 110 /** 111 * <p>The unique identifier (ID) of the root, OU, or account that you want to 112 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 113 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 114 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 115 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 116 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 117 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 118 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 119 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 120 * of the root that the OU is in). This string is followed by a second "-" dash and 121 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 122 */ GetTargetId()123 inline const Aws::String& GetTargetId() const{ return m_targetId; } 124 125 /** 126 * <p>The unique identifier (ID) of the root, OU, or account that you want to 127 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 128 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 129 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 130 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 131 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 132 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 133 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 134 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 135 * of the root that the OU is in). This string is followed by a second "-" dash and 136 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 137 */ TargetIdHasBeenSet()138 inline bool TargetIdHasBeenSet() const { return m_targetIdHasBeenSet; } 139 140 /** 141 * <p>The unique identifier (ID) of the root, OU, or account that you want to 142 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 143 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 144 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 145 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 146 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 147 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 148 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 149 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 150 * of the root that the OU is in). This string is followed by a second "-" dash and 151 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 152 */ SetTargetId(const Aws::String & value)153 inline void SetTargetId(const Aws::String& value) { m_targetIdHasBeenSet = true; m_targetId = value; } 154 155 /** 156 * <p>The unique identifier (ID) of the root, OU, or account that you want to 157 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 158 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 159 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 160 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 161 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 162 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 163 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 164 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 165 * of the root that the OU is in). This string is followed by a second "-" dash and 166 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 167 */ SetTargetId(Aws::String && value)168 inline void SetTargetId(Aws::String&& value) { m_targetIdHasBeenSet = true; m_targetId = std::move(value); } 169 170 /** 171 * <p>The unique identifier (ID) of the root, OU, or account that you want to 172 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 173 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 174 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 175 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 176 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 177 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 178 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 179 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 180 * of the root that the OU is in). This string is followed by a second "-" dash and 181 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 182 */ SetTargetId(const char * value)183 inline void SetTargetId(const char* value) { m_targetIdHasBeenSet = true; m_targetId.assign(value); } 184 185 /** 186 * <p>The unique identifier (ID) of the root, OU, or account that you want to 187 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 188 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 189 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 190 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 191 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 192 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 193 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 194 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 195 * of the root that the OU is in). This string is followed by a second "-" dash and 196 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 197 */ WithTargetId(const Aws::String & value)198 inline AttachPolicyRequest& WithTargetId(const Aws::String& value) { SetTargetId(value); return *this;} 199 200 /** 201 * <p>The unique identifier (ID) of the root, OU, or account that you want to 202 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 203 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 204 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 205 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 206 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 207 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 208 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 209 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 210 * of the root that the OU is in). This string is followed by a second "-" dash and 211 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 212 */ WithTargetId(Aws::String && value)213 inline AttachPolicyRequest& WithTargetId(Aws::String&& value) { SetTargetId(std::move(value)); return *this;} 214 215 /** 216 * <p>The unique identifier (ID) of the root, OU, or account that you want to 217 * attach the policy to. You can get the ID by calling the <a>ListRoots</a>, 218 * <a>ListOrganizationalUnitsForParent</a>, or <a>ListAccounts</a> operations.</p> 219 * <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for a target 220 * ID string requires one of the following:</p> <ul> <li> <p> <b>Root</b> - A 221 * string that begins with "r-" followed by from 4 to 32 lowercase letters or 222 * digits.</p> </li> <li> <p> <b>Account</b> - A string that consists of exactly 12 223 * digits.</p> </li> <li> <p> <b>Organizational unit (OU)</b> - A string that 224 * begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID 225 * of the root that the OU is in). This string is followed by a second "-" dash and 226 * from 8 to 32 additional lowercase letters or digits.</p> </li> </ul> 227 */ WithTargetId(const char * value)228 inline AttachPolicyRequest& WithTargetId(const char* value) { SetTargetId(value); return *this;} 229 230 private: 231 232 Aws::String m_policyId; 233 bool m_policyIdHasBeenSet; 234 235 Aws::String m_targetId; 236 bool m_targetIdHasBeenSet; 237 }; 238 239 } // namespace Model 240 } // namespace Organizations 241 } // namespace Aws 242