aws_sdk_codecommit/operation/create_commit/
_create_commit_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 CreateCommitOutput {
6    /// <p>The full commit ID of the commit that contains your committed file changes.</p>
7    pub commit_id: ::std::option::Option<::std::string::String>,
8    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the commited file changes.</p>
9    pub tree_id: ::std::option::Option<::std::string::String>,
10    /// <p>The files added as part of the committed file changes.</p>
11    pub files_added: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>,
12    /// <p>The files updated as part of the commited file changes.</p>
13    pub files_updated: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>,
14    /// <p>The files deleted as part of the committed file changes.</p>
15    pub files_deleted: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>,
16    _request_id: Option<String>,
17}
18impl CreateCommitOutput {
19    /// <p>The full commit ID of the commit that contains your committed file changes.</p>
20    pub fn commit_id(&self) -> ::std::option::Option<&str> {
21        self.commit_id.as_deref()
22    }
23    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the commited file changes.</p>
24    pub fn tree_id(&self) -> ::std::option::Option<&str> {
25        self.tree_id.as_deref()
26    }
27    /// <p>The files added as part of the committed file changes.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.files_added.is_none()`.
30    pub fn files_added(&self) -> &[crate::types::FileMetadata] {
31        self.files_added.as_deref().unwrap_or_default()
32    }
33    /// <p>The files updated as part of the commited file changes.</p>
34    ///
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.files_updated.is_none()`.
36    pub fn files_updated(&self) -> &[crate::types::FileMetadata] {
37        self.files_updated.as_deref().unwrap_or_default()
38    }
39    /// <p>The files deleted as part of the committed file changes.</p>
40    ///
41    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.files_deleted.is_none()`.
42    pub fn files_deleted(&self) -> &[crate::types::FileMetadata] {
43        self.files_deleted.as_deref().unwrap_or_default()
44    }
45}
46impl ::aws_types::request_id::RequestId for CreateCommitOutput {
47    fn request_id(&self) -> Option<&str> {
48        self._request_id.as_deref()
49    }
50}
51impl CreateCommitOutput {
52    /// Creates a new builder-style object to manufacture [`CreateCommitOutput`](crate::operation::create_commit::CreateCommitOutput).
53    pub fn builder() -> crate::operation::create_commit::builders::CreateCommitOutputBuilder {
54        crate::operation::create_commit::builders::CreateCommitOutputBuilder::default()
55    }
56}
57
58/// A builder for [`CreateCommitOutput`](crate::operation::create_commit::CreateCommitOutput).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct CreateCommitOutputBuilder {
62    pub(crate) commit_id: ::std::option::Option<::std::string::String>,
63    pub(crate) tree_id: ::std::option::Option<::std::string::String>,
64    pub(crate) files_added: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>,
65    pub(crate) files_updated: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>,
66    pub(crate) files_deleted: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>,
67    _request_id: Option<String>,
68}
69impl CreateCommitOutputBuilder {
70    /// <p>The full commit ID of the commit that contains your committed file changes.</p>
71    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.commit_id = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The full commit ID of the commit that contains your committed file changes.</p>
76    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.commit_id = input;
78        self
79    }
80    /// <p>The full commit ID of the commit that contains your committed file changes.</p>
81    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
82        &self.commit_id
83    }
84    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the commited file changes.</p>
85    pub fn tree_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.tree_id = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the commited file changes.</p>
90    pub fn set_tree_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.tree_id = input;
92        self
93    }
94    /// <p>The full SHA-1 pointer of the tree information for the commit that contains the commited file changes.</p>
95    pub fn get_tree_id(&self) -> &::std::option::Option<::std::string::String> {
96        &self.tree_id
97    }
98    /// Appends an item to `files_added`.
99    ///
100    /// To override the contents of this collection use [`set_files_added`](Self::set_files_added).
101    ///
102    /// <p>The files added as part of the committed file changes.</p>
103    pub fn files_added(mut self, input: crate::types::FileMetadata) -> Self {
104        let mut v = self.files_added.unwrap_or_default();
105        v.push(input);
106        self.files_added = ::std::option::Option::Some(v);
107        self
108    }
109    /// <p>The files added as part of the committed file changes.</p>
110    pub fn set_files_added(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>) -> Self {
111        self.files_added = input;
112        self
113    }
114    /// <p>The files added as part of the committed file changes.</p>
115    pub fn get_files_added(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>> {
116        &self.files_added
117    }
118    /// Appends an item to `files_updated`.
119    ///
120    /// To override the contents of this collection use [`set_files_updated`](Self::set_files_updated).
121    ///
122    /// <p>The files updated as part of the commited file changes.</p>
123    pub fn files_updated(mut self, input: crate::types::FileMetadata) -> Self {
124        let mut v = self.files_updated.unwrap_or_default();
125        v.push(input);
126        self.files_updated = ::std::option::Option::Some(v);
127        self
128    }
129    /// <p>The files updated as part of the commited file changes.</p>
130    pub fn set_files_updated(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>) -> Self {
131        self.files_updated = input;
132        self
133    }
134    /// <p>The files updated as part of the commited file changes.</p>
135    pub fn get_files_updated(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>> {
136        &self.files_updated
137    }
138    /// Appends an item to `files_deleted`.
139    ///
140    /// To override the contents of this collection use [`set_files_deleted`](Self::set_files_deleted).
141    ///
142    /// <p>The files deleted as part of the committed file changes.</p>
143    pub fn files_deleted(mut self, input: crate::types::FileMetadata) -> Self {
144        let mut v = self.files_deleted.unwrap_or_default();
145        v.push(input);
146        self.files_deleted = ::std::option::Option::Some(v);
147        self
148    }
149    /// <p>The files deleted as part of the committed file changes.</p>
150    pub fn set_files_deleted(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>>) -> Self {
151        self.files_deleted = input;
152        self
153    }
154    /// <p>The files deleted as part of the committed file changes.</p>
155    pub fn get_files_deleted(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FileMetadata>> {
156        &self.files_deleted
157    }
158    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
159        self._request_id = Some(request_id.into());
160        self
161    }
162
163    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
164        self._request_id = request_id;
165        self
166    }
167    /// Consumes the builder and constructs a [`CreateCommitOutput`](crate::operation::create_commit::CreateCommitOutput).
168    pub fn build(self) -> crate::operation::create_commit::CreateCommitOutput {
169        crate::operation::create_commit::CreateCommitOutput {
170            commit_id: self.commit_id,
171            tree_id: self.tree_id,
172            files_added: self.files_added,
173            files_updated: self.files_updated,
174            files_deleted: self.files_deleted,
175            _request_id: self._request_id,
176        }
177    }
178}