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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A resource that is used to connect third-party source providers with services like CodePipeline.</p>
/// <p>Note: A connection created through CloudFormation, the CLI, or the SDK is in `PENDING` status by default. You can make its status `AVAILABLE` by updating the connection in the console.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Connection {
/// <p>The name of the connection. Connection names must be unique in an Amazon Web Services account.</p>
pub connection_name: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services.</p><note>
/// <p>The ARN is never reused if the connection is deleted.</p>
/// </note>
pub connection_arn: ::std::option::Option<::std::string::String>,
/// <p>The name of the external provider where your third-party code repository is configured.</p>
pub provider_type: ::std::option::Option<crate::types::ProviderType>,
/// <p>The identifier of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.</p>
pub owner_account_id: ::std::option::Option<::std::string::String>,
/// <p>The current status of the connection.</p>
pub connection_status: ::std::option::Option<crate::types::ConnectionStatus>,
/// <p>The Amazon Resource Name (ARN) of the host associated with the connection.</p>
pub host_arn: ::std::option::Option<::std::string::String>,
}
impl Connection {
/// <p>The name of the connection. Connection names must be unique in an Amazon Web Services account.</p>
pub fn connection_name(&self) -> ::std::option::Option<&str> {
self.connection_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services.</p><note>
/// <p>The ARN is never reused if the connection is deleted.</p>
/// </note>
pub fn connection_arn(&self) -> ::std::option::Option<&str> {
self.connection_arn.as_deref()
}
/// <p>The name of the external provider where your third-party code repository is configured.</p>
pub fn provider_type(&self) -> ::std::option::Option<&crate::types::ProviderType> {
self.provider_type.as_ref()
}
/// <p>The identifier of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.</p>
pub fn owner_account_id(&self) -> ::std::option::Option<&str> {
self.owner_account_id.as_deref()
}
/// <p>The current status of the connection.</p>
pub fn connection_status(&self) -> ::std::option::Option<&crate::types::ConnectionStatus> {
self.connection_status.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the host associated with the connection.</p>
pub fn host_arn(&self) -> ::std::option::Option<&str> {
self.host_arn.as_deref()
}
}
impl Connection {
/// Creates a new builder-style object to manufacture [`Connection`](crate::types::Connection).
pub fn builder() -> crate::types::builders::ConnectionBuilder {
crate::types::builders::ConnectionBuilder::default()
}
}
/// A builder for [`Connection`](crate::types::Connection).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ConnectionBuilder {
pub(crate) connection_name: ::std::option::Option<::std::string::String>,
pub(crate) connection_arn: ::std::option::Option<::std::string::String>,
pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
pub(crate) owner_account_id: ::std::option::Option<::std::string::String>,
pub(crate) connection_status: ::std::option::Option<crate::types::ConnectionStatus>,
pub(crate) host_arn: ::std::option::Option<::std::string::String>,
}
impl ConnectionBuilder {
/// <p>The name of the connection. Connection names must be unique in an Amazon Web Services account.</p>
pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.connection_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the connection. Connection names must be unique in an Amazon Web Services account.</p>
pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.connection_name = input;
self
}
/// <p>The name of the connection. Connection names must be unique in an Amazon Web Services account.</p>
pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
&self.connection_name
}
/// <p>The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services.</p><note>
/// <p>The ARN is never reused if the connection is deleted.</p>
/// </note>
pub fn connection_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.connection_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services.</p><note>
/// <p>The ARN is never reused if the connection is deleted.</p>
/// </note>
pub fn set_connection_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.connection_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services.</p><note>
/// <p>The ARN is never reused if the connection is deleted.</p>
/// </note>
pub fn get_connection_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.connection_arn
}
/// <p>The name of the external provider where your third-party code repository is configured.</p>
pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
self.provider_type = ::std::option::Option::Some(input);
self
}
/// <p>The name of the external provider where your third-party code repository is configured.</p>
pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
self.provider_type = input;
self
}
/// <p>The name of the external provider where your third-party code repository is configured.</p>
pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
&self.provider_type
}
/// <p>The identifier of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.</p>
pub fn owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner_account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.</p>
pub fn set_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner_account_id = input;
self
}
/// <p>The identifier of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.</p>
pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.owner_account_id
}
/// <p>The current status of the connection.</p>
pub fn connection_status(mut self, input: crate::types::ConnectionStatus) -> Self {
self.connection_status = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the connection.</p>
pub fn set_connection_status(mut self, input: ::std::option::Option<crate::types::ConnectionStatus>) -> Self {
self.connection_status = input;
self
}
/// <p>The current status of the connection.</p>
pub fn get_connection_status(&self) -> &::std::option::Option<crate::types::ConnectionStatus> {
&self.connection_status
}
/// <p>The Amazon Resource Name (ARN) of the host associated with the connection.</p>
pub fn host_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.host_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the host associated with the connection.</p>
pub fn set_host_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.host_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the host associated with the connection.</p>
pub fn get_host_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.host_arn
}
/// Consumes the builder and constructs a [`Connection`](crate::types::Connection).
pub fn build(self) -> crate::types::Connection {
crate::types::Connection {
connection_name: self.connection_name,
connection_arn: self.connection_arn,
provider_type: self.provider_type,
owner_account_id: self.owner_account_id,
connection_status: self.connection_status,
host_arn: self.host_arn,
}
}
}