aws_sdk_quicksight/operation/create_data_source/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_data_source::_create_data_source_output::CreateDataSourceOutputBuilder;
3
4pub use crate::operation::create_data_source::_create_data_source_input::CreateDataSourceInputBuilder;
5
6impl crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_data_source::CreateDataSourceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_data_source::CreateDataSourceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_data_source();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDataSource`.
24///
25/// <p>Creates a data source.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDataSourceFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_data_source::builders::CreateDataSourceInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_data_source::CreateDataSourceOutput,
35        crate::operation::create_data_source::CreateDataSourceError,
36    > for CreateDataSourceFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_data_source::CreateDataSourceOutput,
44            crate::operation::create_data_source::CreateDataSourceError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDataSourceFluentBuilder {
51    /// Creates a new `CreateDataSourceFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateDataSource as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_data_source::builders::CreateDataSourceInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_data_source::CreateDataSourceOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_data_source::CreateDataSourceError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_data_source::CreateDataSource::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_data_source::CreateDataSource::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_data_source::CreateDataSourceOutput,
97        crate::operation::create_data_source::CreateDataSourceError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The Amazon Web Services account ID.</p>
112    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.aws_account_id(input.into());
114        self
115    }
116    /// <p>The Amazon Web Services account ID.</p>
117    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_aws_account_id(input);
119        self
120    }
121    /// <p>The Amazon Web Services account ID.</p>
122    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_aws_account_id()
124    }
125    /// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
126    pub fn data_source_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.data_source_id(input.into());
128        self
129    }
130    /// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
131    pub fn set_data_source_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_data_source_id(input);
133        self
134    }
135    /// <p>An ID for the data source. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
136    pub fn get_data_source_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_data_source_id()
138    }
139    /// <p>A display name for the data source.</p>
140    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.name(input.into());
142        self
143    }
144    /// <p>A display name for the data source.</p>
145    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_name(input);
147        self
148    }
149    /// <p>A display name for the data source.</p>
150    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_name()
152    }
153    /// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
154    /// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
155    pub fn r#type(mut self, input: crate::types::DataSourceType) -> Self {
156        self.inner = self.inner.r#type(input);
157        self
158    }
159    /// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
160    /// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
161    pub fn set_type(mut self, input: ::std::option::Option<crate::types::DataSourceType>) -> Self {
162        self.inner = self.inner.set_type(input);
163        self
164    }
165    /// <p>The type of the data source. To return a list of all data sources, use <code>ListDataSources</code>.</p>
166    /// <p>Use <code>AMAZON_ELASTICSEARCH</code> for Amazon OpenSearch Service.</p>
167    pub fn get_type(&self) -> &::std::option::Option<crate::types::DataSourceType> {
168        self.inner.get_type()
169    }
170    /// <p>The parameters that QuickSight uses to connect to your underlying source.</p>
171    pub fn data_source_parameters(mut self, input: crate::types::DataSourceParameters) -> Self {
172        self.inner = self.inner.data_source_parameters(input);
173        self
174    }
175    /// <p>The parameters that QuickSight uses to connect to your underlying source.</p>
176    pub fn set_data_source_parameters(mut self, input: ::std::option::Option<crate::types::DataSourceParameters>) -> Self {
177        self.inner = self.inner.set_data_source_parameters(input);
178        self
179    }
180    /// <p>The parameters that QuickSight uses to connect to your underlying source.</p>
181    pub fn get_data_source_parameters(&self) -> &::std::option::Option<crate::types::DataSourceParameters> {
182        self.inner.get_data_source_parameters()
183    }
184    /// <p>The credentials QuickSight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
185    pub fn credentials(mut self, input: crate::types::DataSourceCredentials) -> Self {
186        self.inner = self.inner.credentials(input);
187        self
188    }
189    /// <p>The credentials QuickSight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
190    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::DataSourceCredentials>) -> Self {
191        self.inner = self.inner.set_credentials(input);
192        self
193    }
194    /// <p>The credentials QuickSight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.</p>
195    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::DataSourceCredentials> {
196        self.inner.get_credentials()
197    }
198    ///
199    /// Appends an item to `Permissions`.
200    ///
201    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
202    ///
203    /// <p>A list of resource permissions on the data source.</p>
204    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
205        self.inner = self.inner.permissions(input);
206        self
207    }
208    /// <p>A list of resource permissions on the data source.</p>
209    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
210        self.inner = self.inner.set_permissions(input);
211        self
212    }
213    /// <p>A list of resource permissions on the data source.</p>
214    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
215        self.inner.get_permissions()
216    }
217    /// <p>Use this parameter only when you want QuickSight to use a VPC connection when connecting to your underlying source.</p>
218    pub fn vpc_connection_properties(mut self, input: crate::types::VpcConnectionProperties) -> Self {
219        self.inner = self.inner.vpc_connection_properties(input);
220        self
221    }
222    /// <p>Use this parameter only when you want QuickSight to use a VPC connection when connecting to your underlying source.</p>
223    pub fn set_vpc_connection_properties(mut self, input: ::std::option::Option<crate::types::VpcConnectionProperties>) -> Self {
224        self.inner = self.inner.set_vpc_connection_properties(input);
225        self
226    }
227    /// <p>Use this parameter only when you want QuickSight to use a VPC connection when connecting to your underlying source.</p>
228    pub fn get_vpc_connection_properties(&self) -> &::std::option::Option<crate::types::VpcConnectionProperties> {
229        self.inner.get_vpc_connection_properties()
230    }
231    /// <p>Secure Socket Layer (SSL) properties that apply when QuickSight connects to your underlying source.</p>
232    pub fn ssl_properties(mut self, input: crate::types::SslProperties) -> Self {
233        self.inner = self.inner.ssl_properties(input);
234        self
235    }
236    /// <p>Secure Socket Layer (SSL) properties that apply when QuickSight connects to your underlying source.</p>
237    pub fn set_ssl_properties(mut self, input: ::std::option::Option<crate::types::SslProperties>) -> Self {
238        self.inner = self.inner.set_ssl_properties(input);
239        self
240    }
241    /// <p>Secure Socket Layer (SSL) properties that apply when QuickSight connects to your underlying source.</p>
242    pub fn get_ssl_properties(&self) -> &::std::option::Option<crate::types::SslProperties> {
243        self.inner.get_ssl_properties()
244    }
245    ///
246    /// Appends an item to `Tags`.
247    ///
248    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
249    ///
250    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
251    pub fn tags(mut self, input: crate::types::Tag) -> Self {
252        self.inner = self.inner.tags(input);
253        self
254    }
255    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
256    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
257        self.inner = self.inner.set_tags(input);
258        self
259    }
260    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the data source.</p>
261    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
262        self.inner.get_tags()
263    }
264    ///
265    /// Appends an item to `FolderArns`.
266    ///
267    /// To override the contents of this collection use [`set_folder_arns`](Self::set_folder_arns).
268    ///
269    /// <p>When you create the data source, QuickSight adds the data source to these folders.</p>
270    pub fn folder_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.inner = self.inner.folder_arns(input.into());
272        self
273    }
274    /// <p>When you create the data source, QuickSight adds the data source to these folders.</p>
275    pub fn set_folder_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
276        self.inner = self.inner.set_folder_arns(input);
277        self
278    }
279    /// <p>When you create the data source, QuickSight adds the data source to these folders.</p>
280    pub fn get_folder_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
281        self.inner.get_folder_arns()
282    }
283}