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/acm-pca/ACMPCA_EXPORTS.h>
8 #include <aws/acm-pca/ACMPCARequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/core/utils/memory/stl/AWSVector.h>
11 #include <aws/acm-pca/model/ActionType.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace ACMPCA
17 {
18 namespace Model
19 {
20 
21   /**
22    */
23   class AWS_ACMPCA_API CreatePermissionRequest : public ACMPCARequest
24   {
25   public:
26     CreatePermissionRequest();
27 
28     // Service request name is the Operation name which will send this request out,
29     // each operation should has unique request name, so that we can get operation's name from this request.
30     // Note: this is not true for response, multiple operations may have the same response name,
31     // so we can not get operation's name from response.
GetServiceRequestName()32     inline virtual const char* GetServiceRequestName() const override { return "CreatePermission"; }
33 
34     Aws::String SerializePayload() const override;
35 
36     Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
37 
38 
39     /**
40      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
41      * find the ARN by calling the <a
42      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
43      * action. This must have the following form: </p> <p>
44      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
45      * </code>. </p>
46      */
GetCertificateAuthorityArn()47     inline const Aws::String& GetCertificateAuthorityArn() const{ return m_certificateAuthorityArn; }
48 
49     /**
50      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
51      * find the ARN by calling the <a
52      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
53      * action. This must have the following form: </p> <p>
54      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
55      * </code>. </p>
56      */
CertificateAuthorityArnHasBeenSet()57     inline bool CertificateAuthorityArnHasBeenSet() const { return m_certificateAuthorityArnHasBeenSet; }
58 
59     /**
60      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
61      * find the ARN by calling the <a
62      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
63      * action. This must have the following form: </p> <p>
64      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
65      * </code>. </p>
66      */
SetCertificateAuthorityArn(const Aws::String & value)67     inline void SetCertificateAuthorityArn(const Aws::String& value) { m_certificateAuthorityArnHasBeenSet = true; m_certificateAuthorityArn = value; }
68 
69     /**
70      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
71      * find the ARN by calling the <a
72      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
73      * action. This must have the following form: </p> <p>
74      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
75      * </code>. </p>
76      */
SetCertificateAuthorityArn(Aws::String && value)77     inline void SetCertificateAuthorityArn(Aws::String&& value) { m_certificateAuthorityArnHasBeenSet = true; m_certificateAuthorityArn = std::move(value); }
78 
79     /**
80      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
81      * find the ARN by calling the <a
82      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
83      * action. This must have the following form: </p> <p>
84      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
85      * </code>. </p>
86      */
SetCertificateAuthorityArn(const char * value)87     inline void SetCertificateAuthorityArn(const char* value) { m_certificateAuthorityArnHasBeenSet = true; m_certificateAuthorityArn.assign(value); }
88 
89     /**
90      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
91      * find the ARN by calling the <a
92      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
93      * action. This must have the following form: </p> <p>
94      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
95      * </code>. </p>
96      */
WithCertificateAuthorityArn(const Aws::String & value)97     inline CreatePermissionRequest& WithCertificateAuthorityArn(const Aws::String& value) { SetCertificateAuthorityArn(value); return *this;}
98 
99     /**
100      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
101      * find the ARN by calling the <a
102      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
103      * action. This must have the following form: </p> <p>
104      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
105      * </code>. </p>
106      */
WithCertificateAuthorityArn(Aws::String && value)107     inline CreatePermissionRequest& WithCertificateAuthorityArn(Aws::String&& value) { SetCertificateAuthorityArn(std::move(value)); return *this;}
108 
109     /**
110      * <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can
111      * find the ARN by calling the <a
112      * href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>
113      * action. This must have the following form: </p> <p>
114      * <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>
115      * </code>. </p>
116      */
WithCertificateAuthorityArn(const char * value)117     inline CreatePermissionRequest& WithCertificateAuthorityArn(const char* value) { SetCertificateAuthorityArn(value); return *this;}
118 
119 
120     /**
121      * <p>The AWS service or identity that receives the permission. At this time, the
122      * only valid principal is <code>acm.amazonaws.com</code>.</p>
123      */
GetPrincipal()124     inline const Aws::String& GetPrincipal() const{ return m_principal; }
125 
126     /**
127      * <p>The AWS service or identity that receives the permission. At this time, the
128      * only valid principal is <code>acm.amazonaws.com</code>.</p>
129      */
PrincipalHasBeenSet()130     inline bool PrincipalHasBeenSet() const { return m_principalHasBeenSet; }
131 
132     /**
133      * <p>The AWS service or identity that receives the permission. At this time, the
134      * only valid principal is <code>acm.amazonaws.com</code>.</p>
135      */
SetPrincipal(const Aws::String & value)136     inline void SetPrincipal(const Aws::String& value) { m_principalHasBeenSet = true; m_principal = value; }
137 
138     /**
139      * <p>The AWS service or identity that receives the permission. At this time, the
140      * only valid principal is <code>acm.amazonaws.com</code>.</p>
141      */
SetPrincipal(Aws::String && value)142     inline void SetPrincipal(Aws::String&& value) { m_principalHasBeenSet = true; m_principal = std::move(value); }
143 
144     /**
145      * <p>The AWS service or identity that receives the permission. At this time, the
146      * only valid principal is <code>acm.amazonaws.com</code>.</p>
147      */
SetPrincipal(const char * value)148     inline void SetPrincipal(const char* value) { m_principalHasBeenSet = true; m_principal.assign(value); }
149 
150     /**
151      * <p>The AWS service or identity that receives the permission. At this time, the
152      * only valid principal is <code>acm.amazonaws.com</code>.</p>
153      */
WithPrincipal(const Aws::String & value)154     inline CreatePermissionRequest& WithPrincipal(const Aws::String& value) { SetPrincipal(value); return *this;}
155 
156     /**
157      * <p>The AWS service or identity that receives the permission. At this time, the
158      * only valid principal is <code>acm.amazonaws.com</code>.</p>
159      */
WithPrincipal(Aws::String && value)160     inline CreatePermissionRequest& WithPrincipal(Aws::String&& value) { SetPrincipal(std::move(value)); return *this;}
161 
162     /**
163      * <p>The AWS service or identity that receives the permission. At this time, the
164      * only valid principal is <code>acm.amazonaws.com</code>.</p>
165      */
WithPrincipal(const char * value)166     inline CreatePermissionRequest& WithPrincipal(const char* value) { SetPrincipal(value); return *this;}
167 
168 
169     /**
170      * <p>The ID of the calling account.</p>
171      */
GetSourceAccount()172     inline const Aws::String& GetSourceAccount() const{ return m_sourceAccount; }
173 
174     /**
175      * <p>The ID of the calling account.</p>
176      */
SourceAccountHasBeenSet()177     inline bool SourceAccountHasBeenSet() const { return m_sourceAccountHasBeenSet; }
178 
179     /**
180      * <p>The ID of the calling account.</p>
181      */
SetSourceAccount(const Aws::String & value)182     inline void SetSourceAccount(const Aws::String& value) { m_sourceAccountHasBeenSet = true; m_sourceAccount = value; }
183 
184     /**
185      * <p>The ID of the calling account.</p>
186      */
SetSourceAccount(Aws::String && value)187     inline void SetSourceAccount(Aws::String&& value) { m_sourceAccountHasBeenSet = true; m_sourceAccount = std::move(value); }
188 
189     /**
190      * <p>The ID of the calling account.</p>
191      */
SetSourceAccount(const char * value)192     inline void SetSourceAccount(const char* value) { m_sourceAccountHasBeenSet = true; m_sourceAccount.assign(value); }
193 
194     /**
195      * <p>The ID of the calling account.</p>
196      */
WithSourceAccount(const Aws::String & value)197     inline CreatePermissionRequest& WithSourceAccount(const Aws::String& value) { SetSourceAccount(value); return *this;}
198 
199     /**
200      * <p>The ID of the calling account.</p>
201      */
WithSourceAccount(Aws::String && value)202     inline CreatePermissionRequest& WithSourceAccount(Aws::String&& value) { SetSourceAccount(std::move(value)); return *this;}
203 
204     /**
205      * <p>The ID of the calling account.</p>
206      */
WithSourceAccount(const char * value)207     inline CreatePermissionRequest& WithSourceAccount(const char* value) { SetSourceAccount(value); return *this;}
208 
209 
210     /**
211      * <p>The actions that the specified AWS service principal can use. These include
212      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
213      * <code>ListPermissions</code>.</p>
214      */
GetActions()215     inline const Aws::Vector<ActionType>& GetActions() const{ return m_actions; }
216 
217     /**
218      * <p>The actions that the specified AWS service principal can use. These include
219      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
220      * <code>ListPermissions</code>.</p>
221      */
ActionsHasBeenSet()222     inline bool ActionsHasBeenSet() const { return m_actionsHasBeenSet; }
223 
224     /**
225      * <p>The actions that the specified AWS service principal can use. These include
226      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
227      * <code>ListPermissions</code>.</p>
228      */
SetActions(const Aws::Vector<ActionType> & value)229     inline void SetActions(const Aws::Vector<ActionType>& value) { m_actionsHasBeenSet = true; m_actions = value; }
230 
231     /**
232      * <p>The actions that the specified AWS service principal can use. These include
233      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
234      * <code>ListPermissions</code>.</p>
235      */
SetActions(Aws::Vector<ActionType> && value)236     inline void SetActions(Aws::Vector<ActionType>&& value) { m_actionsHasBeenSet = true; m_actions = std::move(value); }
237 
238     /**
239      * <p>The actions that the specified AWS service principal can use. These include
240      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
241      * <code>ListPermissions</code>.</p>
242      */
WithActions(const Aws::Vector<ActionType> & value)243     inline CreatePermissionRequest& WithActions(const Aws::Vector<ActionType>& value) { SetActions(value); return *this;}
244 
245     /**
246      * <p>The actions that the specified AWS service principal can use. These include
247      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
248      * <code>ListPermissions</code>.</p>
249      */
WithActions(Aws::Vector<ActionType> && value)250     inline CreatePermissionRequest& WithActions(Aws::Vector<ActionType>&& value) { SetActions(std::move(value)); return *this;}
251 
252     /**
253      * <p>The actions that the specified AWS service principal can use. These include
254      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
255      * <code>ListPermissions</code>.</p>
256      */
AddActions(const ActionType & value)257     inline CreatePermissionRequest& AddActions(const ActionType& value) { m_actionsHasBeenSet = true; m_actions.push_back(value); return *this; }
258 
259     /**
260      * <p>The actions that the specified AWS service principal can use. These include
261      * <code>IssueCertificate</code>, <code>GetCertificate</code>, and
262      * <code>ListPermissions</code>.</p>
263      */
AddActions(ActionType && value)264     inline CreatePermissionRequest& AddActions(ActionType&& value) { m_actionsHasBeenSet = true; m_actions.push_back(std::move(value)); return *this; }
265 
266   private:
267 
268     Aws::String m_certificateAuthorityArn;
269     bool m_certificateAuthorityArnHasBeenSet;
270 
271     Aws::String m_principal;
272     bool m_principalHasBeenSet;
273 
274     Aws::String m_sourceAccount;
275     bool m_sourceAccountHasBeenSet;
276 
277     Aws::Vector<ActionType> m_actions;
278     bool m_actionsHasBeenSet;
279   };
280 
281 } // namespace Model
282 } // namespace ACMPCA
283 } // namespace Aws
284