aws_sdk_kms/operation/disable_key/_disable_key_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 DisableKeyInput {
6 /// <p>Identifies the KMS key to disable.</p>
7 /// <p>Specify the key ID or key ARN of the KMS key.</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}
18impl DisableKeyInput {
19 /// <p>Identifies the KMS key to disable.</p>
20 /// <p>Specify the key ID or key ARN of the KMS key.</p>
21 /// <p>For example:</p>
22 /// <ul>
23 /// <li>
24 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
25 /// <li>
26 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
27 /// </ul>
28 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
29 pub fn key_id(&self) -> ::std::option::Option<&str> {
30 self.key_id.as_deref()
31 }
32}
33impl DisableKeyInput {
34 /// Creates a new builder-style object to manufacture [`DisableKeyInput`](crate::operation::disable_key::DisableKeyInput).
35 pub fn builder() -> crate::operation::disable_key::builders::DisableKeyInputBuilder {
36 crate::operation::disable_key::builders::DisableKeyInputBuilder::default()
37 }
38}
39
40/// A builder for [`DisableKeyInput`](crate::operation::disable_key::DisableKeyInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct DisableKeyInputBuilder {
44 pub(crate) key_id: ::std::option::Option<::std::string::String>,
45}
46impl DisableKeyInputBuilder {
47 /// <p>Identifies the KMS key to disable.</p>
48 /// <p>Specify the key ID or key ARN of the KMS key.</p>
49 /// <p>For example:</p>
50 /// <ul>
51 /// <li>
52 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
53 /// <li>
54 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
55 /// </ul>
56 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
57 /// This field is required.
58 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59 self.key_id = ::std::option::Option::Some(input.into());
60 self
61 }
62 /// <p>Identifies the KMS key to disable.</p>
63 /// <p>Specify the key ID or key ARN of the KMS key.</p>
64 /// <p>For example:</p>
65 /// <ul>
66 /// <li>
67 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
68 /// <li>
69 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
70 /// </ul>
71 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
72 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.key_id = input;
74 self
75 }
76 /// <p>Identifies the KMS key to disable.</p>
77 /// <p>Specify the key ID or key ARN of the KMS key.</p>
78 /// <p>For example:</p>
79 /// <ul>
80 /// <li>
81 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
82 /// <li>
83 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
84 /// </ul>
85 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
86 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
87 &self.key_id
88 }
89 /// Consumes the builder and constructs a [`DisableKeyInput`](crate::operation::disable_key::DisableKeyInput).
90 pub fn build(self) -> ::std::result::Result<crate::operation::disable_key::DisableKeyInput, ::aws_smithy_types::error::operation::BuildError> {
91 ::std::result::Result::Ok(crate::operation::disable_key::DisableKeyInput { key_id: self.key_id })
92 }
93}