aws_sdk_eventbridge/operation/create_connection/_create_connection_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateConnectionInput {
6 /// <p>The name for the connection to create.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>A description for the connection to create.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>The type of authorization to use for the connection.</p><note>
11 /// <p>OAUTH tokens are refreshed when a 401 or 407 response is returned.</p>
12 /// </note>
13 pub authorization_type: ::std::option::Option<crate::types::ConnectionAuthorizationType>,
14 /// <p>The authorization parameters to use to authorize with the endpoint.</p>
15 /// <p>You must include only authorization parameters for the <code>AuthorizationType</code> you specify.</p>
16 pub auth_parameters: ::std::option::Option<crate::types::CreateConnectionAuthRequestParameters>,
17 /// <p>For connections to private APIs, the parameters to use for invoking the API.</p>
18 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/connection-private.html">Connecting to private APIs</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
19 pub invocation_connectivity_parameters: ::std::option::Option<crate::types::ConnectivityResourceParameters>,
20 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this connection. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
21 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the connection.</p>
22 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
23 pub kms_key_identifier: ::std::option::Option<::std::string::String>,
24}
25impl CreateConnectionInput {
26 /// <p>The name for the connection to create.</p>
27 pub fn name(&self) -> ::std::option::Option<&str> {
28 self.name.as_deref()
29 }
30 /// <p>A description for the connection to create.</p>
31 pub fn description(&self) -> ::std::option::Option<&str> {
32 self.description.as_deref()
33 }
34 /// <p>The type of authorization to use for the connection.</p><note>
35 /// <p>OAUTH tokens are refreshed when a 401 or 407 response is returned.</p>
36 /// </note>
37 pub fn authorization_type(&self) -> ::std::option::Option<&crate::types::ConnectionAuthorizationType> {
38 self.authorization_type.as_ref()
39 }
40 /// <p>The authorization parameters to use to authorize with the endpoint.</p>
41 /// <p>You must include only authorization parameters for the <code>AuthorizationType</code> you specify.</p>
42 pub fn auth_parameters(&self) -> ::std::option::Option<&crate::types::CreateConnectionAuthRequestParameters> {
43 self.auth_parameters.as_ref()
44 }
45 /// <p>For connections to private APIs, the parameters to use for invoking the API.</p>
46 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/connection-private.html">Connecting to private APIs</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
47 pub fn invocation_connectivity_parameters(&self) -> ::std::option::Option<&crate::types::ConnectivityResourceParameters> {
48 self.invocation_connectivity_parameters.as_ref()
49 }
50 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this connection. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
51 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the connection.</p>
52 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
53 pub fn kms_key_identifier(&self) -> ::std::option::Option<&str> {
54 self.kms_key_identifier.as_deref()
55 }
56}
57impl CreateConnectionInput {
58 /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
59 pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
60 crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
61 }
62}
63
64/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateConnectionInputBuilder {
68 pub(crate) name: ::std::option::Option<::std::string::String>,
69 pub(crate) description: ::std::option::Option<::std::string::String>,
70 pub(crate) authorization_type: ::std::option::Option<crate::types::ConnectionAuthorizationType>,
71 pub(crate) auth_parameters: ::std::option::Option<crate::types::CreateConnectionAuthRequestParameters>,
72 pub(crate) invocation_connectivity_parameters: ::std::option::Option<crate::types::ConnectivityResourceParameters>,
73 pub(crate) kms_key_identifier: ::std::option::Option<::std::string::String>,
74}
75impl CreateConnectionInputBuilder {
76 /// <p>The name for the connection to create.</p>
77 /// This field is required.
78 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.name = ::std::option::Option::Some(input.into());
80 self
81 }
82 /// <p>The name for the connection to create.</p>
83 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.name = input;
85 self
86 }
87 /// <p>The name for the connection to create.</p>
88 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
89 &self.name
90 }
91 /// <p>A description for the connection to create.</p>
92 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93 self.description = ::std::option::Option::Some(input.into());
94 self
95 }
96 /// <p>A description for the connection to create.</p>
97 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98 self.description = input;
99 self
100 }
101 /// <p>A description for the connection to create.</p>
102 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
103 &self.description
104 }
105 /// <p>The type of authorization to use for the connection.</p><note>
106 /// <p>OAUTH tokens are refreshed when a 401 or 407 response is returned.</p>
107 /// </note>
108 /// This field is required.
109 pub fn authorization_type(mut self, input: crate::types::ConnectionAuthorizationType) -> Self {
110 self.authorization_type = ::std::option::Option::Some(input);
111 self
112 }
113 /// <p>The type of authorization to use for the connection.</p><note>
114 /// <p>OAUTH tokens are refreshed when a 401 or 407 response is returned.</p>
115 /// </note>
116 pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::ConnectionAuthorizationType>) -> Self {
117 self.authorization_type = input;
118 self
119 }
120 /// <p>The type of authorization to use for the connection.</p><note>
121 /// <p>OAUTH tokens are refreshed when a 401 or 407 response is returned.</p>
122 /// </note>
123 pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::ConnectionAuthorizationType> {
124 &self.authorization_type
125 }
126 /// <p>The authorization parameters to use to authorize with the endpoint.</p>
127 /// <p>You must include only authorization parameters for the <code>AuthorizationType</code> you specify.</p>
128 /// This field is required.
129 pub fn auth_parameters(mut self, input: crate::types::CreateConnectionAuthRequestParameters) -> Self {
130 self.auth_parameters = ::std::option::Option::Some(input);
131 self
132 }
133 /// <p>The authorization parameters to use to authorize with the endpoint.</p>
134 /// <p>You must include only authorization parameters for the <code>AuthorizationType</code> you specify.</p>
135 pub fn set_auth_parameters(mut self, input: ::std::option::Option<crate::types::CreateConnectionAuthRequestParameters>) -> Self {
136 self.auth_parameters = input;
137 self
138 }
139 /// <p>The authorization parameters to use to authorize with the endpoint.</p>
140 /// <p>You must include only authorization parameters for the <code>AuthorizationType</code> you specify.</p>
141 pub fn get_auth_parameters(&self) -> &::std::option::Option<crate::types::CreateConnectionAuthRequestParameters> {
142 &self.auth_parameters
143 }
144 /// <p>For connections to private APIs, the parameters to use for invoking the API.</p>
145 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/connection-private.html">Connecting to private APIs</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
146 pub fn invocation_connectivity_parameters(mut self, input: crate::types::ConnectivityResourceParameters) -> Self {
147 self.invocation_connectivity_parameters = ::std::option::Option::Some(input);
148 self
149 }
150 /// <p>For connections to private APIs, the parameters to use for invoking the API.</p>
151 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/connection-private.html">Connecting to private APIs</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
152 pub fn set_invocation_connectivity_parameters(mut self, input: ::std::option::Option<crate::types::ConnectivityResourceParameters>) -> Self {
153 self.invocation_connectivity_parameters = input;
154 self
155 }
156 /// <p>For connections to private APIs, the parameters to use for invoking the API.</p>
157 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/connection-private.html">Connecting to private APIs</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
158 pub fn get_invocation_connectivity_parameters(&self) -> &::std::option::Option<crate::types::ConnectivityResourceParameters> {
159 &self.invocation_connectivity_parameters
160 }
161 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this connection. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
162 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the connection.</p>
163 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
164 pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165 self.kms_key_identifier = ::std::option::Option::Some(input.into());
166 self
167 }
168 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this connection. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
169 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the connection.</p>
170 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
171 pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.kms_key_identifier = input;
173 self
174 }
175 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this connection. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
176 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the connection.</p>
177 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
178 pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
179 &self.kms_key_identifier
180 }
181 /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
182 pub fn build(
183 self,
184 ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
185 ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
186 name: self.name,
187 description: self.description,
188 authorization_type: self.authorization_type,
189 auth_parameters: self.auth_parameters,
190 invocation_connectivity_parameters: self.invocation_connectivity_parameters,
191 kms_key_identifier: self.kms_key_identifier,
192 })
193 }
194}