aws_sdk_kms/operation/describe_key/
_describe_key_output.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 DescribeKeyOutput {
6    /// <p>Metadata associated with the key.</p>
7    pub key_metadata: ::std::option::Option<crate::types::KeyMetadata>,
8    _request_id: Option<String>,
9}
10impl DescribeKeyOutput {
11    /// <p>Metadata associated with the key.</p>
12    pub fn key_metadata(&self) -> ::std::option::Option<&crate::types::KeyMetadata> {
13        self.key_metadata.as_ref()
14    }
15}
16impl ::aws_types::request_id::RequestId for DescribeKeyOutput {
17    fn request_id(&self) -> Option<&str> {
18        self._request_id.as_deref()
19    }
20}
21impl DescribeKeyOutput {
22    /// Creates a new builder-style object to manufacture [`DescribeKeyOutput`](crate::operation::describe_key::DescribeKeyOutput).
23    pub fn builder() -> crate::operation::describe_key::builders::DescribeKeyOutputBuilder {
24        crate::operation::describe_key::builders::DescribeKeyOutputBuilder::default()
25    }
26}
27
28/// A builder for [`DescribeKeyOutput`](crate::operation::describe_key::DescribeKeyOutput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DescribeKeyOutputBuilder {
32    pub(crate) key_metadata: ::std::option::Option<crate::types::KeyMetadata>,
33    _request_id: Option<String>,
34}
35impl DescribeKeyOutputBuilder {
36    /// <p>Metadata associated with the key.</p>
37    pub fn key_metadata(mut self, input: crate::types::KeyMetadata) -> Self {
38        self.key_metadata = ::std::option::Option::Some(input);
39        self
40    }
41    /// <p>Metadata associated with the key.</p>
42    pub fn set_key_metadata(mut self, input: ::std::option::Option<crate::types::KeyMetadata>) -> Self {
43        self.key_metadata = input;
44        self
45    }
46    /// <p>Metadata associated with the key.</p>
47    pub fn get_key_metadata(&self) -> &::std::option::Option<crate::types::KeyMetadata> {
48        &self.key_metadata
49    }
50    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
51        self._request_id = Some(request_id.into());
52        self
53    }
54
55    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
56        self._request_id = request_id;
57        self
58    }
59    /// Consumes the builder and constructs a [`DescribeKeyOutput`](crate::operation::describe_key::DescribeKeyOutput).
60    pub fn build(self) -> crate::operation::describe_key::DescribeKeyOutput {
61        crate::operation::describe_key::DescribeKeyOutput {
62            key_metadata: self.key_metadata,
63            _request_id: self._request_id,
64        }
65    }
66}