aws_sdk_codecommit/operation/get_commit/
_get_commit_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a get commit operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetCommitInput {
7    /// <p>The name of the repository to which the commit was made.</p>
8    pub repository_name: ::std::option::Option<::std::string::String>,
9    /// <p>The commit ID. Commit IDs are the full SHA ID of the commit.</p>
10    pub commit_id: ::std::option::Option<::std::string::String>,
11}
12impl GetCommitInput {
13    /// <p>The name of the repository to which the commit was made.</p>
14    pub fn repository_name(&self) -> ::std::option::Option<&str> {
15        self.repository_name.as_deref()
16    }
17    /// <p>The commit ID. Commit IDs are the full SHA ID of the commit.</p>
18    pub fn commit_id(&self) -> ::std::option::Option<&str> {
19        self.commit_id.as_deref()
20    }
21}
22impl GetCommitInput {
23    /// Creates a new builder-style object to manufacture [`GetCommitInput`](crate::operation::get_commit::GetCommitInput).
24    pub fn builder() -> crate::operation::get_commit::builders::GetCommitInputBuilder {
25        crate::operation::get_commit::builders::GetCommitInputBuilder::default()
26    }
27}
28
29/// A builder for [`GetCommitInput`](crate::operation::get_commit::GetCommitInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetCommitInputBuilder {
33    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
34    pub(crate) commit_id: ::std::option::Option<::std::string::String>,
35}
36impl GetCommitInputBuilder {
37    /// <p>The name of the repository to which the commit was made.</p>
38    /// This field is required.
39    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.repository_name = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The name of the repository to which the commit was made.</p>
44    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.repository_name = input;
46        self
47    }
48    /// <p>The name of the repository to which the commit was made.</p>
49    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
50        &self.repository_name
51    }
52    /// <p>The commit ID. Commit IDs are the full SHA ID of the commit.</p>
53    /// This field is required.
54    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.commit_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The commit ID. Commit IDs are the full SHA ID of the commit.</p>
59    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.commit_id = input;
61        self
62    }
63    /// <p>The commit ID. Commit IDs are the full SHA ID of the commit.</p>
64    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.commit_id
66    }
67    /// Consumes the builder and constructs a [`GetCommitInput`](crate::operation::get_commit::GetCommitInput).
68    pub fn build(self) -> ::std::result::Result<crate::operation::get_commit::GetCommitInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::get_commit::GetCommitInput {
70            repository_name: self.repository_name,
71            commit_id: self.commit_id,
72        })
73    }
74}