aws_sdk_kms/operation/retire_grant/_retire_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 RetireGrantInput {
6 /// <p>Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.</p>
7 /// <p>Only the <code>CreateGrant</code> operation returns a grant token. For details, 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/grants.html#terms-eventual-consistency">Eventual consistency</a> in the <i>Key Management Service Developer Guide</i>.</p>
8 pub grant_token: ::std::option::Option<::std::string::String>,
9 /// <p>The key ARN KMS key associated with the grant. To find the key ARN, use the <code>ListKeys</code> operation.</p>
10 /// <p>For example: <code>arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p>
11 pub key_id: ::std::option::Option<::std::string::String>,
12 /// <p>Identifies the grant to retire. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
13 /// <ul>
14 /// <li>
15 /// <p>Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123</p></li>
16 /// </ul>
17 pub grant_id: ::std::option::Option<::std::string::String>,
18 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
19 /// <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>
20 pub dry_run: ::std::option::Option<bool>,
21}
22impl RetireGrantInput {
23 /// <p>Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.</p>
24 /// <p>Only the <code>CreateGrant</code> operation returns a grant token. For details, 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/grants.html#terms-eventual-consistency">Eventual consistency</a> in the <i>Key Management Service Developer Guide</i>.</p>
25 pub fn grant_token(&self) -> ::std::option::Option<&str> {
26 self.grant_token.as_deref()
27 }
28 /// <p>The key ARN KMS key associated with the grant. To find the key ARN, use the <code>ListKeys</code> operation.</p>
29 /// <p>For example: <code>arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p>
30 pub fn key_id(&self) -> ::std::option::Option<&str> {
31 self.key_id.as_deref()
32 }
33 /// <p>Identifies the grant to retire. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
34 /// <ul>
35 /// <li>
36 /// <p>Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123</p></li>
37 /// </ul>
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 RetireGrantInput {
48 /// Creates a new builder-style object to manufacture [`RetireGrantInput`](crate::operation::retire_grant::RetireGrantInput).
49 pub fn builder() -> crate::operation::retire_grant::builders::RetireGrantInputBuilder {
50 crate::operation::retire_grant::builders::RetireGrantInputBuilder::default()
51 }
52}
53
54/// A builder for [`RetireGrantInput`](crate::operation::retire_grant::RetireGrantInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct RetireGrantInputBuilder {
58 pub(crate) grant_token: ::std::option::Option<::std::string::String>,
59 pub(crate) key_id: ::std::option::Option<::std::string::String>,
60 pub(crate) grant_id: ::std::option::Option<::std::string::String>,
61 pub(crate) dry_run: ::std::option::Option<bool>,
62}
63impl RetireGrantInputBuilder {
64 /// <p>Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.</p>
65 /// <p>Only the <code>CreateGrant</code> operation returns a grant token. For details, 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/grants.html#terms-eventual-consistency">Eventual consistency</a> in the <i>Key Management Service Developer Guide</i>.</p>
66 pub fn grant_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.grant_token = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.</p>
71 /// <p>Only the <code>CreateGrant</code> operation returns a grant token. For details, 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/grants.html#terms-eventual-consistency">Eventual consistency</a> in the <i>Key Management Service Developer Guide</i>.</p>
72 pub fn set_grant_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.grant_token = input;
74 self
75 }
76 /// <p>Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.</p>
77 /// <p>Only the <code>CreateGrant</code> operation returns a grant token. For details, 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/grants.html#terms-eventual-consistency">Eventual consistency</a> in the <i>Key Management Service Developer Guide</i>.</p>
78 pub fn get_grant_token(&self) -> &::std::option::Option<::std::string::String> {
79 &self.grant_token
80 }
81 /// <p>The key ARN KMS key associated with the grant. To find the key ARN, use the <code>ListKeys</code> operation.</p>
82 /// <p>For example: <code>arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p>
83 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.key_id = ::std::option::Option::Some(input.into());
85 self
86 }
87 /// <p>The key ARN KMS key associated with the grant. To find the key ARN, use the <code>ListKeys</code> operation.</p>
88 /// <p>For example: <code>arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p>
89 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.key_id = input;
91 self
92 }
93 /// <p>The key ARN KMS key associated with the grant. To find the key ARN, use the <code>ListKeys</code> operation.</p>
94 /// <p>For example: <code>arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p>
95 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
96 &self.key_id
97 }
98 /// <p>Identifies the grant to retire. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
99 /// <ul>
100 /// <li>
101 /// <p>Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123</p></li>
102 /// </ul>
103 pub fn grant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.grant_id = ::std::option::Option::Some(input.into());
105 self
106 }
107 /// <p>Identifies the grant to retire. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
108 /// <ul>
109 /// <li>
110 /// <p>Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123</p></li>
111 /// </ul>
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 retire. To get the grant ID, use <code>CreateGrant</code>, <code>ListGrants</code>, or <code>ListRetirableGrants</code>.</p>
117 /// <ul>
118 /// <li>
119 /// <p>Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123</p></li>
120 /// </ul>
121 pub fn get_grant_id(&self) -> &::std::option::Option<::std::string::String> {
122 &self.grant_id
123 }
124 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
125 /// <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>
126 pub fn dry_run(mut self, input: bool) -> Self {
127 self.dry_run = ::std::option::Option::Some(input);
128 self
129 }
130 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
131 /// <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>
132 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
133 self.dry_run = input;
134 self
135 }
136 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
137 /// <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>
138 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
139 &self.dry_run
140 }
141 /// Consumes the builder and constructs a [`RetireGrantInput`](crate::operation::retire_grant::RetireGrantInput).
142 pub fn build(self) -> ::std::result::Result<crate::operation::retire_grant::RetireGrantInput, ::aws_smithy_types::error::operation::BuildError> {
143 ::std::result::Result::Ok(crate::operation::retire_grant::RetireGrantInput {
144 grant_token: self.grant_token,
145 key_id: self.key_id,
146 grant_id: self.grant_id,
147 dry_run: self.dry_run,
148 })
149 }
150}