aws_sdk_kms/operation/create_grant/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_grant::_create_grant_output::CreateGrantOutputBuilder;
3
4pub use crate::operation::create_grant::_create_grant_input::CreateGrantInputBuilder;
5
6impl crate::operation::create_grant::builders::CreateGrantInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_grant::CreateGrantOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_grant::CreateGrantError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_grant();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateGrant`.
24///
25/// <p>Adds a grant to a KMS key.</p>
26/// <p>A <i>grant</i> is a policy instrument that allows Amazon Web Services principals to use KMS keys in cryptographic operations. It also can allow them to view a KMS key (<code>DescribeKey</code>) and create and manage grants. When authorizing access to a KMS key, grants are considered along with key policies and IAM policies. Grants are often used for temporary permissions because you can create one, use its permissions, and delete it without changing your key policies or IAM policies.</p>
27/// <p>For detailed information about grants, including grant terminology, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html">Grants in KMS</a> in the <i> <i>Key Management Service Developer Guide</i> </i>. For examples of working with grants in several programming languages, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html">Programming grants</a>.</p>
28/// <p>The <code>CreateGrant</code> operation returns a <code>GrantToken</code> and a <code>GrantId</code>.</p>
29/// <ul>
30/// <li>
31/// <p>When you create, retire, or revoke a grant, there might be a brief delay, usually less than five minutes, until the grant is available throughout KMS. This state is known as <i>eventual consistency</i>. Once the grant has achieved eventual consistency, the grantee principal can use the permissions in the grant without identifying the grant.</p>
32/// <p>However, to use the permissions in the grant immediately, use the <code>GrantToken</code> that <code>CreateGrant</code> returns. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i> <i>Key Management Service Developer Guide</i> </i>.</p></li>
33/// <li>
34/// <p>The <code>CreateGrant</code> operation also returns a <code>GrantId</code>. You can use the <code>GrantId</code> and a key identifier to identify the grant in the <code>RetireGrant</code> and <code>RevokeGrant</code> operations. To find the grant ID, use the <code>ListGrants</code> or <code>ListRetirableGrants</code> operations.</p></li>
35/// </ul>
36/// <p>The KMS key that you use for this operation must be in a compatible key state. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
37/// <p><b>Cross-account use</b>: Yes. To perform this operation on a KMS key in a different Amazon Web Services account, specify the key ARN in the value of the <code>KeyId</code> parameter.</p>
38/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:CreateGrant</a> (key policy)</p>
39/// <p><b>Related operations:</b></p>
40/// <ul>
41/// <li>
42/// <p><code>ListGrants</code></p></li>
43/// <li>
44/// <p><code>ListRetirableGrants</code></p></li>
45/// <li>
46/// <p><code>RetireGrant</code></p></li>
47/// <li>
48/// <p><code>RevokeGrant</code></p></li>
49/// </ul>
50/// <p><b>Eventual consistency</b>: The KMS API follows an eventual consistency model. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html">KMS eventual consistency</a>.</p>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct CreateGrantFluentBuilder {
53 handle: ::std::sync::Arc<crate::client::Handle>,
54 inner: crate::operation::create_grant::builders::CreateGrantInputBuilder,
55 config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58 crate::client::customize::internal::CustomizableSend<
59 crate::operation::create_grant::CreateGrantOutput,
60 crate::operation::create_grant::CreateGrantError,
61 > for CreateGrantFluentBuilder
62{
63 fn send(
64 self,
65 config_override: crate::config::Builder,
66 ) -> crate::client::customize::internal::BoxFuture<
67 crate::client::customize::internal::SendResult<
68 crate::operation::create_grant::CreateGrantOutput,
69 crate::operation::create_grant::CreateGrantError,
70 >,
71 > {
72 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73 }
74}
75impl CreateGrantFluentBuilder {
76 /// Creates a new `CreateGrantFluentBuilder`.
77 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78 Self {
79 handle,
80 inner: ::std::default::Default::default(),
81 config_override: ::std::option::Option::None,
82 }
83 }
84 /// Access the CreateGrant as a reference.
85 pub fn as_input(&self) -> &crate::operation::create_grant::builders::CreateGrantInputBuilder {
86 &self.inner
87 }
88 /// Sends the request and returns the response.
89 ///
90 /// If an error occurs, an `SdkError` will be returned with additional details that
91 /// can be matched against.
92 ///
93 /// By default, any retryable failures will be retried twice. Retry behavior
94 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95 /// set when configuring the client.
96 pub async fn send(
97 self,
98 ) -> ::std::result::Result<
99 crate::operation::create_grant::CreateGrantOutput,
100 ::aws_smithy_runtime_api::client::result::SdkError<
101 crate::operation::create_grant::CreateGrantError,
102 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103 >,
104 > {
105 let input = self
106 .inner
107 .build()
108 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109 let runtime_plugins = crate::operation::create_grant::CreateGrant::operation_runtime_plugins(
110 self.handle.runtime_plugins.clone(),
111 &self.handle.conf,
112 self.config_override,
113 );
114 crate::operation::create_grant::CreateGrant::orchestrate(&runtime_plugins, input).await
115 }
116
117 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118 pub fn customize(
119 self,
120 ) -> crate::client::customize::CustomizableOperation<
121 crate::operation::create_grant::CreateGrantOutput,
122 crate::operation::create_grant::CreateGrantError,
123 Self,
124 > {
125 crate::client::customize::CustomizableOperation::new(self)
126 }
127 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128 self.set_config_override(::std::option::Option::Some(config_override.into()));
129 self
130 }
131
132 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133 self.config_override = config_override;
134 self
135 }
136 /// <p>Identifies the KMS key for the grant. The grant gives principals permission to use this KMS key.</p>
137 /// <p>Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN.</p>
138 /// <p>For example:</p>
139 /// <ul>
140 /// <li>
141 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
142 /// <li>
143 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
144 /// </ul>
145 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
146 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.key_id(input.into());
148 self
149 }
150 /// <p>Identifies the KMS key for the grant. The grant gives principals permission to use this KMS key.</p>
151 /// <p>Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN.</p>
152 /// <p>For example:</p>
153 /// <ul>
154 /// <li>
155 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
156 /// <li>
157 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
158 /// </ul>
159 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
160 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.inner = self.inner.set_key_id(input);
162 self
163 }
164 /// <p>Identifies the KMS key for the grant. The grant gives principals permission to use this KMS key.</p>
165 /// <p>Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN.</p>
166 /// <p>For example:</p>
167 /// <ul>
168 /// <li>
169 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
170 /// <li>
171 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
172 /// </ul>
173 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
174 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
175 self.inner.get_key_id()
176 }
177 /// <p>The identity that gets the permissions specified in the grant.</p>
178 /// <p>To specify the grantee principal, use the Amazon Resource Name (ARN) of an Amazon Web Services principal. Valid principals include Amazon Web Services accounts, IAM users, IAM roles, federated users, and assumed role users. For help with the ARN syntax for a principal, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i> <i>Identity and Access Management User Guide</i> </i>.</p>
179 pub fn grantee_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.grantee_principal(input.into());
181 self
182 }
183 /// <p>The identity that gets the permissions specified in the grant.</p>
184 /// <p>To specify the grantee principal, use the Amazon Resource Name (ARN) of an Amazon Web Services principal. Valid principals include Amazon Web Services accounts, IAM users, IAM roles, federated users, and assumed role users. For help with the ARN syntax for a principal, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i> <i>Identity and Access Management User Guide</i> </i>.</p>
185 pub fn set_grantee_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.inner = self.inner.set_grantee_principal(input);
187 self
188 }
189 /// <p>The identity that gets the permissions specified in the grant.</p>
190 /// <p>To specify the grantee principal, use the Amazon Resource Name (ARN) of an Amazon Web Services principal. Valid principals include Amazon Web Services accounts, IAM users, IAM roles, federated users, and assumed role users. For help with the ARN syntax for a principal, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i> <i>Identity and Access Management User Guide</i> </i>.</p>
191 pub fn get_grantee_principal(&self) -> &::std::option::Option<::std::string::String> {
192 self.inner.get_grantee_principal()
193 }
194 /// <p>The principal that has permission to use the <code>RetireGrant</code> operation to retire the grant.</p>
195 /// <p>To specify the principal, use the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an Amazon Web Services principal. Valid principals include Amazon Web Services accounts, IAM users, IAM roles, federated users, and assumed role users. For help with the ARN syntax for a principal, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i> <i>Identity and Access Management User Guide</i> </i>.</p>
196 /// <p>The grant determines the retiring principal. Other principals might have permission to retire the grant or revoke the grant. For details, see <code>RevokeGrant</code> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete">Retiring and revoking grants</a> in the <i>Key Management Service Developer Guide</i>.</p>
197 pub fn retiring_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.inner = self.inner.retiring_principal(input.into());
199 self
200 }
201 /// <p>The principal that has permission to use the <code>RetireGrant</code> operation to retire the grant.</p>
202 /// <p>To specify the principal, use the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an Amazon Web Services principal. Valid principals include Amazon Web Services accounts, IAM users, IAM roles, federated users, and assumed role users. For help with the ARN syntax for a principal, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i> <i>Identity and Access Management User Guide</i> </i>.</p>
203 /// <p>The grant determines the retiring principal. Other principals might have permission to retire the grant or revoke the grant. For details, see <code>RevokeGrant</code> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete">Retiring and revoking grants</a> in the <i>Key Management Service Developer Guide</i>.</p>
204 pub fn set_retiring_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205 self.inner = self.inner.set_retiring_principal(input);
206 self
207 }
208 /// <p>The principal that has permission to use the <code>RetireGrant</code> operation to retire the grant.</p>
209 /// <p>To specify the principal, use the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an Amazon Web Services principal. Valid principals include Amazon Web Services accounts, IAM users, IAM roles, federated users, and assumed role users. For help with the ARN syntax for a principal, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i> <i>Identity and Access Management User Guide</i> </i>.</p>
210 /// <p>The grant determines the retiring principal. Other principals might have permission to retire the grant or revoke the grant. For details, see <code>RevokeGrant</code> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete">Retiring and revoking grants</a> in the <i>Key Management Service Developer Guide</i>.</p>
211 pub fn get_retiring_principal(&self) -> &::std::option::Option<::std::string::String> {
212 self.inner.get_retiring_principal()
213 }
214 ///
215 /// Appends an item to `Operations`.
216 ///
217 /// To override the contents of this collection use [`set_operations`](Self::set_operations).
218 ///
219 /// <p>A list of operations that the grant permits.</p>
220 /// <p>This list must include only operations that are permitted in a grant. Also, the operation must be supported on the KMS key. For example, you cannot create a grant for a symmetric encryption KMS key that allows the <code>Sign</code> operation, or a grant for an asymmetric KMS key that allows the <code>GenerateDataKey</code> operation. If you try, KMS returns a <code>ValidationError</code> exception. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">Grant operations</a> in the <i>Key Management Service Developer Guide</i>.</p>
221 pub fn operations(mut self, input: crate::types::GrantOperation) -> Self {
222 self.inner = self.inner.operations(input);
223 self
224 }
225 /// <p>A list of operations that the grant permits.</p>
226 /// <p>This list must include only operations that are permitted in a grant. Also, the operation must be supported on the KMS key. For example, you cannot create a grant for a symmetric encryption KMS key that allows the <code>Sign</code> operation, or a grant for an asymmetric KMS key that allows the <code>GenerateDataKey</code> operation. If you try, KMS returns a <code>ValidationError</code> exception. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">Grant operations</a> in the <i>Key Management Service Developer Guide</i>.</p>
227 pub fn set_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GrantOperation>>) -> Self {
228 self.inner = self.inner.set_operations(input);
229 self
230 }
231 /// <p>A list of operations that the grant permits.</p>
232 /// <p>This list must include only operations that are permitted in a grant. Also, the operation must be supported on the KMS key. For example, you cannot create a grant for a symmetric encryption KMS key that allows the <code>Sign</code> operation, or a grant for an asymmetric KMS key that allows the <code>GenerateDataKey</code> operation. If you try, KMS returns a <code>ValidationError</code> exception. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">Grant operations</a> in the <i>Key Management Service Developer Guide</i>.</p>
233 pub fn get_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GrantOperation>> {
234 self.inner.get_operations()
235 }
236 /// <p>Specifies a grant constraint.</p><important>
237 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
238 /// </important>
239 /// <p>KMS supports the <code>EncryptionContextEquals</code> and <code>EncryptionContextSubset</code> grant constraints, which allow the permissions in the grant only when the encryption context in the request matches (<code>EncryptionContextEquals</code>) or includes (<code>EncryptionContextSubset</code>) the encryption context specified in the constraint.</p>
240 /// <p>The encryption context grant constraints are supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">grant operations</a> that include an <code>EncryptionContext</code> parameter, such as cryptographic operations on symmetric encryption KMS keys. Grants with grant constraints can include the <code>DescribeKey</code> and <code>RetireGrant</code> operations, but the constraint doesn't apply to these operations. If a grant with a grant constraint includes the <code>CreateGrant</code> operation, the constraint requires that any grants created with the <code>CreateGrant</code> permission have an equally strict or stricter encryption context constraint.</p>
241 /// <p>You cannot use an encryption context grant constraint for cryptographic operations with asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't support an encryption context.</p>
242 /// <p>Each constraint value can include up to 8 encryption context pairs. The encryption context value in each constraint cannot exceed 384 characters. For information about grant constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant constraints</a> in the <i>Key Management Service Developer Guide</i>. For more information about encryption context, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i> <i>Key Management Service Developer Guide</i> </i>.</p>
243 pub fn constraints(mut self, input: crate::types::GrantConstraints) -> Self {
244 self.inner = self.inner.constraints(input);
245 self
246 }
247 /// <p>Specifies a grant constraint.</p><important>
248 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
249 /// </important>
250 /// <p>KMS supports the <code>EncryptionContextEquals</code> and <code>EncryptionContextSubset</code> grant constraints, which allow the permissions in the grant only when the encryption context in the request matches (<code>EncryptionContextEquals</code>) or includes (<code>EncryptionContextSubset</code>) the encryption context specified in the constraint.</p>
251 /// <p>The encryption context grant constraints are supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">grant operations</a> that include an <code>EncryptionContext</code> parameter, such as cryptographic operations on symmetric encryption KMS keys. Grants with grant constraints can include the <code>DescribeKey</code> and <code>RetireGrant</code> operations, but the constraint doesn't apply to these operations. If a grant with a grant constraint includes the <code>CreateGrant</code> operation, the constraint requires that any grants created with the <code>CreateGrant</code> permission have an equally strict or stricter encryption context constraint.</p>
252 /// <p>You cannot use an encryption context grant constraint for cryptographic operations with asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't support an encryption context.</p>
253 /// <p>Each constraint value can include up to 8 encryption context pairs. The encryption context value in each constraint cannot exceed 384 characters. For information about grant constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant constraints</a> in the <i>Key Management Service Developer Guide</i>. For more information about encryption context, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i> <i>Key Management Service Developer Guide</i> </i>.</p>
254 pub fn set_constraints(mut self, input: ::std::option::Option<crate::types::GrantConstraints>) -> Self {
255 self.inner = self.inner.set_constraints(input);
256 self
257 }
258 /// <p>Specifies a grant constraint.</p><important>
259 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
260 /// </important>
261 /// <p>KMS supports the <code>EncryptionContextEquals</code> and <code>EncryptionContextSubset</code> grant constraints, which allow the permissions in the grant only when the encryption context in the request matches (<code>EncryptionContextEquals</code>) or includes (<code>EncryptionContextSubset</code>) the encryption context specified in the constraint.</p>
262 /// <p>The encryption context grant constraints are supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">grant operations</a> that include an <code>EncryptionContext</code> parameter, such as cryptographic operations on symmetric encryption KMS keys. Grants with grant constraints can include the <code>DescribeKey</code> and <code>RetireGrant</code> operations, but the constraint doesn't apply to these operations. If a grant with a grant constraint includes the <code>CreateGrant</code> operation, the constraint requires that any grants created with the <code>CreateGrant</code> permission have an equally strict or stricter encryption context constraint.</p>
263 /// <p>You cannot use an encryption context grant constraint for cryptographic operations with asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't support an encryption context.</p>
264 /// <p>Each constraint value can include up to 8 encryption context pairs. The encryption context value in each constraint cannot exceed 384 characters. For information about grant constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant constraints</a> in the <i>Key Management Service Developer Guide</i>. For more information about encryption context, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i> <i>Key Management Service Developer Guide</i> </i>.</p>
265 pub fn get_constraints(&self) -> &::std::option::Option<crate::types::GrantConstraints> {
266 self.inner.get_constraints()
267 }
268 ///
269 /// Appends an item to `GrantTokens`.
270 ///
271 /// To override the contents of this collection use [`set_grant_tokens`](Self::set_grant_tokens).
272 ///
273 /// <p>A list of grant tokens.</p>
274 /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
275 pub fn grant_tokens(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
276 self.inner = self.inner.grant_tokens(input.into());
277 self
278 }
279 /// <p>A list of grant tokens.</p>
280 /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
281 pub fn set_grant_tokens(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
282 self.inner = self.inner.set_grant_tokens(input);
283 self
284 }
285 /// <p>A list of grant tokens.</p>
286 /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
287 pub fn get_grant_tokens(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
288 self.inner.get_grant_tokens()
289 }
290 /// <p>A friendly name for the grant. Use this value to prevent the unintended creation of duplicate grants when retrying this request.</p><important>
291 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
292 /// </important>
293 /// <p>When this value is absent, all <code>CreateGrant</code> requests result in a new grant with a unique <code>GrantId</code> even if all the supplied parameters are identical. This can result in unintended duplicates when you retry the <code>CreateGrant</code> request.</p>
294 /// <p>When this value is present, you can retry a <code>CreateGrant</code> request with identical parameters; if the grant already exists, the original <code>GrantId</code> is returned without creating a new grant. Note that the returned grant token is unique with every <code>CreateGrant</code> request, even when a duplicate <code>GrantId</code> is returned. All grant tokens for the same grant ID can be used interchangeably.</p>
295 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296 self.inner = self.inner.name(input.into());
297 self
298 }
299 /// <p>A friendly name for the grant. Use this value to prevent the unintended creation of duplicate grants when retrying this request.</p><important>
300 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
301 /// </important>
302 /// <p>When this value is absent, all <code>CreateGrant</code> requests result in a new grant with a unique <code>GrantId</code> even if all the supplied parameters are identical. This can result in unintended duplicates when you retry the <code>CreateGrant</code> request.</p>
303 /// <p>When this value is present, you can retry a <code>CreateGrant</code> request with identical parameters; if the grant already exists, the original <code>GrantId</code> is returned without creating a new grant. Note that the returned grant token is unique with every <code>CreateGrant</code> request, even when a duplicate <code>GrantId</code> is returned. All grant tokens for the same grant ID can be used interchangeably.</p>
304 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305 self.inner = self.inner.set_name(input);
306 self
307 }
308 /// <p>A friendly name for the grant. Use this value to prevent the unintended creation of duplicate grants when retrying this request.</p><important>
309 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
310 /// </important>
311 /// <p>When this value is absent, all <code>CreateGrant</code> requests result in a new grant with a unique <code>GrantId</code> even if all the supplied parameters are identical. This can result in unintended duplicates when you retry the <code>CreateGrant</code> request.</p>
312 /// <p>When this value is present, you can retry a <code>CreateGrant</code> request with identical parameters; if the grant already exists, the original <code>GrantId</code> is returned without creating a new grant. Note that the returned grant token is unique with every <code>CreateGrant</code> request, even when a duplicate <code>GrantId</code> is returned. All grant tokens for the same grant ID can be used interchangeably.</p>
313 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
314 self.inner.get_name()
315 }
316 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
317 /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
318 pub fn dry_run(mut self, input: bool) -> Self {
319 self.inner = self.inner.dry_run(input);
320 self
321 }
322 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
323 /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
324 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
325 self.inner = self.inner.set_dry_run(input);
326 self
327 }
328 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
329 /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
330 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
331 self.inner.get_dry_run()
332 }
333}