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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Returns information about a specific commit.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Commit {
/// <p>The full SHA ID of the specified commit.</p>
pub commit_id: ::std::option::Option<::std::string::String>,
/// <p>Tree information for the specified commit.</p>
pub tree_id: ::std::option::Option<::std::string::String>,
/// <p>A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.</p>
pub parents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The commit message associated with the specified commit.</p>
pub message: ::std::option::Option<::std::string::String>,
/// <p>Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.</p>
pub author: ::std::option::Option<crate::types::UserInfo>,
/// <p>Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.</p>
/// <p>For more information about the difference between an author and a committer in Git, see <a href="http://git-scm.com/book/ch2-3.html">Viewing the Commit History</a> in Pro Git by Scott Chacon and Ben Straub.</p>
pub committer: ::std::option::Option<crate::types::UserInfo>,
/// <p>Any other data associated with the specified commit.</p>
pub additional_data: ::std::option::Option<::std::string::String>,
}
impl Commit {
/// <p>The full SHA ID of the specified commit.</p>
pub fn commit_id(&self) -> ::std::option::Option<&str> {
self.commit_id.as_deref()
}
/// <p>Tree information for the specified commit.</p>
pub fn tree_id(&self) -> ::std::option::Option<&str> {
self.tree_id.as_deref()
}
/// <p>A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parents.is_none()`.
pub fn parents(&self) -> &[::std::string::String] {
self.parents.as_deref().unwrap_or_default()
}
/// <p>The commit message associated with the specified commit.</p>
pub fn message(&self) -> ::std::option::Option<&str> {
self.message.as_deref()
}
/// <p>Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.</p>
pub fn author(&self) -> ::std::option::Option<&crate::types::UserInfo> {
self.author.as_ref()
}
/// <p>Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.</p>
/// <p>For more information about the difference between an author and a committer in Git, see <a href="http://git-scm.com/book/ch2-3.html">Viewing the Commit History</a> in Pro Git by Scott Chacon and Ben Straub.</p>
pub fn committer(&self) -> ::std::option::Option<&crate::types::UserInfo> {
self.committer.as_ref()
}
/// <p>Any other data associated with the specified commit.</p>
pub fn additional_data(&self) -> ::std::option::Option<&str> {
self.additional_data.as_deref()
}
}
impl Commit {
/// Creates a new builder-style object to manufacture [`Commit`](crate::types::Commit).
pub fn builder() -> crate::types::builders::CommitBuilder {
crate::types::builders::CommitBuilder::default()
}
}
/// A builder for [`Commit`](crate::types::Commit).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CommitBuilder {
pub(crate) commit_id: ::std::option::Option<::std::string::String>,
pub(crate) tree_id: ::std::option::Option<::std::string::String>,
pub(crate) parents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) message: ::std::option::Option<::std::string::String>,
pub(crate) author: ::std::option::Option<crate::types::UserInfo>,
pub(crate) committer: ::std::option::Option<crate::types::UserInfo>,
pub(crate) additional_data: ::std::option::Option<::std::string::String>,
}
impl CommitBuilder {
/// <p>The full SHA ID of the specified commit.</p>
pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.commit_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The full SHA ID of the specified commit.</p>
pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.commit_id = input;
self
}
/// <p>The full SHA ID of the specified commit.</p>
pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
&self.commit_id
}
/// <p>Tree information for the specified commit.</p>
pub fn tree_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.tree_id = ::std::option::Option::Some(input.into());
self
}
/// <p>Tree information for the specified commit.</p>
pub fn set_tree_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.tree_id = input;
self
}
/// <p>Tree information for the specified commit.</p>
pub fn get_tree_id(&self) -> &::std::option::Option<::std::string::String> {
&self.tree_id
}
/// Appends an item to `parents`.
///
/// To override the contents of this collection use [`set_parents`](Self::set_parents).
///
/// <p>A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.</p>
pub fn parents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.parents.unwrap_or_default();
v.push(input.into());
self.parents = ::std::option::Option::Some(v);
self
}
/// <p>A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.</p>
pub fn set_parents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.parents = input;
self
}
/// <p>A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.</p>
pub fn get_parents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.parents
}
/// <p>The commit message associated with the specified commit.</p>
pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.message = ::std::option::Option::Some(input.into());
self
}
/// <p>The commit message associated with the specified commit.</p>
pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.message = input;
self
}
/// <p>The commit message associated with the specified commit.</p>
pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
&self.message
}
/// <p>Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.</p>
pub fn author(mut self, input: crate::types::UserInfo) -> Self {
self.author = ::std::option::Option::Some(input);
self
}
/// <p>Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.</p>
pub fn set_author(mut self, input: ::std::option::Option<crate::types::UserInfo>) -> Self {
self.author = input;
self
}
/// <p>Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.</p>
pub fn get_author(&self) -> &::std::option::Option<crate::types::UserInfo> {
&self.author
}
/// <p>Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.</p>
/// <p>For more information about the difference between an author and a committer in Git, see <a href="http://git-scm.com/book/ch2-3.html">Viewing the Commit History</a> in Pro Git by Scott Chacon and Ben Straub.</p>
pub fn committer(mut self, input: crate::types::UserInfo) -> Self {
self.committer = ::std::option::Option::Some(input);
self
}
/// <p>Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.</p>
/// <p>For more information about the difference between an author and a committer in Git, see <a href="http://git-scm.com/book/ch2-3.html">Viewing the Commit History</a> in Pro Git by Scott Chacon and Ben Straub.</p>
pub fn set_committer(mut self, input: ::std::option::Option<crate::types::UserInfo>) -> Self {
self.committer = input;
self
}
/// <p>Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.</p>
/// <p>For more information about the difference between an author and a committer in Git, see <a href="http://git-scm.com/book/ch2-3.html">Viewing the Commit History</a> in Pro Git by Scott Chacon and Ben Straub.</p>
pub fn get_committer(&self) -> &::std::option::Option<crate::types::UserInfo> {
&self.committer
}
/// <p>Any other data associated with the specified commit.</p>
pub fn additional_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.additional_data = ::std::option::Option::Some(input.into());
self
}
/// <p>Any other data associated with the specified commit.</p>
pub fn set_additional_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.additional_data = input;
self
}
/// <p>Any other data associated with the specified commit.</p>
pub fn get_additional_data(&self) -> &::std::option::Option<::std::string::String> {
&self.additional_data
}
/// Consumes the builder and constructs a [`Commit`](crate::types::Commit).
pub fn build(self) -> crate::types::Commit {
crate::types::Commit {
commit_id: self.commit_id,
tree_id: self.tree_id,
parents: self.parents,
message: self.message,
author: self.author,
committer: self.committer,
additional_data: self.additional_data,
}
}
}