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/kms/KMS_EXPORTS.h>
8 #include <aws/kms/KMSRequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <utility>
11 
12 namespace Aws
13 {
14 namespace KMS
15 {
16 namespace Model
17 {
18 
19   /**
20    */
21   class AWS_KMS_API UpdateAliasRequest : public KMSRequest
22   {
23   public:
24     UpdateAliasRequest();
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 "UpdateAlias"; }
31 
32     Aws::String SerializePayload() const override;
33 
34     Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
35 
36 
37     /**
38      * <p>Identifies the alias that is changing its KMS key. This value must begin with
39      * <code>alias/</code> followed by the alias name, such as
40      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
41      * name.</p>
42      */
GetAliasName()43     inline const Aws::String& GetAliasName() const{ return m_aliasName; }
44 
45     /**
46      * <p>Identifies the alias that is changing its KMS key. This value must begin with
47      * <code>alias/</code> followed by the alias name, such as
48      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
49      * name.</p>
50      */
AliasNameHasBeenSet()51     inline bool AliasNameHasBeenSet() const { return m_aliasNameHasBeenSet; }
52 
53     /**
54      * <p>Identifies the alias that is changing its KMS key. This value must begin with
55      * <code>alias/</code> followed by the alias name, such as
56      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
57      * name.</p>
58      */
SetAliasName(const Aws::String & value)59     inline void SetAliasName(const Aws::String& value) { m_aliasNameHasBeenSet = true; m_aliasName = value; }
60 
61     /**
62      * <p>Identifies the alias that is changing its KMS key. This value must begin with
63      * <code>alias/</code> followed by the alias name, such as
64      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
65      * name.</p>
66      */
SetAliasName(Aws::String && value)67     inline void SetAliasName(Aws::String&& value) { m_aliasNameHasBeenSet = true; m_aliasName = std::move(value); }
68 
69     /**
70      * <p>Identifies the alias that is changing its KMS key. This value must begin with
71      * <code>alias/</code> followed by the alias name, such as
72      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
73      * name.</p>
74      */
SetAliasName(const char * value)75     inline void SetAliasName(const char* value) { m_aliasNameHasBeenSet = true; m_aliasName.assign(value); }
76 
77     /**
78      * <p>Identifies the alias that is changing its KMS key. This value must begin with
79      * <code>alias/</code> followed by the alias name, such as
80      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
81      * name.</p>
82      */
WithAliasName(const Aws::String & value)83     inline UpdateAliasRequest& WithAliasName(const Aws::String& value) { SetAliasName(value); return *this;}
84 
85     /**
86      * <p>Identifies the alias that is changing its KMS key. This value must begin with
87      * <code>alias/</code> followed by the alias name, such as
88      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
89      * name.</p>
90      */
WithAliasName(Aws::String && value)91     inline UpdateAliasRequest& WithAliasName(Aws::String&& value) { SetAliasName(std::move(value)); return *this;}
92 
93     /**
94      * <p>Identifies the alias that is changing its KMS key. This value must begin with
95      * <code>alias/</code> followed by the alias name, such as
96      * <code>alias/ExampleAlias</code>. You cannot use UpdateAlias to change the alias
97      * name.</p>
98      */
WithAliasName(const char * value)99     inline UpdateAliasRequest& WithAliasName(const char* value) { SetAliasName(value); return *this;}
100 
101 
102     /**
103      * <p>Identifies the <a
104      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
105      * managed key</a> to associate with the alias. You don't have permission to
106      * associate an alias with an <a
107      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
108      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
109      * Services account and Region as the alias. Also, the new target KMS key must be
110      * the same type as the current target KMS key (both symmetric or both asymmetric)
111      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
112      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
113      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
114      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
115      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
116      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
117      * to the correct KMS key, use <a>ListAliases</a>.</p>
118      */
GetTargetKeyId()119     inline const Aws::String& GetTargetKeyId() const{ return m_targetKeyId; }
120 
121     /**
122      * <p>Identifies the <a
123      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
124      * managed key</a> to associate with the alias. You don't have permission to
125      * associate an alias with an <a
126      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
127      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
128      * Services account and Region as the alias. Also, the new target KMS key must be
129      * the same type as the current target KMS key (both symmetric or both asymmetric)
130      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
131      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
132      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
133      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
134      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
135      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
136      * to the correct KMS key, use <a>ListAliases</a>.</p>
137      */
TargetKeyIdHasBeenSet()138     inline bool TargetKeyIdHasBeenSet() const { return m_targetKeyIdHasBeenSet; }
139 
140     /**
141      * <p>Identifies the <a
142      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
143      * managed key</a> to associate with the alias. You don't have permission to
144      * associate an alias with an <a
145      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
146      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
147      * Services account and Region as the alias. Also, the new target KMS key must be
148      * the same type as the current target KMS key (both symmetric or both asymmetric)
149      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
150      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
151      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
152      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
153      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
154      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
155      * to the correct KMS key, use <a>ListAliases</a>.</p>
156      */
SetTargetKeyId(const Aws::String & value)157     inline void SetTargetKeyId(const Aws::String& value) { m_targetKeyIdHasBeenSet = true; m_targetKeyId = value; }
158 
159     /**
160      * <p>Identifies the <a
161      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
162      * managed key</a> to associate with the alias. You don't have permission to
163      * associate an alias with an <a
164      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
165      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
166      * Services account and Region as the alias. Also, the new target KMS key must be
167      * the same type as the current target KMS key (both symmetric or both asymmetric)
168      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
169      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
170      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
171      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
172      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
173      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
174      * to the correct KMS key, use <a>ListAliases</a>.</p>
175      */
SetTargetKeyId(Aws::String && value)176     inline void SetTargetKeyId(Aws::String&& value) { m_targetKeyIdHasBeenSet = true; m_targetKeyId = std::move(value); }
177 
178     /**
179      * <p>Identifies the <a
180      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
181      * managed key</a> to associate with the alias. You don't have permission to
182      * associate an alias with an <a
183      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
184      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
185      * Services account and Region as the alias. Also, the new target KMS key must be
186      * the same type as the current target KMS key (both symmetric or both asymmetric)
187      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
188      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
189      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
190      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
191      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
192      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
193      * to the correct KMS key, use <a>ListAliases</a>.</p>
194      */
SetTargetKeyId(const char * value)195     inline void SetTargetKeyId(const char* value) { m_targetKeyIdHasBeenSet = true; m_targetKeyId.assign(value); }
196 
197     /**
198      * <p>Identifies the <a
199      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
200      * managed key</a> to associate with the alias. You don't have permission to
201      * associate an alias with an <a
202      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
203      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
204      * Services account and Region as the alias. Also, the new target KMS key must be
205      * the same type as the current target KMS key (both symmetric or both asymmetric)
206      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
207      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
208      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
209      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
210      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
211      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
212      * to the correct KMS key, use <a>ListAliases</a>.</p>
213      */
WithTargetKeyId(const Aws::String & value)214     inline UpdateAliasRequest& WithTargetKeyId(const Aws::String& value) { SetTargetKeyId(value); return *this;}
215 
216     /**
217      * <p>Identifies the <a
218      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
219      * managed key</a> to associate with the alias. You don't have permission to
220      * associate an alias with an <a
221      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
222      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
223      * Services account and Region as the alias. Also, the new target KMS key must be
224      * the same type as the current target KMS key (both symmetric or both asymmetric)
225      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
226      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
227      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
228      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
229      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
230      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
231      * to the correct KMS key, use <a>ListAliases</a>.</p>
232      */
WithTargetKeyId(Aws::String && value)233     inline UpdateAliasRequest& WithTargetKeyId(Aws::String&& value) { SetTargetKeyId(std::move(value)); return *this;}
234 
235     /**
236      * <p>Identifies the <a
237      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer
238      * managed key</a> to associate with the alias. You don't have permission to
239      * associate an alias with an <a
240      * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon
241      * Web Services managed key</a>.</p> <p>The KMS key must be in the same Amazon Web
242      * Services account and Region as the alias. Also, the new target KMS key must be
243      * the same type as the current target KMS key (both symmetric or both asymmetric)
244      * and they must have the same key usage. </p> <p>Specify the key ID or key ARN of
245      * the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID:
246      * <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
247      * <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
248      * </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use
249      * <a>ListKeys</a> or <a>DescribeKey</a>.</p> <p>To verify that the alias is mapped
250      * to the correct KMS key, use <a>ListAliases</a>.</p>
251      */
WithTargetKeyId(const char * value)252     inline UpdateAliasRequest& WithTargetKeyId(const char* value) { SetTargetKeyId(value); return *this;}
253 
254   private:
255 
256     Aws::String m_aliasName;
257     bool m_aliasNameHasBeenSet;
258 
259     Aws::String m_targetKeyId;
260     bool m_targetKeyIdHasBeenSet;
261   };
262 
263 } // namespace Model
264 } // namespace KMS
265 } // namespace Aws
266