aws_sdk_quicksight/
client.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[derive(Debug)]
3pub(crate) struct Handle {
4    pub(crate) conf: crate::Config,
5    #[allow(dead_code)] // unused when a service does not provide any operations
6    pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
7}
8
9/// Client for Amazon QuickSight
10///
11/// Client for invoking operations on Amazon QuickSight. Each operation on Amazon QuickSight is a method on this
12/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
13/// ## Constructing a `Client`
14///
15/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
16/// crate should be used to automatically resolve this config using
17/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
18/// across multiple different AWS SDK clients. This config resolution process can be customized
19/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
20/// the [builder pattern] to customize the default config.
21///
22/// In the simplest case, creating a client looks as follows:
23/// ```rust,no_run
24/// # async fn wrapper() {
25/// let config = aws_config::load_from_env().await;
26/// let client = aws_sdk_quicksight::Client::new(&config);
27/// # }
28/// ```
29///
30/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
31/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
32/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
33/// done as follows:
34///
35/// ```rust,no_run
36/// # async fn wrapper() {
37/// let sdk_config = ::aws_config::load_from_env().await;
38/// let config = aws_sdk_quicksight::config::Builder::from(&sdk_config)
39/// # /*
40///     .some_service_specific_setting("value")
41/// # */
42///     .build();
43/// # }
44/// ```
45///
46/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
47///
48/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
49/// be done once at application start-up.
50///
51/// [`Config`]: crate::Config
52/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
53/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
54/// [`aws-config` docs]: https://docs.rs/aws-config/*
55/// [`aws-config`]: https://crates.io/crates/aws-config
56/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
57/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
58/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
59/// # Using the `Client`
60///
61/// A client has a function for every operation that can be performed by the service.
62/// For example, the [`BatchCreateTopicReviewedAnswer`](crate::operation::batch_create_topic_reviewed_answer) operation has
63/// a [`Client::batch_create_topic_reviewed_answer`], function which returns a builder for that operation.
64/// The fluent builder ultimately has a `send()` function that returns an async future that
65/// returns a result, as illustrated below:
66///
67/// ```rust,ignore
68/// let result = client.batch_create_topic_reviewed_answer()
69///     .aws_account_id("example")
70///     .send()
71///     .await;
72/// ```
73///
74/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
75/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
76/// information.
77#[derive(::std::clone::Clone, ::std::fmt::Debug)]
78pub struct Client {
79    handle: ::std::sync::Arc<Handle>,
80}
81
82impl Client {
83    /// Creates a new client from the service [`Config`](crate::Config).
84    ///
85    /// # Panics
86    ///
87    /// This method will panic in the following cases:
88    ///
89    /// - Retries or timeouts are enabled without a `sleep_impl` configured.
90    /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured.
91    /// - No `behavior_version` is provided.
92    ///
93    /// The panic message for each of these will have instructions on how to resolve them.
94    #[track_caller]
95    pub fn from_conf(conf: crate::Config) -> Self {
96        let handle = Handle {
97            conf: conf.clone(),
98            runtime_plugins: crate::config::base_client_runtime_plugins(conf),
99        };
100        if let Err(err) = Self::validate_config(&handle) {
101            panic!("Invalid client configuration: {err}");
102        }
103        Self {
104            handle: ::std::sync::Arc::new(handle),
105        }
106    }
107
108    /// Returns the client's configuration.
109    pub fn config(&self) -> &crate::Config {
110        &self.handle.conf
111    }
112
113    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
114        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
115        handle
116            .runtime_plugins
117            .apply_client_configuration(&mut cfg)?
118            .validate_base_client_config(&cfg)?;
119        Ok(())
120    }
121}
122
123impl Client {
124    /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig).
125    ///
126    /// # Panics
127    ///
128    /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
129    ///   the `sleep_impl` on the Config passed into this function to fix it.
130    /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
131    ///   `http_connector` on the Config passed into this function to fix it.
132    /// - This method will panic if no `BehaviorVersion` is provided. If you experience this panic, set `behavior_version` on the Config or enable the `behavior-version-latest` Cargo feature.
133    #[track_caller]
134    pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
135        Self::from_conf(sdk_config.into())
136    }
137}
138
139mod batch_create_topic_reviewed_answer;
140
141mod batch_delete_topic_reviewed_answer;
142
143mod cancel_ingestion;
144
145mod create_account_customization;
146
147mod create_account_subscription;
148
149mod create_analysis;
150
151mod create_brand;
152
153mod create_custom_permissions;
154
155mod create_dashboard;
156
157mod create_data_set;
158
159mod create_data_source;
160
161mod create_folder;
162
163mod create_folder_membership;
164
165mod create_group;
166
167mod create_group_membership;
168
169mod create_iam_policy_assignment;
170
171mod create_ingestion;
172
173mod create_namespace;
174
175mod create_refresh_schedule;
176
177mod create_role_membership;
178
179mod create_template;
180
181mod create_template_alias;
182
183mod create_theme;
184
185mod create_theme_alias;
186
187mod create_topic;
188
189mod create_topic_refresh_schedule;
190
191mod create_vpc_connection;
192
193/// Operation customization and supporting types.
194///
195/// The underlying HTTP requests made during an operation can be customized
196/// by calling the `customize()` method on the builder returned from a client
197/// operation call. For example, this can be used to add an additional HTTP header:
198///
199/// ```ignore
200/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_quicksight::Error> {
201/// # let client: aws_sdk_quicksight::Client = unimplemented!();
202/// use ::http::header::{HeaderName, HeaderValue};
203///
204/// let result = client.batch_create_topic_reviewed_answer()
205///     .customize()
206///     .mutate_request(|req| {
207///         // Add `x-example-header` with value
208///         req.headers_mut()
209///             .insert(
210///                 HeaderName::from_static("x-example-header"),
211///                 HeaderValue::from_static("1"),
212///             );
213///     })
214///     .send()
215///     .await;
216/// # }
217/// ```
218pub mod customize;
219
220mod delete_account_custom_permission;
221
222mod delete_account_customization;
223
224mod delete_account_subscription;
225
226mod delete_analysis;
227
228mod delete_brand;
229
230mod delete_brand_assignment;
231
232mod delete_custom_permissions;
233
234mod delete_dashboard;
235
236mod delete_data_set;
237
238mod delete_data_set_refresh_properties;
239
240mod delete_data_source;
241
242mod delete_default_q_business_application;
243
244mod delete_folder;
245
246mod delete_folder_membership;
247
248mod delete_group;
249
250mod delete_group_membership;
251
252mod delete_iam_policy_assignment;
253
254mod delete_identity_propagation_config;
255
256mod delete_namespace;
257
258mod delete_refresh_schedule;
259
260mod delete_role_custom_permission;
261
262mod delete_role_membership;
263
264mod delete_template;
265
266mod delete_template_alias;
267
268mod delete_theme;
269
270mod delete_theme_alias;
271
272mod delete_topic;
273
274mod delete_topic_refresh_schedule;
275
276mod delete_user;
277
278mod delete_user_by_principal_id;
279
280mod delete_user_custom_permission;
281
282mod delete_vpc_connection;
283
284mod describe_account_custom_permission;
285
286mod describe_account_customization;
287
288mod describe_account_settings;
289
290mod describe_account_subscription;
291
292mod describe_analysis;
293
294mod describe_analysis_definition;
295
296mod describe_analysis_permissions;
297
298mod describe_asset_bundle_export_job;
299
300mod describe_asset_bundle_import_job;
301
302mod describe_brand;
303
304mod describe_brand_assignment;
305
306mod describe_brand_published_version;
307
308mod describe_custom_permissions;
309
310mod describe_dashboard;
311
312mod describe_dashboard_definition;
313
314mod describe_dashboard_permissions;
315
316mod describe_dashboard_snapshot_job;
317
318mod describe_dashboard_snapshot_job_result;
319
320mod describe_dashboards_qa_configuration;
321
322mod describe_data_set;
323
324mod describe_data_set_permissions;
325
326mod describe_data_set_refresh_properties;
327
328mod describe_data_source;
329
330mod describe_data_source_permissions;
331
332mod describe_default_q_business_application;
333
334mod describe_folder;
335
336mod describe_folder_permissions;
337
338mod describe_folder_resolved_permissions;
339
340mod describe_group;
341
342mod describe_group_membership;
343
344mod describe_iam_policy_assignment;
345
346mod describe_ingestion;
347
348mod describe_ip_restriction;
349
350mod describe_key_registration;
351
352mod describe_namespace;
353
354mod describe_q_personalization_configuration;
355
356mod describe_quick_sight_q_search_configuration;
357
358mod describe_refresh_schedule;
359
360mod describe_role_custom_permission;
361
362mod describe_template;
363
364mod describe_template_alias;
365
366mod describe_template_definition;
367
368mod describe_template_permissions;
369
370mod describe_theme;
371
372mod describe_theme_alias;
373
374mod describe_theme_permissions;
375
376mod describe_topic;
377
378mod describe_topic_permissions;
379
380mod describe_topic_refresh;
381
382mod describe_topic_refresh_schedule;
383
384mod describe_user;
385
386mod describe_vpc_connection;
387
388mod generate_embed_url_for_anonymous_user;
389
390mod generate_embed_url_for_registered_user;
391
392mod generate_embed_url_for_registered_user_with_identity;
393
394mod get_dashboard_embed_url;
395
396mod get_session_embed_url;
397
398mod list_analyses;
399
400mod list_asset_bundle_export_jobs;
401
402mod list_asset_bundle_import_jobs;
403
404mod list_brands;
405
406mod list_custom_permissions;
407
408mod list_dashboard_versions;
409
410mod list_dashboards;
411
412mod list_data_sets;
413
414mod list_data_sources;
415
416mod list_folder_members;
417
418mod list_folders;
419
420mod list_folders_for_resource;
421
422mod list_group_memberships;
423
424mod list_groups;
425
426mod list_iam_policy_assignments;
427
428mod list_iam_policy_assignments_for_user;
429
430mod list_identity_propagation_configs;
431
432mod list_ingestions;
433
434mod list_namespaces;
435
436mod list_refresh_schedules;
437
438mod list_role_memberships;
439
440mod list_tags_for_resource;
441
442mod list_template_aliases;
443
444mod list_template_versions;
445
446mod list_templates;
447
448mod list_theme_aliases;
449
450mod list_theme_versions;
451
452mod list_themes;
453
454mod list_topic_refresh_schedules;
455
456mod list_topic_reviewed_answers;
457
458mod list_topics;
459
460mod list_user_groups;
461
462mod list_users;
463
464mod list_vpc_connections;
465
466mod predict_qa_results;
467
468mod put_data_set_refresh_properties;
469
470mod register_user;
471
472mod restore_analysis;
473
474mod search_analyses;
475
476mod search_dashboards;
477
478mod search_data_sets;
479
480mod search_data_sources;
481
482mod search_folders;
483
484mod search_groups;
485
486mod search_topics;
487
488mod start_asset_bundle_export_job;
489
490mod start_asset_bundle_import_job;
491
492mod start_dashboard_snapshot_job;
493
494mod start_dashboard_snapshot_job_schedule;
495
496mod tag_resource;
497
498mod untag_resource;
499
500mod update_account_custom_permission;
501
502mod update_account_customization;
503
504mod update_account_settings;
505
506mod update_analysis;
507
508mod update_analysis_permissions;
509
510mod update_application_with_token_exchange_grant;
511
512mod update_brand;
513
514mod update_brand_assignment;
515
516mod update_brand_published_version;
517
518mod update_custom_permissions;
519
520mod update_dashboard;
521
522mod update_dashboard_links;
523
524mod update_dashboard_permissions;
525
526mod update_dashboard_published_version;
527
528mod update_dashboards_qa_configuration;
529
530mod update_data_set;
531
532mod update_data_set_permissions;
533
534mod update_data_source;
535
536mod update_data_source_permissions;
537
538mod update_default_q_business_application;
539
540mod update_folder;
541
542mod update_folder_permissions;
543
544mod update_group;
545
546mod update_iam_policy_assignment;
547
548mod update_identity_propagation_config;
549
550mod update_ip_restriction;
551
552mod update_key_registration;
553
554mod update_public_sharing_settings;
555
556mod update_q_personalization_configuration;
557
558mod update_quick_sight_q_search_configuration;
559
560mod update_refresh_schedule;
561
562mod update_role_custom_permission;
563
564mod update_spice_capacity_configuration;
565
566mod update_template;
567
568mod update_template_alias;
569
570mod update_template_permissions;
571
572mod update_theme;
573
574mod update_theme_alias;
575
576mod update_theme_permissions;
577
578mod update_topic;
579
580mod update_topic_permissions;
581
582mod update_topic_refresh_schedule;
583
584mod update_user;
585
586mod update_user_custom_permission;
587
588mod update_vpc_connection;