aws_sdk_codecommit/operation/get_folder/
_get_folder_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetFolderOutput {
6 pub commit_id: ::std::string::String,
8 pub folder_path: ::std::string::String,
10 pub tree_id: ::std::option::Option<::std::string::String>,
12 pub sub_folders: ::std::option::Option<::std::vec::Vec<crate::types::Folder>>,
14 pub files: ::std::option::Option<::std::vec::Vec<crate::types::File>>,
16 pub symbolic_links: ::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>>,
18 pub sub_modules: ::std::option::Option<::std::vec::Vec<crate::types::SubModule>>,
20 _request_id: Option<String>,
21}
22impl GetFolderOutput {
23 pub fn commit_id(&self) -> &str {
25 use std::ops::Deref;
26 self.commit_id.deref()
27 }
28 pub fn folder_path(&self) -> &str {
30 use std::ops::Deref;
31 self.folder_path.deref()
32 }
33 pub fn tree_id(&self) -> ::std::option::Option<&str> {
35 self.tree_id.as_deref()
36 }
37 pub fn sub_folders(&self) -> &[crate::types::Folder] {
41 self.sub_folders.as_deref().unwrap_or_default()
42 }
43 pub fn files(&self) -> &[crate::types::File] {
47 self.files.as_deref().unwrap_or_default()
48 }
49 pub fn symbolic_links(&self) -> &[crate::types::SymbolicLink] {
53 self.symbolic_links.as_deref().unwrap_or_default()
54 }
55 pub fn sub_modules(&self) -> &[crate::types::SubModule] {
59 self.sub_modules.as_deref().unwrap_or_default()
60 }
61}
62impl ::aws_types::request_id::RequestId for GetFolderOutput {
63 fn request_id(&self) -> Option<&str> {
64 self._request_id.as_deref()
65 }
66}
67impl GetFolderOutput {
68 pub fn builder() -> crate::operation::get_folder::builders::GetFolderOutputBuilder {
70 crate::operation::get_folder::builders::GetFolderOutputBuilder::default()
71 }
72}
73
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct GetFolderOutputBuilder {
78 pub(crate) commit_id: ::std::option::Option<::std::string::String>,
79 pub(crate) folder_path: ::std::option::Option<::std::string::String>,
80 pub(crate) tree_id: ::std::option::Option<::std::string::String>,
81 pub(crate) sub_folders: ::std::option::Option<::std::vec::Vec<crate::types::Folder>>,
82 pub(crate) files: ::std::option::Option<::std::vec::Vec<crate::types::File>>,
83 pub(crate) symbolic_links: ::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>>,
84 pub(crate) sub_modules: ::std::option::Option<::std::vec::Vec<crate::types::SubModule>>,
85 _request_id: Option<String>,
86}
87impl GetFolderOutputBuilder {
88 pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.commit_id = ::std::option::Option::Some(input.into());
92 self
93 }
94 pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.commit_id = input;
97 self
98 }
99 pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
101 &self.commit_id
102 }
103 pub fn folder_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.folder_path = ::std::option::Option::Some(input.into());
107 self
108 }
109 pub fn set_folder_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.folder_path = input;
112 self
113 }
114 pub fn get_folder_path(&self) -> &::std::option::Option<::std::string::String> {
116 &self.folder_path
117 }
118 pub fn tree_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.tree_id = ::std::option::Option::Some(input.into());
121 self
122 }
123 pub fn set_tree_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.tree_id = input;
126 self
127 }
128 pub fn get_tree_id(&self) -> &::std::option::Option<::std::string::String> {
130 &self.tree_id
131 }
132 pub fn sub_folders(mut self, input: crate::types::Folder) -> Self {
138 let mut v = self.sub_folders.unwrap_or_default();
139 v.push(input);
140 self.sub_folders = ::std::option::Option::Some(v);
141 self
142 }
143 pub fn set_sub_folders(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Folder>>) -> Self {
145 self.sub_folders = input;
146 self
147 }
148 pub fn get_sub_folders(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Folder>> {
150 &self.sub_folders
151 }
152 pub fn files(mut self, input: crate::types::File) -> Self {
158 let mut v = self.files.unwrap_or_default();
159 v.push(input);
160 self.files = ::std::option::Option::Some(v);
161 self
162 }
163 pub fn set_files(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::File>>) -> Self {
165 self.files = input;
166 self
167 }
168 pub fn get_files(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::File>> {
170 &self.files
171 }
172 pub fn symbolic_links(mut self, input: crate::types::SymbolicLink) -> Self {
178 let mut v = self.symbolic_links.unwrap_or_default();
179 v.push(input);
180 self.symbolic_links = ::std::option::Option::Some(v);
181 self
182 }
183 pub fn set_symbolic_links(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>>) -> Self {
185 self.symbolic_links = input;
186 self
187 }
188 pub fn get_symbolic_links(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SymbolicLink>> {
190 &self.symbolic_links
191 }
192 pub fn sub_modules(mut self, input: crate::types::SubModule) -> Self {
198 let mut v = self.sub_modules.unwrap_or_default();
199 v.push(input);
200 self.sub_modules = ::std::option::Option::Some(v);
201 self
202 }
203 pub fn set_sub_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubModule>>) -> Self {
205 self.sub_modules = input;
206 self
207 }
208 pub fn get_sub_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubModule>> {
210 &self.sub_modules
211 }
212 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
213 self._request_id = Some(request_id.into());
214 self
215 }
216
217 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
218 self._request_id = request_id;
219 self
220 }
221 pub fn build(self) -> ::std::result::Result<crate::operation::get_folder::GetFolderOutput, ::aws_smithy_types::error::operation::BuildError> {
226 ::std::result::Result::Ok(crate::operation::get_folder::GetFolderOutput {
227 commit_id: self.commit_id.ok_or_else(|| {
228 ::aws_smithy_types::error::operation::BuildError::missing_field(
229 "commit_id",
230 "commit_id was not specified but it is required when building GetFolderOutput",
231 )
232 })?,
233 folder_path: self.folder_path.ok_or_else(|| {
234 ::aws_smithy_types::error::operation::BuildError::missing_field(
235 "folder_path",
236 "folder_path was not specified but it is required when building GetFolderOutput",
237 )
238 })?,
239 tree_id: self.tree_id,
240 sub_folders: self.sub_folders,
241 files: self.files,
242 symbolic_links: self.symbolic_links,
243 sub_modules: self.sub_modules,
244 _request_id: self._request_id,
245 })
246 }
247}