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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateDataSourceInput {
/// <p>The Amazon Web Services account ID.</p>
pub aws_account_id: ::std::option::Option<::std::string::String>,
/// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub data_source_id: ::std::option::Option<::std::string::String>,
/// <p>A display name for the data source.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
/// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
pub r#type: ::std::option::Option<crate::types::DataSourceType>,
/// <p>The parameters that Amazon Quick Sight uses to connect to your underlying source.</p>
pub data_source_parameters: ::std::option::Option<crate::types::DataSourceParameters>,
/// <p>The credentials Amazon Quick Sight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
pub credentials: ::std::option::Option<crate::types::DataSourceCredentials>,
/// <p>A list of resource permissions on the data source.</p>
pub permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
/// <p>Use this parameter only when you want Amazon Quick Sight to use a VPC connection when connecting to your underlying source.</p>
pub vpc_connection_properties: ::std::option::Option<crate::types::VpcConnectionProperties>,
/// <p>Secure Socket Layer (SSL) properties that apply when Amazon Quick Sight connects to your underlying source.</p>
pub ssl_properties: ::std::option::Option<crate::types::SslProperties>,
/// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <p>When you create the data source, Amazon Quick Sight adds the data source to these folders.</p>
pub folder_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateDataSourceInput {
/// <p>The Amazon Web Services account ID.</p>
pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
self.aws_account_id.as_deref()
}
/// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub fn data_source_id(&self) -> ::std::option::Option<&str> {
self.data_source_id.as_deref()
}
/// <p>A display name for the data source.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
/// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::DataSourceType> {
self.r#type.as_ref()
}
/// <p>The parameters that Amazon Quick Sight uses to connect to your underlying source.</p>
pub fn data_source_parameters(&self) -> ::std::option::Option<&crate::types::DataSourceParameters> {
self.data_source_parameters.as_ref()
}
/// <p>The credentials Amazon Quick Sight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
pub fn credentials(&self) -> ::std::option::Option<&crate::types::DataSourceCredentials> {
self.credentials.as_ref()
}
/// <p>A list of resource permissions on the data source.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.permissions.is_none()`.
pub fn permissions(&self) -> &[crate::types::ResourcePermission] {
self.permissions.as_deref().unwrap_or_default()
}
/// <p>Use this parameter only when you want Amazon Quick Sight to use a VPC connection when connecting to your underlying source.</p>
pub fn vpc_connection_properties(&self) -> ::std::option::Option<&crate::types::VpcConnectionProperties> {
self.vpc_connection_properties.as_ref()
}
/// <p>Secure Socket Layer (SSL) properties that apply when Amazon Quick Sight connects to your underlying source.</p>
pub fn ssl_properties(&self) -> ::std::option::Option<&crate::types::SslProperties> {
self.ssl_properties.as_ref()
}
/// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
/// <p>When you create the data source, Amazon Quick Sight adds the data source to these folders.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.folder_arns.is_none()`.
pub fn folder_arns(&self) -> &[::std::string::String] {
self.folder_arns.as_deref().unwrap_or_default()
}
}
impl ::std::fmt::Debug for CreateDataSourceInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateDataSourceInput");
formatter.field("aws_account_id", &self.aws_account_id);
formatter.field("data_source_id", &self.data_source_id);
formatter.field("name", &self.name);
formatter.field("r#type", &self.r#type);
formatter.field("data_source_parameters", &self.data_source_parameters);
formatter.field("credentials", &"*** Sensitive Data Redacted ***");
formatter.field("permissions", &self.permissions);
formatter.field("vpc_connection_properties", &self.vpc_connection_properties);
formatter.field("ssl_properties", &self.ssl_properties);
formatter.field("tags", &self.tags);
formatter.field("folder_arns", &self.folder_arns);
formatter.finish()
}
}
impl CreateDataSourceInput {
/// Creates a new builder-style object to manufacture [`CreateDataSourceInput`](crate::operation::create_data_source::CreateDataSourceInput).
pub fn builder() -> crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
crate::operation::create_data_source::builders::CreateDataSourceInputBuilder::default()
}
}
/// A builder for [`CreateDataSourceInput`](crate::operation::create_data_source::CreateDataSourceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateDataSourceInputBuilder {
pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
pub(crate) data_source_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::DataSourceType>,
pub(crate) data_source_parameters: ::std::option::Option<crate::types::DataSourceParameters>,
pub(crate) credentials: ::std::option::Option<crate::types::DataSourceCredentials>,
pub(crate) permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
pub(crate) vpc_connection_properties: ::std::option::Option<crate::types::VpcConnectionProperties>,
pub(crate) ssl_properties: ::std::option::Option<crate::types::SslProperties>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) folder_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateDataSourceInputBuilder {
/// <p>The Amazon Web Services account ID.</p>
/// This field is required.
pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.aws_account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services account ID.</p>
pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.aws_account_id = input;
self
}
/// <p>The Amazon Web Services account ID.</p>
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_account_id
}
/// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
/// This field is required.
pub fn data_source_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.data_source_id = ::std::option::Option::Some(input.into());
self
}
/// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub fn set_data_source_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.data_source_id = input;
self
}
/// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub fn get_data_source_id(&self) -> &::std::option::Option<::std::string::String> {
&self.data_source_id
}
/// <p>A display name for the data source.</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>A display name for the data source.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>A display name for the data source.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
/// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
/// This field is required.
pub fn r#type(mut self, input: crate::types::DataSourceType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
/// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::DataSourceType>) -> Self {
self.r#type = input;
self
}
/// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
/// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::DataSourceType> {
&self.r#type
}
/// <p>The parameters that Amazon Quick Sight uses to connect to your underlying source.</p>
pub fn data_source_parameters(mut self, input: crate::types::DataSourceParameters) -> Self {
self.data_source_parameters = ::std::option::Option::Some(input);
self
}
/// <p>The parameters that Amazon Quick Sight uses to connect to your underlying source.</p>
pub fn set_data_source_parameters(mut self, input: ::std::option::Option<crate::types::DataSourceParameters>) -> Self {
self.data_source_parameters = input;
self
}
/// <p>The parameters that Amazon Quick Sight uses to connect to your underlying source.</p>
pub fn get_data_source_parameters(&self) -> &::std::option::Option<crate::types::DataSourceParameters> {
&self.data_source_parameters
}
/// <p>The credentials Amazon Quick Sight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
pub fn credentials(mut self, input: crate::types::DataSourceCredentials) -> Self {
self.credentials = ::std::option::Option::Some(input);
self
}
/// <p>The credentials Amazon Quick Sight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::DataSourceCredentials>) -> Self {
self.credentials = input;
self
}
/// <p>The credentials Amazon Quick Sight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
pub fn get_credentials(&self) -> &::std::option::Option<crate::types::DataSourceCredentials> {
&self.credentials
}
/// Appends an item to `permissions`.
///
/// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
///
/// <p>A list of resource permissions on the data source.</p>
pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
let mut v = self.permissions.unwrap_or_default();
v.push(input);
self.permissions = ::std::option::Option::Some(v);
self
}
/// <p>A list of resource permissions on the data source.</p>
pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
self.permissions = input;
self
}
/// <p>A list of resource permissions on the data source.</p>
pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
&self.permissions
}
/// <p>Use this parameter only when you want Amazon Quick Sight to use a VPC connection when connecting to your underlying source.</p>
pub fn vpc_connection_properties(mut self, input: crate::types::VpcConnectionProperties) -> Self {
self.vpc_connection_properties = ::std::option::Option::Some(input);
self
}
/// <p>Use this parameter only when you want Amazon Quick Sight to use a VPC connection when connecting to your underlying source.</p>
pub fn set_vpc_connection_properties(mut self, input: ::std::option::Option<crate::types::VpcConnectionProperties>) -> Self {
self.vpc_connection_properties = input;
self
}
/// <p>Use this parameter only when you want Amazon Quick Sight to use a VPC connection when connecting to your underlying source.</p>
pub fn get_vpc_connection_properties(&self) -> &::std::option::Option<crate::types::VpcConnectionProperties> {
&self.vpc_connection_properties
}
/// <p>Secure Socket Layer (SSL) properties that apply when Amazon Quick Sight connects to your underlying source.</p>
pub fn ssl_properties(mut self, input: crate::types::SslProperties) -> Self {
self.ssl_properties = ::std::option::Option::Some(input);
self
}
/// <p>Secure Socket Layer (SSL) properties that apply when Amazon Quick Sight connects to your underlying source.</p>
pub fn set_ssl_properties(mut self, input: ::std::option::Option<crate::types::SslProperties>) -> Self {
self.ssl_properties = input;
self
}
/// <p>Secure Socket Layer (SSL) properties that apply when Amazon Quick Sight connects to your underlying source.</p>
pub fn get_ssl_properties(&self) -> &::std::option::Option<crate::types::SslProperties> {
&self.ssl_properties
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Appends an item to `folder_arns`.
///
/// To override the contents of this collection use [`set_folder_arns`](Self::set_folder_arns).
///
/// <p>When you create the data source, Amazon Quick Sight adds the data source to these folders.</p>
pub fn folder_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.folder_arns.unwrap_or_default();
v.push(input.into());
self.folder_arns = ::std::option::Option::Some(v);
self
}
/// <p>When you create the data source, Amazon Quick Sight adds the data source to these folders.</p>
pub fn set_folder_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.folder_arns = input;
self
}
/// <p>When you create the data source, Amazon Quick Sight adds the data source to these folders.</p>
pub fn get_folder_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.folder_arns
}
/// Consumes the builder and constructs a [`CreateDataSourceInput`](crate::operation::create_data_source::CreateDataSourceInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_data_source::CreateDataSourceInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_data_source::CreateDataSourceInput {
aws_account_id: self.aws_account_id,
data_source_id: self.data_source_id,
name: self.name,
r#type: self.r#type,
data_source_parameters: self.data_source_parameters,
credentials: self.credentials,
permissions: self.permissions,
vpc_connection_properties: self.vpc_connection_properties,
ssl_properties: self.ssl_properties,
tags: self.tags,
folder_arns: self.folder_arns,
})
}
}
impl ::std::fmt::Debug for CreateDataSourceInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateDataSourceInputBuilder");
formatter.field("aws_account_id", &self.aws_account_id);
formatter.field("data_source_id", &self.data_source_id);
formatter.field("name", &self.name);
formatter.field("r#type", &self.r#type);
formatter.field("data_source_parameters", &self.data_source_parameters);
formatter.field("credentials", &"*** Sensitive Data Redacted ***");
formatter.field("permissions", &self.permissions);
formatter.field("vpc_connection_properties", &self.vpc_connection_properties);
formatter.field("ssl_properties", &self.ssl_properties);
formatter.field("tags", &self.tags);
formatter.field("folder_arns", &self.folder_arns);
formatter.finish()
}
}