aws_sdk_codecommit/operation/delete_file/
_delete_file_output.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 DeleteFileOutput {
6    /// <p>The full commit ID of the commit that contains the change that deletes the file.</p>
7    pub commit_id: ::std::string::String,
8    /// <p>The blob ID removed from the tree as part of deleting the file.</p>
9    pub blob_id: ::std::string::String,
10    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the delete file change.</p>
11    pub tree_id: ::std::string::String,
12    /// <p>The fully qualified path to the file to be deleted, including the full name and extension of that file.</p>
13    pub file_path: ::std::string::String,
14    _request_id: Option<String>,
15}
16impl DeleteFileOutput {
17    /// <p>The full commit ID of the commit that contains the change that deletes the file.</p>
18    pub fn commit_id(&self) -> &str {
19        use std::ops::Deref;
20        self.commit_id.deref()
21    }
22    /// <p>The blob ID removed from the tree as part of deleting the file.</p>
23    pub fn blob_id(&self) -> &str {
24        use std::ops::Deref;
25        self.blob_id.deref()
26    }
27    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the delete file change.</p>
28    pub fn tree_id(&self) -> &str {
29        use std::ops::Deref;
30        self.tree_id.deref()
31    }
32    /// <p>The fully qualified path to the file to be deleted, including the full name and extension of that file.</p>
33    pub fn file_path(&self) -> &str {
34        use std::ops::Deref;
35        self.file_path.deref()
36    }
37}
38impl ::aws_types::request_id::RequestId for DeleteFileOutput {
39    fn request_id(&self) -> Option<&str> {
40        self._request_id.as_deref()
41    }
42}
43impl DeleteFileOutput {
44    /// Creates a new builder-style object to manufacture [`DeleteFileOutput`](crate::operation::delete_file::DeleteFileOutput).
45    pub fn builder() -> crate::operation::delete_file::builders::DeleteFileOutputBuilder {
46        crate::operation::delete_file::builders::DeleteFileOutputBuilder::default()
47    }
48}
49
50/// A builder for [`DeleteFileOutput`](crate::operation::delete_file::DeleteFileOutput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct DeleteFileOutputBuilder {
54    pub(crate) commit_id: ::std::option::Option<::std::string::String>,
55    pub(crate) blob_id: ::std::option::Option<::std::string::String>,
56    pub(crate) tree_id: ::std::option::Option<::std::string::String>,
57    pub(crate) file_path: ::std::option::Option<::std::string::String>,
58    _request_id: Option<String>,
59}
60impl DeleteFileOutputBuilder {
61    /// <p>The full commit ID of the commit that contains the change that deletes the file.</p>
62    /// This field is required.
63    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.commit_id = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The full commit ID of the commit that contains the change that deletes the file.</p>
68    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.commit_id = input;
70        self
71    }
72    /// <p>The full commit ID of the commit that contains the change that deletes the file.</p>
73    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
74        &self.commit_id
75    }
76    /// <p>The blob ID removed from the tree as part of deleting the file.</p>
77    /// This field is required.
78    pub fn blob_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.blob_id = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The blob ID removed from the tree as part of deleting the file.</p>
83    pub fn set_blob_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.blob_id = input;
85        self
86    }
87    /// <p>The blob ID removed from the tree as part of deleting the file.</p>
88    pub fn get_blob_id(&self) -> &::std::option::Option<::std::string::String> {
89        &self.blob_id
90    }
91    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the delete file change.</p>
92    /// This field is required.
93    pub fn tree_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.tree_id = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the delete file change.</p>
98    pub fn set_tree_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.tree_id = input;
100        self
101    }
102    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the delete file change.</p>
103    pub fn get_tree_id(&self) -> &::std::option::Option<::std::string::String> {
104        &self.tree_id
105    }
106    /// <p>The fully qualified path to the file to be deleted, including the full name and extension of that file.</p>
107    /// This field is required.
108    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.file_path = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The fully qualified path to the file to be deleted, including the full name and extension of that file.</p>
113    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.file_path = input;
115        self
116    }
117    /// <p>The fully qualified path to the file to be deleted, including the full name and extension of that file.</p>
118    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
119        &self.file_path
120    }
121    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
122        self._request_id = Some(request_id.into());
123        self
124    }
125
126    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
127        self._request_id = request_id;
128        self
129    }
130    /// Consumes the builder and constructs a [`DeleteFileOutput`](crate::operation::delete_file::DeleteFileOutput).
131    /// This method will fail if any of the following fields are not set:
132    /// - [`commit_id`](crate::operation::delete_file::builders::DeleteFileOutputBuilder::commit_id)
133    /// - [`blob_id`](crate::operation::delete_file::builders::DeleteFileOutputBuilder::blob_id)
134    /// - [`tree_id`](crate::operation::delete_file::builders::DeleteFileOutputBuilder::tree_id)
135    /// - [`file_path`](crate::operation::delete_file::builders::DeleteFileOutputBuilder::file_path)
136    pub fn build(self) -> ::std::result::Result<crate::operation::delete_file::DeleteFileOutput, ::aws_smithy_types::error::operation::BuildError> {
137        ::std::result::Result::Ok(crate::operation::delete_file::DeleteFileOutput {
138            commit_id: self.commit_id.ok_or_else(|| {
139                ::aws_smithy_types::error::operation::BuildError::missing_field(
140                    "commit_id",
141                    "commit_id was not specified but it is required when building DeleteFileOutput",
142                )
143            })?,
144            blob_id: self.blob_id.ok_or_else(|| {
145                ::aws_smithy_types::error::operation::BuildError::missing_field(
146                    "blob_id",
147                    "blob_id was not specified but it is required when building DeleteFileOutput",
148                )
149            })?,
150            tree_id: self.tree_id.ok_or_else(|| {
151                ::aws_smithy_types::error::operation::BuildError::missing_field(
152                    "tree_id",
153                    "tree_id was not specified but it is required when building DeleteFileOutput",
154                )
155            })?,
156            file_path: self.file_path.ok_or_else(|| {
157                ::aws_smithy_types::error::operation::BuildError::missing_field(
158                    "file_path",
159                    "file_path was not specified but it is required when building DeleteFileOutput",
160                )
161            })?,
162            _request_id: self._request_id,
163        })
164    }
165}