aws_sdk_codecatalyst/operation/get_space/
_get_space_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 GetSpaceOutput {
6    /// <p>The name of the space.</p>
7    pub name: ::std::string::String,
8    /// <p>The Amazon Web Services Region where the space exists.</p>
9    pub region_name: ::std::string::String,
10    /// <p>The friendly name of the space displayed to users.</p>
11    pub display_name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the space.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl GetSpaceOutput {
17    /// <p>The name of the space.</p>
18    pub fn name(&self) -> &str {
19        use std::ops::Deref;
20        self.name.deref()
21    }
22    /// <p>The Amazon Web Services Region where the space exists.</p>
23    pub fn region_name(&self) -> &str {
24        use std::ops::Deref;
25        self.region_name.deref()
26    }
27    /// <p>The friendly name of the space displayed to users.</p>
28    pub fn display_name(&self) -> ::std::option::Option<&str> {
29        self.display_name.as_deref()
30    }
31    /// <p>The description of the space.</p>
32    pub fn description(&self) -> ::std::option::Option<&str> {
33        self.description.as_deref()
34    }
35}
36impl ::aws_types::request_id::RequestId for GetSpaceOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl GetSpaceOutput {
42    /// Creates a new builder-style object to manufacture [`GetSpaceOutput`](crate::operation::get_space::GetSpaceOutput).
43    pub fn builder() -> crate::operation::get_space::builders::GetSpaceOutputBuilder {
44        crate::operation::get_space::builders::GetSpaceOutputBuilder::default()
45    }
46}
47
48/// A builder for [`GetSpaceOutput`](crate::operation::get_space::GetSpaceOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetSpaceOutputBuilder {
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) region_name: ::std::option::Option<::std::string::String>,
54    pub(crate) display_name: ::std::option::Option<::std::string::String>,
55    pub(crate) description: ::std::option::Option<::std::string::String>,
56    _request_id: Option<String>,
57}
58impl GetSpaceOutputBuilder {
59    /// <p>The name of the space.</p>
60    /// This field is required.
61    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the space.</p>
66    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.name = input;
68        self
69    }
70    /// <p>The name of the space.</p>
71    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.name
73    }
74    /// <p>The Amazon Web Services Region where the space exists.</p>
75    /// This field is required.
76    pub fn region_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.region_name = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The Amazon Web Services Region where the space exists.</p>
81    pub fn set_region_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.region_name = input;
83        self
84    }
85    /// <p>The Amazon Web Services Region where the space exists.</p>
86    pub fn get_region_name(&self) -> &::std::option::Option<::std::string::String> {
87        &self.region_name
88    }
89    /// <p>The friendly name of the space displayed to users.</p>
90    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.display_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The friendly name of the space displayed to users.</p>
95    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.display_name = input;
97        self
98    }
99    /// <p>The friendly name of the space displayed to users.</p>
100    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.display_name
102    }
103    /// <p>The description of the space.</p>
104    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.description = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The description of the space.</p>
109    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.description = input;
111        self
112    }
113    /// <p>The description of the space.</p>
114    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
115        &self.description
116    }
117    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
118        self._request_id = Some(request_id.into());
119        self
120    }
121
122    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
123        self._request_id = request_id;
124        self
125    }
126    /// Consumes the builder and constructs a [`GetSpaceOutput`](crate::operation::get_space::GetSpaceOutput).
127    /// This method will fail if any of the following fields are not set:
128    /// - [`name`](crate::operation::get_space::builders::GetSpaceOutputBuilder::name)
129    /// - [`region_name`](crate::operation::get_space::builders::GetSpaceOutputBuilder::region_name)
130    pub fn build(self) -> ::std::result::Result<crate::operation::get_space::GetSpaceOutput, ::aws_smithy_types::error::operation::BuildError> {
131        ::std::result::Result::Ok(crate::operation::get_space::GetSpaceOutput {
132            name: self.name.ok_or_else(|| {
133                ::aws_smithy_types::error::operation::BuildError::missing_field(
134                    "name",
135                    "name was not specified but it is required when building GetSpaceOutput",
136                )
137            })?,
138            region_name: self.region_name.ok_or_else(|| {
139                ::aws_smithy_types::error::operation::BuildError::missing_field(
140                    "region_name",
141                    "region_name was not specified but it is required when building GetSpaceOutput",
142                )
143            })?,
144            display_name: self.display_name,
145            description: self.description,
146            _request_id: self._request_id,
147        })
148    }
149}