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_action_connector;
150
151mod create_analysis;
152
153mod create_brand;
154
155mod create_custom_permissions;
156
157mod create_dashboard;
158
159mod create_data_set;
160
161mod create_data_source;
162
163mod create_folder;
164
165mod create_folder_membership;
166
167mod create_group;
168
169mod create_group_membership;
170
171mod create_iam_policy_assignment;
172
173mod create_ingestion;
174
175mod create_namespace;
176
177mod create_refresh_schedule;
178
179mod create_role_membership;
180
181mod create_template;
182
183mod create_template_alias;
184
185mod create_theme;
186
187mod create_theme_alias;
188
189mod create_topic;
190
191mod create_topic_refresh_schedule;
192
193mod create_vpc_connection;
194
195/// Operation customization and supporting types.
196///
197/// The underlying HTTP requests made during an operation can be customized
198/// by calling the `customize()` method on the builder returned from a client
199/// operation call. For example, this can be used to add an additional HTTP header:
200///
201/// ```ignore
202/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_quicksight::Error> {
203/// # let client: aws_sdk_quicksight::Client = unimplemented!();
204/// use ::http::header::{HeaderName, HeaderValue};
205///
206/// let result = client.batch_create_topic_reviewed_answer()
207///     .customize()
208///     .mutate_request(|req| {
209///         // Add `x-example-header` with value
210///         req.headers_mut()
211///             .insert(
212///                 HeaderName::from_static("x-example-header"),
213///                 HeaderValue::from_static("1"),
214///             );
215///     })
216///     .send()
217///     .await;
218/// # }
219/// ```
220pub mod customize;
221
222mod delete_account_custom_permission;
223
224mod delete_account_customization;
225
226mod delete_account_subscription;
227
228mod delete_action_connector;
229
230mod delete_analysis;
231
232mod delete_brand;
233
234mod delete_brand_assignment;
235
236mod delete_custom_permissions;
237
238mod delete_dashboard;
239
240mod delete_data_set;
241
242mod delete_data_set_refresh_properties;
243
244mod delete_data_source;
245
246mod delete_default_q_business_application;
247
248mod delete_folder;
249
250mod delete_folder_membership;
251
252mod delete_group;
253
254mod delete_group_membership;
255
256mod delete_iam_policy_assignment;
257
258mod delete_identity_propagation_config;
259
260mod delete_namespace;
261
262mod delete_refresh_schedule;
263
264mod delete_role_custom_permission;
265
266mod delete_role_membership;
267
268mod delete_template;
269
270mod delete_template_alias;
271
272mod delete_theme;
273
274mod delete_theme_alias;
275
276mod delete_topic;
277
278mod delete_topic_refresh_schedule;
279
280mod delete_user;
281
282mod delete_user_by_principal_id;
283
284mod delete_user_custom_permission;
285
286mod delete_vpc_connection;
287
288mod describe_account_custom_permission;
289
290mod describe_account_customization;
291
292mod describe_account_settings;
293
294mod describe_account_subscription;
295
296mod describe_action_connector;
297
298mod describe_action_connector_permissions;
299
300mod describe_analysis;
301
302mod describe_analysis_definition;
303
304mod describe_analysis_permissions;
305
306mod describe_asset_bundle_export_job;
307
308mod describe_asset_bundle_import_job;
309
310mod describe_brand;
311
312mod describe_brand_assignment;
313
314mod describe_brand_published_version;
315
316mod describe_custom_permissions;
317
318mod describe_dashboard;
319
320mod describe_dashboard_definition;
321
322mod describe_dashboard_permissions;
323
324mod describe_dashboard_snapshot_job;
325
326mod describe_dashboard_snapshot_job_result;
327
328mod describe_dashboards_qa_configuration;
329
330mod describe_data_set;
331
332mod describe_data_set_permissions;
333
334mod describe_data_set_refresh_properties;
335
336mod describe_data_source;
337
338mod describe_data_source_permissions;
339
340mod describe_default_q_business_application;
341
342mod describe_folder;
343
344mod describe_folder_permissions;
345
346mod describe_folder_resolved_permissions;
347
348mod describe_group;
349
350mod describe_group_membership;
351
352mod describe_iam_policy_assignment;
353
354mod describe_ingestion;
355
356mod describe_ip_restriction;
357
358mod describe_key_registration;
359
360mod describe_namespace;
361
362mod describe_q_personalization_configuration;
363
364mod describe_quick_sight_q_search_configuration;
365
366mod describe_refresh_schedule;
367
368mod describe_role_custom_permission;
369
370mod describe_template;
371
372mod describe_template_alias;
373
374mod describe_template_definition;
375
376mod describe_template_permissions;
377
378mod describe_theme;
379
380mod describe_theme_alias;
381
382mod describe_theme_permissions;
383
384mod describe_topic;
385
386mod describe_topic_permissions;
387
388mod describe_topic_refresh;
389
390mod describe_topic_refresh_schedule;
391
392mod describe_user;
393
394mod describe_vpc_connection;
395
396mod generate_embed_url_for_anonymous_user;
397
398mod generate_embed_url_for_registered_user;
399
400mod generate_embed_url_for_registered_user_with_identity;
401
402mod get_dashboard_embed_url;
403
404mod get_flow_metadata;
405
406mod get_flow_permissions;
407
408mod get_session_embed_url;
409
410mod list_action_connectors;
411
412mod list_analyses;
413
414mod list_asset_bundle_export_jobs;
415
416mod list_asset_bundle_import_jobs;
417
418mod list_brands;
419
420mod list_custom_permissions;
421
422mod list_dashboard_versions;
423
424mod list_dashboards;
425
426mod list_data_sets;
427
428mod list_data_sources;
429
430mod list_flows;
431
432mod list_folder_members;
433
434mod list_folders;
435
436mod list_folders_for_resource;
437
438mod list_group_memberships;
439
440mod list_groups;
441
442mod list_iam_policy_assignments;
443
444mod list_iam_policy_assignments_for_user;
445
446mod list_identity_propagation_configs;
447
448mod list_ingestions;
449
450mod list_namespaces;
451
452mod list_refresh_schedules;
453
454mod list_role_memberships;
455
456mod list_tags_for_resource;
457
458mod list_template_aliases;
459
460mod list_template_versions;
461
462mod list_templates;
463
464mod list_theme_aliases;
465
466mod list_theme_versions;
467
468mod list_themes;
469
470mod list_topic_refresh_schedules;
471
472mod list_topic_reviewed_answers;
473
474mod list_topics;
475
476mod list_user_groups;
477
478mod list_users;
479
480mod list_vpc_connections;
481
482mod predict_qa_results;
483
484mod put_data_set_refresh_properties;
485
486mod register_user;
487
488mod restore_analysis;
489
490mod search_action_connectors;
491
492mod search_analyses;
493
494mod search_dashboards;
495
496mod search_data_sets;
497
498mod search_data_sources;
499
500mod search_flows;
501
502mod search_folders;
503
504mod search_groups;
505
506mod search_topics;
507
508mod start_asset_bundle_export_job;
509
510mod start_asset_bundle_import_job;
511
512mod start_dashboard_snapshot_job;
513
514mod start_dashboard_snapshot_job_schedule;
515
516mod tag_resource;
517
518mod untag_resource;
519
520mod update_account_custom_permission;
521
522mod update_account_customization;
523
524mod update_account_settings;
525
526mod update_action_connector;
527
528mod update_action_connector_permissions;
529
530mod update_analysis;
531
532mod update_analysis_permissions;
533
534mod update_application_with_token_exchange_grant;
535
536mod update_brand;
537
538mod update_brand_assignment;
539
540mod update_brand_published_version;
541
542mod update_custom_permissions;
543
544mod update_dashboard;
545
546mod update_dashboard_links;
547
548mod update_dashboard_permissions;
549
550mod update_dashboard_published_version;
551
552mod update_dashboards_qa_configuration;
553
554mod update_data_set;
555
556mod update_data_set_permissions;
557
558mod update_data_source;
559
560mod update_data_source_permissions;
561
562mod update_default_q_business_application;
563
564mod update_flow_permissions;
565
566mod update_folder;
567
568mod update_folder_permissions;
569
570mod update_group;
571
572mod update_iam_policy_assignment;
573
574mod update_identity_propagation_config;
575
576mod update_ip_restriction;
577
578mod update_key_registration;
579
580mod update_public_sharing_settings;
581
582mod update_q_personalization_configuration;
583
584mod update_quick_sight_q_search_configuration;
585
586mod update_refresh_schedule;
587
588mod update_role_custom_permission;
589
590mod update_spice_capacity_configuration;
591
592mod update_template;
593
594mod update_template_alias;
595
596mod update_template_permissions;
597
598mod update_theme;
599
600mod update_theme_alias;
601
602mod update_theme_permissions;
603
604mod update_topic;
605
606mod update_topic_permissions;
607
608mod update_topic_refresh_schedule;
609
610mod update_user;
611
612mod update_user_custom_permission;
613
614mod update_vpc_connection;