aws_sdk_kms/operation/enable_key/
_enable_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 EnableKeyInput {
6    /// <p>Identifies the KMS key to enable.</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 EnableKeyInput {
19    /// <p>Identifies the KMS key to enable.</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 EnableKeyInput {
34    /// Creates a new builder-style object to manufacture [`EnableKeyInput`](crate::operation::enable_key::EnableKeyInput).
35    pub fn builder() -> crate::operation::enable_key::builders::EnableKeyInputBuilder {
36        crate::operation::enable_key::builders::EnableKeyInputBuilder::default()
37    }
38}
39
40/// A builder for [`EnableKeyInput`](crate::operation::enable_key::EnableKeyInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct EnableKeyInputBuilder {
44    pub(crate) key_id: ::std::option::Option<::std::string::String>,
45}
46impl EnableKeyInputBuilder {
47    /// <p>Identifies the KMS key to enable.</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 enable.</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 enable.</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 [`EnableKeyInput`](crate::operation::enable_key::EnableKeyInput).
90    pub fn build(self) -> ::std::result::Result<crate::operation::enable_key::EnableKeyInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::enable_key::EnableKeyInput { key_id: self.key_id })
92    }
93}