aws_sdk_codecommit/operation/create_commit/
_create_commit_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateCommitInput {
6 pub repository_name: ::std::option::Option<::std::string::String>,
8 pub branch_name: ::std::option::Option<::std::string::String>,
10 pub parent_commit_id: ::std::option::Option<::std::string::String>,
12 pub author_name: ::std::option::Option<::std::string::String>,
14 pub email: ::std::option::Option<::std::string::String>,
16 pub commit_message: ::std::option::Option<::std::string::String>,
18 pub keep_empty_folders: ::std::option::Option<bool>,
20 pub put_files: ::std::option::Option<::std::vec::Vec<crate::types::PutFileEntry>>,
22 pub delete_files: ::std::option::Option<::std::vec::Vec<crate::types::DeleteFileEntry>>,
24 pub set_file_modes: ::std::option::Option<::std::vec::Vec<crate::types::SetFileModeEntry>>,
26}
27impl CreateCommitInput {
28 pub fn repository_name(&self) -> ::std::option::Option<&str> {
30 self.repository_name.as_deref()
31 }
32 pub fn branch_name(&self) -> ::std::option::Option<&str> {
34 self.branch_name.as_deref()
35 }
36 pub fn parent_commit_id(&self) -> ::std::option::Option<&str> {
38 self.parent_commit_id.as_deref()
39 }
40 pub fn author_name(&self) -> ::std::option::Option<&str> {
42 self.author_name.as_deref()
43 }
44 pub fn email(&self) -> ::std::option::Option<&str> {
46 self.email.as_deref()
47 }
48 pub fn commit_message(&self) -> ::std::option::Option<&str> {
50 self.commit_message.as_deref()
51 }
52 pub fn keep_empty_folders(&self) -> ::std::option::Option<bool> {
54 self.keep_empty_folders
55 }
56 pub fn put_files(&self) -> &[crate::types::PutFileEntry] {
60 self.put_files.as_deref().unwrap_or_default()
61 }
62 pub fn delete_files(&self) -> &[crate::types::DeleteFileEntry] {
66 self.delete_files.as_deref().unwrap_or_default()
67 }
68 pub fn set_file_modes(&self) -> &[crate::types::SetFileModeEntry] {
72 self.set_file_modes.as_deref().unwrap_or_default()
73 }
74}
75impl CreateCommitInput {
76 pub fn builder() -> crate::operation::create_commit::builders::CreateCommitInputBuilder {
78 crate::operation::create_commit::builders::CreateCommitInputBuilder::default()
79 }
80}
81
82#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct CreateCommitInputBuilder {
86 pub(crate) repository_name: ::std::option::Option<::std::string::String>,
87 pub(crate) branch_name: ::std::option::Option<::std::string::String>,
88 pub(crate) parent_commit_id: ::std::option::Option<::std::string::String>,
89 pub(crate) author_name: ::std::option::Option<::std::string::String>,
90 pub(crate) email: ::std::option::Option<::std::string::String>,
91 pub(crate) commit_message: ::std::option::Option<::std::string::String>,
92 pub(crate) keep_empty_folders: ::std::option::Option<bool>,
93 pub(crate) put_files: ::std::option::Option<::std::vec::Vec<crate::types::PutFileEntry>>,
94 pub(crate) delete_files: ::std::option::Option<::std::vec::Vec<crate::types::DeleteFileEntry>>,
95 pub(crate) set_file_modes: ::std::option::Option<::std::vec::Vec<crate::types::SetFileModeEntry>>,
96}
97impl CreateCommitInputBuilder {
98 pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.repository_name = ::std::option::Option::Some(input.into());
102 self
103 }
104 pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.repository_name = input;
107 self
108 }
109 pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
111 &self.repository_name
112 }
113 pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.branch_name = ::std::option::Option::Some(input.into());
117 self
118 }
119 pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.branch_name = input;
122 self
123 }
124 pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
126 &self.branch_name
127 }
128 pub fn parent_commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.parent_commit_id = ::std::option::Option::Some(input.into());
131 self
132 }
133 pub fn set_parent_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.parent_commit_id = input;
136 self
137 }
138 pub fn get_parent_commit_id(&self) -> &::std::option::Option<::std::string::String> {
140 &self.parent_commit_id
141 }
142 pub fn author_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.author_name = ::std::option::Option::Some(input.into());
145 self
146 }
147 pub fn set_author_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.author_name = input;
150 self
151 }
152 pub fn get_author_name(&self) -> &::std::option::Option<::std::string::String> {
154 &self.author_name
155 }
156 pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.email = ::std::option::Option::Some(input.into());
159 self
160 }
161 pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.email = input;
164 self
165 }
166 pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
168 &self.email
169 }
170 pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.commit_message = ::std::option::Option::Some(input.into());
173 self
174 }
175 pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.commit_message = input;
178 self
179 }
180 pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
182 &self.commit_message
183 }
184 pub fn keep_empty_folders(mut self, input: bool) -> Self {
186 self.keep_empty_folders = ::std::option::Option::Some(input);
187 self
188 }
189 pub fn set_keep_empty_folders(mut self, input: ::std::option::Option<bool>) -> Self {
191 self.keep_empty_folders = input;
192 self
193 }
194 pub fn get_keep_empty_folders(&self) -> &::std::option::Option<bool> {
196 &self.keep_empty_folders
197 }
198 pub fn put_files(mut self, input: crate::types::PutFileEntry) -> Self {
204 let mut v = self.put_files.unwrap_or_default();
205 v.push(input);
206 self.put_files = ::std::option::Option::Some(v);
207 self
208 }
209 pub fn set_put_files(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PutFileEntry>>) -> Self {
211 self.put_files = input;
212 self
213 }
214 pub fn get_put_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PutFileEntry>> {
216 &self.put_files
217 }
218 pub fn delete_files(mut self, input: crate::types::DeleteFileEntry) -> Self {
224 let mut v = self.delete_files.unwrap_or_default();
225 v.push(input);
226 self.delete_files = ::std::option::Option::Some(v);
227 self
228 }
229 pub fn set_delete_files(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeleteFileEntry>>) -> Self {
231 self.delete_files = input;
232 self
233 }
234 pub fn get_delete_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeleteFileEntry>> {
236 &self.delete_files
237 }
238 pub fn set_file_modes(mut self, input: crate::types::SetFileModeEntry) -> Self {
244 let mut v = self.set_file_modes.unwrap_or_default();
245 v.push(input);
246 self.set_file_modes = ::std::option::Option::Some(v);
247 self
248 }
249 pub fn set_set_file_modes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SetFileModeEntry>>) -> Self {
251 self.set_file_modes = input;
252 self
253 }
254 pub fn get_set_file_modes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SetFileModeEntry>> {
256 &self.set_file_modes
257 }
258 pub fn build(
260 self,
261 ) -> ::std::result::Result<crate::operation::create_commit::CreateCommitInput, ::aws_smithy_types::error::operation::BuildError> {
262 ::std::result::Result::Ok(crate::operation::create_commit::CreateCommitInput {
263 repository_name: self.repository_name,
264 branch_name: self.branch_name,
265 parent_commit_id: self.parent_commit_id,
266 author_name: self.author_name,
267 email: self.email,
268 commit_message: self.commit_message,
269 keep_empty_folders: self.keep_empty_folders,
270 put_files: self.put_files,
271 delete_files: self.delete_files,
272 set_file_modes: self.set_file_modes,
273 })
274 }
275}