aws_sdk_codecommit/operation/get_branch/
_get_branch_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 branch operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetBranchInput {
7    /// <p>The name of the repository that contains the branch for which you want to retrieve information.</p>
8    pub repository_name: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the branch for which you want to retrieve information.</p>
10    pub branch_name: ::std::option::Option<::std::string::String>,
11}
12impl GetBranchInput {
13    /// <p>The name of the repository that contains the branch for which you want to retrieve information.</p>
14    pub fn repository_name(&self) -> ::std::option::Option<&str> {
15        self.repository_name.as_deref()
16    }
17    /// <p>The name of the branch for which you want to retrieve information.</p>
18    pub fn branch_name(&self) -> ::std::option::Option<&str> {
19        self.branch_name.as_deref()
20    }
21}
22impl GetBranchInput {
23    /// Creates a new builder-style object to manufacture [`GetBranchInput`](crate::operation::get_branch::GetBranchInput).
24    pub fn builder() -> crate::operation::get_branch::builders::GetBranchInputBuilder {
25        crate::operation::get_branch::builders::GetBranchInputBuilder::default()
26    }
27}
28
29/// A builder for [`GetBranchInput`](crate::operation::get_branch::GetBranchInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetBranchInputBuilder {
33    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
34    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
35}
36impl GetBranchInputBuilder {
37    /// <p>The name of the repository that contains the branch for which you want to retrieve information.</p>
38    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.repository_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The name of the repository that contains the branch for which you want to retrieve information.</p>
43    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.repository_name = input;
45        self
46    }
47    /// <p>The name of the repository that contains the branch for which you want to retrieve information.</p>
48    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.repository_name
50    }
51    /// <p>The name of the branch for which you want to retrieve information.</p>
52    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.branch_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the branch for which you want to retrieve information.</p>
57    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.branch_name = input;
59        self
60    }
61    /// <p>The name of the branch for which you want to retrieve information.</p>
62    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.branch_name
64    }
65    /// Consumes the builder and constructs a [`GetBranchInput`](crate::operation::get_branch::GetBranchInput).
66    pub fn build(self) -> ::std::result::Result<crate::operation::get_branch::GetBranchInput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::get_branch::GetBranchInput {
68            repository_name: self.repository_name,
69            branch_name: self.branch_name,
70        })
71    }
72}