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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Detail input data for a linked repository branch.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RepositoryBranchInput {
    /// <p>The repository provider.</p>
    pub provider: crate::types::RepositoryProvider,
    /// <p>The repository name.</p>
    pub name: ::std::string::String,
    /// <p>The repository branch.</p>
    pub branch: ::std::string::String,
}
impl RepositoryBranchInput {
    /// <p>The repository provider.</p>
    pub fn provider(&self) -> &crate::types::RepositoryProvider {
        &self.provider
    }
    /// <p>The repository name.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The repository branch.</p>
    pub fn branch(&self) -> &str {
        use std::ops::Deref;
        self.branch.deref()
    }
}
impl RepositoryBranchInput {
    /// Creates a new builder-style object to manufacture [`RepositoryBranchInput`](crate::types::RepositoryBranchInput).
    pub fn builder() -> crate::types::builders::RepositoryBranchInputBuilder {
        crate::types::builders::RepositoryBranchInputBuilder::default()
    }
}

/// A builder for [`RepositoryBranchInput`](crate::types::RepositoryBranchInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RepositoryBranchInputBuilder {
    pub(crate) provider: ::std::option::Option<crate::types::RepositoryProvider>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) branch: ::std::option::Option<::std::string::String>,
}
impl RepositoryBranchInputBuilder {
    /// <p>The repository provider.</p>
    /// This field is required.
    pub fn provider(mut self, input: crate::types::RepositoryProvider) -> Self {
        self.provider = ::std::option::Option::Some(input);
        self
    }
    /// <p>The repository provider.</p>
    pub fn set_provider(mut self, input: ::std::option::Option<crate::types::RepositoryProvider>) -> Self {
        self.provider = input;
        self
    }
    /// <p>The repository provider.</p>
    pub fn get_provider(&self) -> &::std::option::Option<crate::types::RepositoryProvider> {
        &self.provider
    }
    /// <p>The repository name.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The repository name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The repository name.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The repository branch.</p>
    /// This field is required.
    pub fn branch(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.branch = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The repository branch.</p>
    pub fn set_branch(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.branch = input;
        self
    }
    /// <p>The repository branch.</p>
    pub fn get_branch(&self) -> &::std::option::Option<::std::string::String> {
        &self.branch
    }
    /// Consumes the builder and constructs a [`RepositoryBranchInput`](crate::types::RepositoryBranchInput).
    /// This method will fail if any of the following fields are not set:
    /// - [`provider`](crate::types::builders::RepositoryBranchInputBuilder::provider)
    /// - [`name`](crate::types::builders::RepositoryBranchInputBuilder::name)
    /// - [`branch`](crate::types::builders::RepositoryBranchInputBuilder::branch)
    pub fn build(self) -> ::std::result::Result<crate::types::RepositoryBranchInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::RepositoryBranchInput {
            provider: self.provider.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "provider",
                    "provider was not specified but it is required when building RepositoryBranchInput",
                )
            })?,
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building RepositoryBranchInput",
                )
            })?,
            branch: self.branch.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "branch",
                    "branch was not specified but it is required when building RepositoryBranchInput",
                )
            })?,
        })
    }
}