aws_sdk_amplifyuibuilder/operation/get_metadata/
_get_metadata_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 GetMetadataOutput {
6    /// <p>Represents the configuration settings for the features metadata.</p>
7    pub features: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
8    _request_id: Option<String>,
9}
10impl GetMetadataOutput {
11    /// <p>Represents the configuration settings for the features metadata.</p>
12    pub fn features(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
13        &self.features
14    }
15}
16impl ::aws_types::request_id::RequestId for GetMetadataOutput {
17    fn request_id(&self) -> Option<&str> {
18        self._request_id.as_deref()
19    }
20}
21impl GetMetadataOutput {
22    /// Creates a new builder-style object to manufacture [`GetMetadataOutput`](crate::operation::get_metadata::GetMetadataOutput).
23    pub fn builder() -> crate::operation::get_metadata::builders::GetMetadataOutputBuilder {
24        crate::operation::get_metadata::builders::GetMetadataOutputBuilder::default()
25    }
26}
27
28/// A builder for [`GetMetadataOutput`](crate::operation::get_metadata::GetMetadataOutput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct GetMetadataOutputBuilder {
32    pub(crate) features: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
33    _request_id: Option<String>,
34}
35impl GetMetadataOutputBuilder {
36    /// Adds a key-value pair to `features`.
37    ///
38    /// To override the contents of this collection use [`set_features`](Self::set_features).
39    ///
40    /// <p>Represents the configuration settings for the features metadata.</p>
41    pub fn features(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
42        let mut hash_map = self.features.unwrap_or_default();
43        hash_map.insert(k.into(), v.into());
44        self.features = ::std::option::Option::Some(hash_map);
45        self
46    }
47    /// <p>Represents the configuration settings for the features metadata.</p>
48    pub fn set_features(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
49        self.features = input;
50        self
51    }
52    /// <p>Represents the configuration settings for the features metadata.</p>
53    pub fn get_features(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54        &self.features
55    }
56    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
57        self._request_id = Some(request_id.into());
58        self
59    }
60
61    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
62        self._request_id = request_id;
63        self
64    }
65    /// Consumes the builder and constructs a [`GetMetadataOutput`](crate::operation::get_metadata::GetMetadataOutput).
66    /// This method will fail if any of the following fields are not set:
67    /// - [`features`](crate::operation::get_metadata::builders::GetMetadataOutputBuilder::features)
68    pub fn build(self) -> ::std::result::Result<crate::operation::get_metadata::GetMetadataOutput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::get_metadata::GetMetadataOutput {
70            features: self.features.ok_or_else(|| {
71                ::aws_smithy_types::error::operation::BuildError::missing_field(
72                    "features",
73                    "features was not specified but it is required when building GetMetadataOutput",
74                )
75            })?,
76            _request_id: self._request_id,
77        })
78    }
79}