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