aws_sdk_codestar/operation/create_project/
_create_project_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateProjectInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub id: ::std::option::Option<::std::string::String>,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub client_request_token: ::std::option::Option<::std::string::String>,
14 pub source_code: ::std::option::Option<::std::vec::Vec<crate::types::Code>>,
16 pub toolchain: ::std::option::Option<crate::types::Toolchain>,
18 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20}
21impl CreateProjectInput {
22 pub fn name(&self) -> ::std::option::Option<&str> {
24 self.name.as_deref()
25 }
26 pub fn id(&self) -> ::std::option::Option<&str> {
28 self.id.as_deref()
29 }
30 pub fn description(&self) -> ::std::option::Option<&str> {
32 self.description.as_deref()
33 }
34 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
36 self.client_request_token.as_deref()
37 }
38 pub fn source_code(&self) -> &[crate::types::Code] {
42 self.source_code.as_deref().unwrap_or_default()
43 }
44 pub fn toolchain(&self) -> ::std::option::Option<&crate::types::Toolchain> {
46 self.toolchain.as_ref()
47 }
48 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
50 self.tags.as_ref()
51 }
52}
53impl ::std::fmt::Debug for CreateProjectInput {
54 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
55 let mut formatter = f.debug_struct("CreateProjectInput");
56 formatter.field("name", &"*** Sensitive Data Redacted ***");
57 formatter.field("id", &self.id);
58 formatter.field("description", &"*** Sensitive Data Redacted ***");
59 formatter.field("client_request_token", &self.client_request_token);
60 formatter.field("source_code", &self.source_code);
61 formatter.field("toolchain", &self.toolchain);
62 formatter.field("tags", &self.tags);
63 formatter.finish()
64 }
65}
66impl CreateProjectInput {
67 pub fn builder() -> crate::operation::create_project::builders::CreateProjectInputBuilder {
69 crate::operation::create_project::builders::CreateProjectInputBuilder::default()
70 }
71}
72
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
75#[non_exhaustive]
76pub struct CreateProjectInputBuilder {
77 pub(crate) name: ::std::option::Option<::std::string::String>,
78 pub(crate) id: ::std::option::Option<::std::string::String>,
79 pub(crate) description: ::std::option::Option<::std::string::String>,
80 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
81 pub(crate) source_code: ::std::option::Option<::std::vec::Vec<crate::types::Code>>,
82 pub(crate) toolchain: ::std::option::Option<crate::types::Toolchain>,
83 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
84}
85impl CreateProjectInputBuilder {
86 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.name = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.name = input;
95 self
96 }
97 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
99 &self.name
100 }
101 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.id = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.id = input;
110 self
111 }
112 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
114 &self.id
115 }
116 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.description = ::std::option::Option::Some(input.into());
119 self
120 }
121 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.description = input;
124 self
125 }
126 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
128 &self.description
129 }
130 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.client_request_token = ::std::option::Option::Some(input.into());
133 self
134 }
135 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.client_request_token = input;
138 self
139 }
140 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
142 &self.client_request_token
143 }
144 pub fn source_code(mut self, input: crate::types::Code) -> Self {
150 let mut v = self.source_code.unwrap_or_default();
151 v.push(input);
152 self.source_code = ::std::option::Option::Some(v);
153 self
154 }
155 pub fn set_source_code(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Code>>) -> Self {
157 self.source_code = input;
158 self
159 }
160 pub fn get_source_code(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Code>> {
162 &self.source_code
163 }
164 pub fn toolchain(mut self, input: crate::types::Toolchain) -> Self {
166 self.toolchain = ::std::option::Option::Some(input);
167 self
168 }
169 pub fn set_toolchain(mut self, input: ::std::option::Option<crate::types::Toolchain>) -> Self {
171 self.toolchain = input;
172 self
173 }
174 pub fn get_toolchain(&self) -> &::std::option::Option<crate::types::Toolchain> {
176 &self.toolchain
177 }
178 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
184 let mut hash_map = self.tags.unwrap_or_default();
185 hash_map.insert(k.into(), v.into());
186 self.tags = ::std::option::Option::Some(hash_map);
187 self
188 }
189 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
191 self.tags = input;
192 self
193 }
194 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
196 &self.tags
197 }
198 pub fn build(
200 self,
201 ) -> ::std::result::Result<crate::operation::create_project::CreateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
202 ::std::result::Result::Ok(crate::operation::create_project::CreateProjectInput {
203 name: self.name,
204 id: self.id,
205 description: self.description,
206 client_request_token: self.client_request_token,
207 source_code: self.source_code,
208 toolchain: self.toolchain,
209 tags: self.tags,
210 })
211 }
212}
213impl ::std::fmt::Debug for CreateProjectInputBuilder {
214 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
215 let mut formatter = f.debug_struct("CreateProjectInputBuilder");
216 formatter.field("name", &"*** Sensitive Data Redacted ***");
217 formatter.field("id", &self.id);
218 formatter.field("description", &"*** Sensitive Data Redacted ***");
219 formatter.field("client_request_token", &self.client_request_token);
220 formatter.field("source_code", &self.source_code);
221 formatter.field("toolchain", &self.toolchain);
222 formatter.field("tags", &self.tags);
223 formatter.finish()
224 }
225}