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