aws_sdk_amplify/operation/get_branch/
_get_branch_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request structure for the get branch request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetBranchInput {
7    /// <p>The unique ID for an Amplify app.</p>
8    pub app_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the branch.</p>
10    pub branch_name: ::std::option::Option<::std::string::String>,
11}
12impl GetBranchInput {
13    /// <p>The unique ID for an Amplify app.</p>
14    pub fn app_id(&self) -> ::std::option::Option<&str> {
15        self.app_id.as_deref()
16    }
17    /// <p>The name of the branch.</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) app_id: ::std::option::Option<::std::string::String>,
34    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
35}
36impl GetBranchInputBuilder {
37    /// <p>The unique ID for an Amplify app.</p>
38    /// This field is required.
39    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.app_id = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The unique ID for an Amplify app.</p>
44    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.app_id = input;
46        self
47    }
48    /// <p>The unique ID for an Amplify app.</p>
49    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
50        &self.app_id
51    }
52    /// <p>The name of the branch.</p>
53    /// This field is required.
54    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.branch_name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The name of the branch.</p>
59    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.branch_name = input;
61        self
62    }
63    /// <p>The name of the branch.</p>
64    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.branch_name
66    }
67    /// Consumes the builder and constructs a [`GetBranchInput`](crate::operation::get_branch::GetBranchInput).
68    pub fn build(self) -> ::std::result::Result<crate::operation::get_branch::GetBranchInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::get_branch::GetBranchInput {
70            app_id: self.app_id,
71            branch_name: self.branch_name,
72        })
73    }
74}