aws_sdk_codecommit/operation/delete_file/
_delete_file_input.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 DeleteFileInput {
6    /// <p>The name of the repository that contains the file to delete.</p>
7    pub repository_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the branch where the commit that deletes the file is made.</p>
9    pub branch_name: ::std::option::Option<::std::string::String>,
10    /// <p>The fully qualified path to the file that to be deleted, including the full name and extension of that file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.</p>
11    pub file_path: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the commit that is the tip of the branch where you want to create the commit that deletes the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit ID.</p>
13    pub parent_commit_id: ::std::option::Option<::std::string::String>,
14    /// <p>If a file is the only object in the folder or directory, specifies whether to delete the folder or directory that contains the file. By default, empty folders are deleted. This includes empty folders that are part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.</p>
15    pub keep_empty_folders: ::std::option::Option<bool>,
16    /// <p>The commit message you want to include as part of deleting the file. Commit messages are limited to 256 KB. If no message is specified, a default message is used.</p>
17    pub commit_message: ::std::option::Option<::std::string::String>,
18    /// <p>The name of the author of the commit that deletes the file. If no name is specified, the user's ARN is used as the author name and committer name.</p>
19    pub name: ::std::option::Option<::std::string::String>,
20    /// <p>The email address for the commit that deletes the file. If no email address is specified, the email address is left blank.</p>
21    pub email: ::std::option::Option<::std::string::String>,
22}
23impl DeleteFileInput {
24    /// <p>The name of the repository that contains the file to delete.</p>
25    pub fn repository_name(&self) -> ::std::option::Option<&str> {
26        self.repository_name.as_deref()
27    }
28    /// <p>The name of the branch where the commit that deletes the file is made.</p>
29    pub fn branch_name(&self) -> ::std::option::Option<&str> {
30        self.branch_name.as_deref()
31    }
32    /// <p>The fully qualified path to the file that to be deleted, including the full name and extension of that file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.</p>
33    pub fn file_path(&self) -> ::std::option::Option<&str> {
34        self.file_path.as_deref()
35    }
36    /// <p>The ID of the commit that is the tip of the branch where you want to create the commit that deletes the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit ID.</p>
37    pub fn parent_commit_id(&self) -> ::std::option::Option<&str> {
38        self.parent_commit_id.as_deref()
39    }
40    /// <p>If a file is the only object in the folder or directory, specifies whether to delete the folder or directory that contains the file. By default, empty folders are deleted. This includes empty folders that are part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.</p>
41    pub fn keep_empty_folders(&self) -> ::std::option::Option<bool> {
42        self.keep_empty_folders
43    }
44    /// <p>The commit message you want to include as part of deleting the file. Commit messages are limited to 256 KB. If no message is specified, a default message is used.</p>
45    pub fn commit_message(&self) -> ::std::option::Option<&str> {
46        self.commit_message.as_deref()
47    }
48    /// <p>The name of the author of the commit that deletes the file. If no name is specified, the user's ARN is used as the author name and committer name.</p>
49    pub fn name(&self) -> ::std::option::Option<&str> {
50        self.name.as_deref()
51    }
52    /// <p>The email address for the commit that deletes the file. If no email address is specified, the email address is left blank.</p>
53    pub fn email(&self) -> ::std::option::Option<&str> {
54        self.email.as_deref()
55    }
56}
57impl DeleteFileInput {
58    /// Creates a new builder-style object to manufacture [`DeleteFileInput`](crate::operation::delete_file::DeleteFileInput).
59    pub fn builder() -> crate::operation::delete_file::builders::DeleteFileInputBuilder {
60        crate::operation::delete_file::builders::DeleteFileInputBuilder::default()
61    }
62}
63
64/// A builder for [`DeleteFileInput`](crate::operation::delete_file::DeleteFileInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct DeleteFileInputBuilder {
68    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
69    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
70    pub(crate) file_path: ::std::option::Option<::std::string::String>,
71    pub(crate) parent_commit_id: ::std::option::Option<::std::string::String>,
72    pub(crate) keep_empty_folders: ::std::option::Option<bool>,
73    pub(crate) commit_message: ::std::option::Option<::std::string::String>,
74    pub(crate) name: ::std::option::Option<::std::string::String>,
75    pub(crate) email: ::std::option::Option<::std::string::String>,
76}
77impl DeleteFileInputBuilder {
78    /// <p>The name of the repository that contains the file to delete.</p>
79    /// This field is required.
80    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.repository_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the repository that contains the file to delete.</p>
85    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.repository_name = input;
87        self
88    }
89    /// <p>The name of the repository that contains the file to delete.</p>
90    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.repository_name
92    }
93    /// <p>The name of the branch where the commit that deletes the file is made.</p>
94    /// This field is required.
95    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.branch_name = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The name of the branch where the commit that deletes the file is made.</p>
100    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.branch_name = input;
102        self
103    }
104    /// <p>The name of the branch where the commit that deletes the file is made.</p>
105    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
106        &self.branch_name
107    }
108    /// <p>The fully qualified path to the file that to be deleted, including the full name and extension of that file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.</p>
109    /// This field is required.
110    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.file_path = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The fully qualified path to the file that to be deleted, including the full name and extension of that file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.</p>
115    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.file_path = input;
117        self
118    }
119    /// <p>The fully qualified path to the file that to be deleted, including the full name and extension of that file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.</p>
120    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
121        &self.file_path
122    }
123    /// <p>The ID of the commit that is the tip of the branch where you want to create the commit that deletes the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit ID.</p>
124    /// This field is required.
125    pub fn parent_commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.parent_commit_id = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The ID of the commit that is the tip of the branch where you want to create the commit that deletes the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit ID.</p>
130    pub fn set_parent_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.parent_commit_id = input;
132        self
133    }
134    /// <p>The ID of the commit that is the tip of the branch where you want to create the commit that deletes the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit ID.</p>
135    pub fn get_parent_commit_id(&self) -> &::std::option::Option<::std::string::String> {
136        &self.parent_commit_id
137    }
138    /// <p>If a file is the only object in the folder or directory, specifies whether to delete the folder or directory that contains the file. By default, empty folders are deleted. This includes empty folders that are part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.</p>
139    pub fn keep_empty_folders(mut self, input: bool) -> Self {
140        self.keep_empty_folders = ::std::option::Option::Some(input);
141        self
142    }
143    /// <p>If a file is the only object in the folder or directory, specifies whether to delete the folder or directory that contains the file. By default, empty folders are deleted. This includes empty folders that are part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.</p>
144    pub fn set_keep_empty_folders(mut self, input: ::std::option::Option<bool>) -> Self {
145        self.keep_empty_folders = input;
146        self
147    }
148    /// <p>If a file is the only object in the folder or directory, specifies whether to delete the folder or directory that contains the file. By default, empty folders are deleted. This includes empty folders that are part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.</p>
149    pub fn get_keep_empty_folders(&self) -> &::std::option::Option<bool> {
150        &self.keep_empty_folders
151    }
152    /// <p>The commit message you want to include as part of deleting the file. Commit messages are limited to 256 KB. If no message is specified, a default message is used.</p>
153    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.commit_message = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>The commit message you want to include as part of deleting the file. Commit messages are limited to 256 KB. If no message is specified, a default message is used.</p>
158    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.commit_message = input;
160        self
161    }
162    /// <p>The commit message you want to include as part of deleting the file. Commit messages are limited to 256 KB. If no message is specified, a default message is used.</p>
163    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
164        &self.commit_message
165    }
166    /// <p>The name of the author of the commit that deletes the file. If no name is specified, the user's ARN is used as the author name and committer name.</p>
167    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.name = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>The name of the author of the commit that deletes the file. If no name is specified, the user's ARN is used as the author name and committer name.</p>
172    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.name = input;
174        self
175    }
176    /// <p>The name of the author of the commit that deletes the file. If no name is specified, the user's ARN is used as the author name and committer name.</p>
177    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
178        &self.name
179    }
180    /// <p>The email address for the commit that deletes the file. If no email address is specified, the email address is left blank.</p>
181    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.email = ::std::option::Option::Some(input.into());
183        self
184    }
185    /// <p>The email address for the commit that deletes the file. If no email address is specified, the email address is left blank.</p>
186    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.email = input;
188        self
189    }
190    /// <p>The email address for the commit that deletes the file. If no email address is specified, the email address is left blank.</p>
191    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
192        &self.email
193    }
194    /// Consumes the builder and constructs a [`DeleteFileInput`](crate::operation::delete_file::DeleteFileInput).
195    pub fn build(self) -> ::std::result::Result<crate::operation::delete_file::DeleteFileInput, ::aws_smithy_types::error::operation::BuildError> {
196        ::std::result::Result::Ok(crate::operation::delete_file::DeleteFileInput {
197            repository_name: self.repository_name,
198            branch_name: self.branch_name,
199            file_path: self.file_path,
200            parent_commit_id: self.parent_commit_id,
201            keep_empty_folders: self.keep_empty_folders,
202            commit_message: self.commit_message,
203            name: self.name,
204            email: self.email,
205        })
206    }
207}