aws_sdk_codecommit/operation/put_file/
_put_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 PutFileInput {
6    /// <p>The name of the repository where you want to add or update the file.</p>
7    pub repository_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.</p>
9    pub branch_name: ::std::option::Option<::std::string::String>,
10    /// <p>The content of the file, in binary object format.</p>
11    pub file_content: ::std::option::Option<::aws_smithy_types::Blob>,
12    /// <p>The name of the file you want to add or update, including the relative path to the file in the repository.</p><note>
13    /// <p>If the path does not currently exist in the repository, the path is created as part of adding the file.</p>
14    /// </note>
15    pub file_path: ::std::option::Option<::std::string::String>,
16    /// <p>The file mode permissions of the blob. Valid file mode permissions are listed here.</p>
17    pub file_mode: ::std::option::Option<crate::types::FileModeTypeEnum>,
18    /// <p>The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.</p>
19    /// <p>The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.</p>
20    pub parent_commit_id: ::std::option::Option<::std::string::String>,
21    /// <p>A message about why this file was added or updated. Although it is optional, a message makes the commit history for your repository more useful.</p>
22    pub commit_message: ::std::option::Option<::std::string::String>,
23    /// <p>The name of the person adding or updating the file. Although it is optional, a name makes the commit history for your repository more useful.</p>
24    pub name: ::std::option::Option<::std::string::String>,
25    /// <p>An email address for the person adding or updating the file.</p>
26    pub email: ::std::option::Option<::std::string::String>,
27}
28impl PutFileInput {
29    /// <p>The name of the repository where you want to add or update the file.</p>
30    pub fn repository_name(&self) -> ::std::option::Option<&str> {
31        self.repository_name.as_deref()
32    }
33    /// <p>The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.</p>
34    pub fn branch_name(&self) -> ::std::option::Option<&str> {
35        self.branch_name.as_deref()
36    }
37    /// <p>The content of the file, in binary object format.</p>
38    pub fn file_content(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
39        self.file_content.as_ref()
40    }
41    /// <p>The name of the file you want to add or update, including the relative path to the file in the repository.</p><note>
42    /// <p>If the path does not currently exist in the repository, the path is created as part of adding the file.</p>
43    /// </note>
44    pub fn file_path(&self) -> ::std::option::Option<&str> {
45        self.file_path.as_deref()
46    }
47    /// <p>The file mode permissions of the blob. Valid file mode permissions are listed here.</p>
48    pub fn file_mode(&self) -> ::std::option::Option<&crate::types::FileModeTypeEnum> {
49        self.file_mode.as_ref()
50    }
51    /// <p>The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.</p>
52    /// <p>The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.</p>
53    pub fn parent_commit_id(&self) -> ::std::option::Option<&str> {
54        self.parent_commit_id.as_deref()
55    }
56    /// <p>A message about why this file was added or updated. Although it is optional, a message makes the commit history for your repository more useful.</p>
57    pub fn commit_message(&self) -> ::std::option::Option<&str> {
58        self.commit_message.as_deref()
59    }
60    /// <p>The name of the person adding or updating the file. Although it is optional, a name makes the commit history for your repository more useful.</p>
61    pub fn name(&self) -> ::std::option::Option<&str> {
62        self.name.as_deref()
63    }
64    /// <p>An email address for the person adding or updating the file.</p>
65    pub fn email(&self) -> ::std::option::Option<&str> {
66        self.email.as_deref()
67    }
68}
69impl PutFileInput {
70    /// Creates a new builder-style object to manufacture [`PutFileInput`](crate::operation::put_file::PutFileInput).
71    pub fn builder() -> crate::operation::put_file::builders::PutFileInputBuilder {
72        crate::operation::put_file::builders::PutFileInputBuilder::default()
73    }
74}
75
76/// A builder for [`PutFileInput`](crate::operation::put_file::PutFileInput).
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct PutFileInputBuilder {
80    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
81    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
82    pub(crate) file_content: ::std::option::Option<::aws_smithy_types::Blob>,
83    pub(crate) file_path: ::std::option::Option<::std::string::String>,
84    pub(crate) file_mode: ::std::option::Option<crate::types::FileModeTypeEnum>,
85    pub(crate) parent_commit_id: ::std::option::Option<::std::string::String>,
86    pub(crate) commit_message: ::std::option::Option<::std::string::String>,
87    pub(crate) name: ::std::option::Option<::std::string::String>,
88    pub(crate) email: ::std::option::Option<::std::string::String>,
89}
90impl PutFileInputBuilder {
91    /// <p>The name of the repository where you want to add or update the file.</p>
92    /// This field is required.
93    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.repository_name = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The name of the repository where you want to add or update the file.</p>
98    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.repository_name = input;
100        self
101    }
102    /// <p>The name of the repository where you want to add or update the file.</p>
103    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
104        &self.repository_name
105    }
106    /// <p>The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.</p>
107    /// This field is required.
108    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.branch_name = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.</p>
113    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.branch_name = input;
115        self
116    }
117    /// <p>The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.</p>
118    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
119        &self.branch_name
120    }
121    /// <p>The content of the file, in binary object format.</p>
122    /// This field is required.
123    pub fn file_content(mut self, input: ::aws_smithy_types::Blob) -> Self {
124        self.file_content = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>The content of the file, in binary object format.</p>
128    pub fn set_file_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
129        self.file_content = input;
130        self
131    }
132    /// <p>The content of the file, in binary object format.</p>
133    pub fn get_file_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
134        &self.file_content
135    }
136    /// <p>The name of the file you want to add or update, including the relative path to the file in the repository.</p><note>
137    /// <p>If the path does not currently exist in the repository, the path is created as part of adding the file.</p>
138    /// </note>
139    /// This field is required.
140    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.file_path = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>The name of the file you want to add or update, including the relative path to the file in the repository.</p><note>
145    /// <p>If the path does not currently exist in the repository, the path is created as part of adding the file.</p>
146    /// </note>
147    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.file_path = input;
149        self
150    }
151    /// <p>The name of the file you want to add or update, including the relative path to the file in the repository.</p><note>
152    /// <p>If the path does not currently exist in the repository, the path is created as part of adding the file.</p>
153    /// </note>
154    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
155        &self.file_path
156    }
157    /// <p>The file mode permissions of the blob. Valid file mode permissions are listed here.</p>
158    pub fn file_mode(mut self, input: crate::types::FileModeTypeEnum) -> Self {
159        self.file_mode = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The file mode permissions of the blob. Valid file mode permissions are listed here.</p>
163    pub fn set_file_mode(mut self, input: ::std::option::Option<crate::types::FileModeTypeEnum>) -> Self {
164        self.file_mode = input;
165        self
166    }
167    /// <p>The file mode permissions of the blob. Valid file mode permissions are listed here.</p>
168    pub fn get_file_mode(&self) -> &::std::option::Option<crate::types::FileModeTypeEnum> {
169        &self.file_mode
170    }
171    /// <p>The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.</p>
172    /// <p>The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.</p>
173    pub fn parent_commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.parent_commit_id = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.</p>
178    /// <p>The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.</p>
179    pub fn set_parent_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.parent_commit_id = input;
181        self
182    }
183    /// <p>The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.</p>
184    /// <p>The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.</p>
185    pub fn get_parent_commit_id(&self) -> &::std::option::Option<::std::string::String> {
186        &self.parent_commit_id
187    }
188    /// <p>A message about why this file was added or updated. Although it is optional, a message makes the commit history for your repository more useful.</p>
189    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.commit_message = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>A message about why this file was added or updated. Although it is optional, a message makes the commit history for your repository more useful.</p>
194    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.commit_message = input;
196        self
197    }
198    /// <p>A message about why this file was added or updated. Although it is optional, a message makes the commit history for your repository more useful.</p>
199    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
200        &self.commit_message
201    }
202    /// <p>The name of the person adding or updating the file. Although it is optional, a name makes the commit history for your repository more useful.</p>
203    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.name = ::std::option::Option::Some(input.into());
205        self
206    }
207    /// <p>The name of the person adding or updating the file. Although it is optional, a name makes the commit history for your repository more useful.</p>
208    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.name = input;
210        self
211    }
212    /// <p>The name of the person adding or updating the file. Although it is optional, a name makes the commit history for your repository more useful.</p>
213    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
214        &self.name
215    }
216    /// <p>An email address for the person adding or updating the file.</p>
217    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.email = ::std::option::Option::Some(input.into());
219        self
220    }
221    /// <p>An email address for the person adding or updating the file.</p>
222    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223        self.email = input;
224        self
225    }
226    /// <p>An email address for the person adding or updating the file.</p>
227    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
228        &self.email
229    }
230    /// Consumes the builder and constructs a [`PutFileInput`](crate::operation::put_file::PutFileInput).
231    pub fn build(self) -> ::std::result::Result<crate::operation::put_file::PutFileInput, ::aws_smithy_types::error::operation::BuildError> {
232        ::std::result::Result::Ok(crate::operation::put_file::PutFileInput {
233            repository_name: self.repository_name,
234            branch_name: self.branch_name,
235            file_content: self.file_content,
236            file_path: self.file_path,
237            file_mode: self.file_mode,
238            parent_commit_id: self.parent_commit_id,
239            commit_message: self.commit_message,
240            name: self.name,
241            email: self.email,
242        })
243    }
244}