aws_sdk_kms/operation/revoke_grant/
_revoke_grant_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RevokeGrantInput {
6    /// <p>A unique identifier for the KMS key associated with the grant. To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
7    /// <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>
8    /// <p>For example:</p>
9    /// <ul>
10    /// <li>
11    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
12    /// <li>
13    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
14    /// </ul>
15    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
16    pub key_id: ::std::option::Option<::std::string::String>,
17    /// <p>Identifies the grant to revoke. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
18    pub grant_id: ::std::option::Option<::std::string::String>,
19    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
20    /// <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>
21    pub dry_run: ::std::option::Option<bool>,
22}
23impl RevokeGrantInput {
24    /// <p>A unique identifier for the KMS key associated with the grant. To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
25    /// <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>
26    /// <p>For example:</p>
27    /// <ul>
28    /// <li>
29    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
30    /// <li>
31    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
32    /// </ul>
33    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
34    pub fn key_id(&self) -> ::std::option::Option<&str> {
35        self.key_id.as_deref()
36    }
37    /// <p>Identifies the grant to revoke. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
38    pub fn grant_id(&self) -> ::std::option::Option<&str> {
39        self.grant_id.as_deref()
40    }
41    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
42    /// <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>
43    pub fn dry_run(&self) -> ::std::option::Option<bool> {
44        self.dry_run
45    }
46}
47impl RevokeGrantInput {
48    /// Creates a new builder-style object to manufacture [`RevokeGrantInput`](crate::operation::revoke_grant::RevokeGrantInput).
49    pub fn builder() -> crate::operation::revoke_grant::builders::RevokeGrantInputBuilder {
50        crate::operation::revoke_grant::builders::RevokeGrantInputBuilder::default()
51    }
52}
53
54/// A builder for [`RevokeGrantInput`](crate::operation::revoke_grant::RevokeGrantInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct RevokeGrantInputBuilder {
58    pub(crate) key_id: ::std::option::Option<::std::string::String>,
59    pub(crate) grant_id: ::std::option::Option<::std::string::String>,
60    pub(crate) dry_run: ::std::option::Option<bool>,
61}
62impl RevokeGrantInputBuilder {
63    /// <p>A unique identifier for the KMS key associated with the grant. To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
64    /// <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>
65    /// <p>For example:</p>
66    /// <ul>
67    /// <li>
68    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
69    /// <li>
70    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
71    /// </ul>
72    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
73    /// This field is required.
74    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.key_id = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A unique identifier for the KMS key associated with the grant. To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
79    /// <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>
80    /// <p>For example:</p>
81    /// <ul>
82    /// <li>
83    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
84    /// <li>
85    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
86    /// </ul>
87    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
88    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.key_id = input;
90        self
91    }
92    /// <p>A unique identifier for the KMS key associated with the grant. To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
93    /// <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>
94    /// <p>For example:</p>
95    /// <ul>
96    /// <li>
97    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
98    /// <li>
99    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
100    /// </ul>
101    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
102    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
103        &self.key_id
104    }
105    /// <p>Identifies the grant to revoke. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
106    /// This field is required.
107    pub fn grant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.grant_id = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>Identifies the grant to revoke. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
112    pub fn set_grant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.grant_id = input;
114        self
115    }
116    /// <p>Identifies the grant to revoke. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
117    pub fn get_grant_id(&self) -> &::std::option::Option<::std::string::String> {
118        &self.grant_id
119    }
120    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
121    /// <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>
122    pub fn dry_run(mut self, input: bool) -> Self {
123        self.dry_run = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
127    /// <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>
128    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
129        self.dry_run = input;
130        self
131    }
132    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
133    /// <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>
134    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
135        &self.dry_run
136    }
137    /// Consumes the builder and constructs a [`RevokeGrantInput`](crate::operation::revoke_grant::RevokeGrantInput).
138    pub fn build(self) -> ::std::result::Result<crate::operation::revoke_grant::RevokeGrantInput, ::aws_smithy_types::error::operation::BuildError> {
139        ::std::result::Result::Ok(crate::operation::revoke_grant::RevokeGrantInput {
140            key_id: self.key_id,
141            grant_id: self.grant_id,
142            dry_run: self.dry_run,
143        })
144    }
145}