aws_sdk_omics/
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 Omics
10///
11/// Client for invoking operations on Amazon Omics. Each operation on Amazon Omics 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_omics::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_omics::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 [`AbortMultipartReadSetUpload`](crate::operation::abort_multipart_read_set_upload) operation has
63/// a [`Client::abort_multipart_read_set_upload`], 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.abort_multipart_read_set_upload()
69///     .sequence_store_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/// # Waiters
78///
79/// This client provides `wait_until` methods behind the [`Waiters`](crate::client::Waiters) trait.
80/// To use them, simply import the trait, and then call one of the `wait_until` methods. This will
81/// return a waiter fluent builder that takes various parameters, which are documented on the builder
82/// type. Once parameters have been provided, the `wait` method can be called to initiate waiting.
83///
84/// For example, if there was a `wait_until_thing` method, it could look like:
85/// ```rust,ignore
86/// let result = client.wait_until_thing()
87///     .thing_id("someId")
88///     .wait(Duration::from_secs(120))
89///     .await;
90/// ```
91#[derive(::std::clone::Clone, ::std::fmt::Debug)]
92pub struct Client {
93    handle: ::std::sync::Arc<Handle>,
94}
95
96impl Client {
97    /// Creates a new client from the service [`Config`](crate::Config).
98    ///
99    /// # Panics
100    ///
101    /// This method will panic in the following cases:
102    ///
103    /// - Retries or timeouts are enabled without a `sleep_impl` configured.
104    /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured.
105    /// - No `behavior_version` is provided.
106    ///
107    /// The panic message for each of these will have instructions on how to resolve them.
108    #[track_caller]
109    pub fn from_conf(conf: crate::Config) -> Self {
110        let handle = Handle {
111            conf: conf.clone(),
112            runtime_plugins: crate::config::base_client_runtime_plugins(conf),
113        };
114        if let Err(err) = Self::validate_config(&handle) {
115            panic!("Invalid client configuration: {err}");
116        }
117        Self {
118            handle: ::std::sync::Arc::new(handle),
119        }
120    }
121
122    /// Returns the client's configuration.
123    pub fn config(&self) -> &crate::Config {
124        &self.handle.conf
125    }
126
127    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
128        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
129        handle
130            .runtime_plugins
131            .apply_client_configuration(&mut cfg)?
132            .validate_base_client_config(&cfg)?;
133        Ok(())
134    }
135}
136
137///
138/// Waiter functions for the client.
139///
140/// Import this trait to get `wait_until` methods on the client.
141///
142pub trait Waiters {
143    /// Wait until an annotation import is completed
144    fn wait_until_annotation_import_job_created(&self) -> crate::waiters::annotation_import_job_created::AnnotationImportJobCreatedFluentBuilder;
145    /// Wait until an annotation store is created
146    fn wait_until_annotation_store_created(&self) -> crate::waiters::annotation_store_created::AnnotationStoreCreatedFluentBuilder;
147    /// Wait until an annotation store is deleted.
148    fn wait_until_annotation_store_deleted(&self) -> crate::waiters::annotation_store_deleted::AnnotationStoreDeletedFluentBuilder;
149    /// Wait until an annotation store version is created
150    fn wait_until_annotation_store_version_created(
151        &self,
152    ) -> crate::waiters::annotation_store_version_created::AnnotationStoreVersionCreatedFluentBuilder;
153    /// Wait until an annotation store version is deleted.
154    fn wait_until_annotation_store_version_deleted(
155        &self,
156    ) -> crate::waiters::annotation_store_version_deleted::AnnotationStoreVersionDeletedFluentBuilder;
157    /// Wait until a job is completed.
158    fn wait_until_read_set_activation_job_completed(
159        &self,
160    ) -> crate::waiters::read_set_activation_job_completed::ReadSetActivationJobCompletedFluentBuilder;
161    /// Wait until a job is completed.
162    fn wait_until_read_set_export_job_completed(&self) -> crate::waiters::read_set_export_job_completed::ReadSetExportJobCompletedFluentBuilder;
163    /// Wait until a job is completed.
164    fn wait_until_read_set_import_job_completed(&self) -> crate::waiters::read_set_import_job_completed::ReadSetImportJobCompletedFluentBuilder;
165    /// Wait until a job is completed.
166    fn wait_until_reference_import_job_completed(&self) -> crate::waiters::reference_import_job_completed::ReferenceImportJobCompletedFluentBuilder;
167    /// Wait until a run is running.
168    fn wait_until_run_running(&self) -> crate::waiters::run_running::RunRunningFluentBuilder;
169    /// Wait until a run is completed.
170    fn wait_until_run_completed(&self) -> crate::waiters::run_completed::RunCompletedFluentBuilder;
171    /// Wait until a task is running.
172    fn wait_until_task_running(&self) -> crate::waiters::task_running::TaskRunningFluentBuilder;
173    /// Wait until a task is completed.
174    fn wait_until_task_completed(&self) -> crate::waiters::task_completed::TaskCompletedFluentBuilder;
175    /// Wait until variant import is completed
176    fn wait_until_variant_import_job_created(&self) -> crate::waiters::variant_import_job_created::VariantImportJobCreatedFluentBuilder;
177    /// Wait until a variant store is created
178    fn wait_until_variant_store_created(&self) -> crate::waiters::variant_store_created::VariantStoreCreatedFluentBuilder;
179    /// Wait until a variant store is deleted.
180    fn wait_until_variant_store_deleted(&self) -> crate::waiters::variant_store_deleted::VariantStoreDeletedFluentBuilder;
181    /// Wait until a workflow is active.
182    fn wait_until_workflow_active(&self) -> crate::waiters::workflow_active::WorkflowActiveFluentBuilder;
183    /// Wait until a workflow version is active.
184    fn wait_until_workflow_version_active(&self) -> crate::waiters::workflow_version_active::WorkflowVersionActiveFluentBuilder;
185}
186impl Waiters for Client {
187    fn wait_until_annotation_import_job_created(&self) -> crate::waiters::annotation_import_job_created::AnnotationImportJobCreatedFluentBuilder {
188        crate::waiters::annotation_import_job_created::AnnotationImportJobCreatedFluentBuilder::new(self.handle.clone())
189    }
190    fn wait_until_annotation_store_created(&self) -> crate::waiters::annotation_store_created::AnnotationStoreCreatedFluentBuilder {
191        crate::waiters::annotation_store_created::AnnotationStoreCreatedFluentBuilder::new(self.handle.clone())
192    }
193    fn wait_until_annotation_store_deleted(&self) -> crate::waiters::annotation_store_deleted::AnnotationStoreDeletedFluentBuilder {
194        crate::waiters::annotation_store_deleted::AnnotationStoreDeletedFluentBuilder::new(self.handle.clone())
195    }
196    fn wait_until_annotation_store_version_created(
197        &self,
198    ) -> crate::waiters::annotation_store_version_created::AnnotationStoreVersionCreatedFluentBuilder {
199        crate::waiters::annotation_store_version_created::AnnotationStoreVersionCreatedFluentBuilder::new(self.handle.clone())
200    }
201    fn wait_until_annotation_store_version_deleted(
202        &self,
203    ) -> crate::waiters::annotation_store_version_deleted::AnnotationStoreVersionDeletedFluentBuilder {
204        crate::waiters::annotation_store_version_deleted::AnnotationStoreVersionDeletedFluentBuilder::new(self.handle.clone())
205    }
206    fn wait_until_read_set_activation_job_completed(
207        &self,
208    ) -> crate::waiters::read_set_activation_job_completed::ReadSetActivationJobCompletedFluentBuilder {
209        crate::waiters::read_set_activation_job_completed::ReadSetActivationJobCompletedFluentBuilder::new(self.handle.clone())
210    }
211    fn wait_until_read_set_export_job_completed(&self) -> crate::waiters::read_set_export_job_completed::ReadSetExportJobCompletedFluentBuilder {
212        crate::waiters::read_set_export_job_completed::ReadSetExportJobCompletedFluentBuilder::new(self.handle.clone())
213    }
214    fn wait_until_read_set_import_job_completed(&self) -> crate::waiters::read_set_import_job_completed::ReadSetImportJobCompletedFluentBuilder {
215        crate::waiters::read_set_import_job_completed::ReadSetImportJobCompletedFluentBuilder::new(self.handle.clone())
216    }
217    fn wait_until_reference_import_job_completed(&self) -> crate::waiters::reference_import_job_completed::ReferenceImportJobCompletedFluentBuilder {
218        crate::waiters::reference_import_job_completed::ReferenceImportJobCompletedFluentBuilder::new(self.handle.clone())
219    }
220    fn wait_until_run_running(&self) -> crate::waiters::run_running::RunRunningFluentBuilder {
221        crate::waiters::run_running::RunRunningFluentBuilder::new(self.handle.clone())
222    }
223    fn wait_until_run_completed(&self) -> crate::waiters::run_completed::RunCompletedFluentBuilder {
224        crate::waiters::run_completed::RunCompletedFluentBuilder::new(self.handle.clone())
225    }
226    fn wait_until_task_running(&self) -> crate::waiters::task_running::TaskRunningFluentBuilder {
227        crate::waiters::task_running::TaskRunningFluentBuilder::new(self.handle.clone())
228    }
229    fn wait_until_task_completed(&self) -> crate::waiters::task_completed::TaskCompletedFluentBuilder {
230        crate::waiters::task_completed::TaskCompletedFluentBuilder::new(self.handle.clone())
231    }
232    fn wait_until_variant_import_job_created(&self) -> crate::waiters::variant_import_job_created::VariantImportJobCreatedFluentBuilder {
233        crate::waiters::variant_import_job_created::VariantImportJobCreatedFluentBuilder::new(self.handle.clone())
234    }
235    fn wait_until_variant_store_created(&self) -> crate::waiters::variant_store_created::VariantStoreCreatedFluentBuilder {
236        crate::waiters::variant_store_created::VariantStoreCreatedFluentBuilder::new(self.handle.clone())
237    }
238    fn wait_until_variant_store_deleted(&self) -> crate::waiters::variant_store_deleted::VariantStoreDeletedFluentBuilder {
239        crate::waiters::variant_store_deleted::VariantStoreDeletedFluentBuilder::new(self.handle.clone())
240    }
241    fn wait_until_workflow_active(&self) -> crate::waiters::workflow_active::WorkflowActiveFluentBuilder {
242        crate::waiters::workflow_active::WorkflowActiveFluentBuilder::new(self.handle.clone())
243    }
244    fn wait_until_workflow_version_active(&self) -> crate::waiters::workflow_version_active::WorkflowVersionActiveFluentBuilder {
245        crate::waiters::workflow_version_active::WorkflowVersionActiveFluentBuilder::new(self.handle.clone())
246    }
247}
248
249impl Client {
250    /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig).
251    ///
252    /// # Panics
253    ///
254    /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
255    ///   the `sleep_impl` on the Config passed into this function to fix it.
256    /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
257    ///   `http_connector` on the Config passed into this function to fix it.
258    /// - 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.
259    #[track_caller]
260    pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
261        Self::from_conf(sdk_config.into())
262    }
263}
264
265mod abort_multipart_read_set_upload;
266
267mod accept_share;
268
269mod batch_delete_read_set;
270
271mod cancel_annotation_import_job;
272
273mod cancel_run;
274
275mod cancel_variant_import_job;
276
277mod complete_multipart_read_set_upload;
278
279mod create_annotation_store;
280
281mod create_annotation_store_version;
282
283mod create_multipart_read_set_upload;
284
285mod create_reference_store;
286
287mod create_run_cache;
288
289mod create_run_group;
290
291mod create_sequence_store;
292
293mod create_share;
294
295mod create_variant_store;
296
297mod create_workflow;
298
299mod create_workflow_version;
300
301/// Operation customization and supporting types.
302///
303/// The underlying HTTP requests made during an operation can be customized
304/// by calling the `customize()` method on the builder returned from a client
305/// operation call. For example, this can be used to add an additional HTTP header:
306///
307/// ```ignore
308/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_omics::Error> {
309/// # let client: aws_sdk_omics::Client = unimplemented!();
310/// use ::http::header::{HeaderName, HeaderValue};
311///
312/// let result = client.abort_multipart_read_set_upload()
313///     .customize()
314///     .mutate_request(|req| {
315///         // Add `x-example-header` with value
316///         req.headers_mut()
317///             .insert(
318///                 HeaderName::from_static("x-example-header"),
319///                 HeaderValue::from_static("1"),
320///             );
321///     })
322///     .send()
323///     .await;
324/// # }
325/// ```
326pub mod customize;
327
328mod delete_annotation_store;
329
330mod delete_annotation_store_versions;
331
332mod delete_reference;
333
334mod delete_reference_store;
335
336mod delete_run;
337
338mod delete_run_cache;
339
340mod delete_run_group;
341
342mod delete_s3_access_policy;
343
344mod delete_sequence_store;
345
346mod delete_share;
347
348mod delete_variant_store;
349
350mod delete_workflow;
351
352mod delete_workflow_version;
353
354mod get_annotation_import_job;
355
356mod get_annotation_store;
357
358mod get_annotation_store_version;
359
360mod get_read_set;
361
362mod get_read_set_activation_job;
363
364mod get_read_set_export_job;
365
366mod get_read_set_import_job;
367
368mod get_read_set_metadata;
369
370mod get_reference;
371
372mod get_reference_import_job;
373
374mod get_reference_metadata;
375
376mod get_reference_store;
377
378mod get_run;
379
380mod get_run_cache;
381
382mod get_run_group;
383
384mod get_run_task;
385
386mod get_s3_access_policy;
387
388mod get_sequence_store;
389
390mod get_share;
391
392mod get_variant_import_job;
393
394mod get_variant_store;
395
396mod get_workflow;
397
398mod get_workflow_version;
399
400mod list_annotation_import_jobs;
401
402mod list_annotation_store_versions;
403
404mod list_annotation_stores;
405
406mod list_multipart_read_set_uploads;
407
408mod list_read_set_activation_jobs;
409
410mod list_read_set_export_jobs;
411
412mod list_read_set_import_jobs;
413
414mod list_read_set_upload_parts;
415
416mod list_read_sets;
417
418mod list_reference_import_jobs;
419
420mod list_reference_stores;
421
422mod list_references;
423
424mod list_run_caches;
425
426mod list_run_groups;
427
428mod list_run_tasks;
429
430mod list_runs;
431
432mod list_sequence_stores;
433
434mod list_shares;
435
436mod list_tags_for_resource;
437
438mod list_variant_import_jobs;
439
440mod list_variant_stores;
441
442mod list_workflow_versions;
443
444mod list_workflows;
445
446mod put_s3_access_policy;
447
448mod start_annotation_import_job;
449
450mod start_read_set_activation_job;
451
452mod start_read_set_export_job;
453
454mod start_read_set_import_job;
455
456mod start_reference_import_job;
457
458mod start_run;
459
460mod start_variant_import_job;
461
462mod tag_resource;
463
464mod untag_resource;
465
466mod update_annotation_store;
467
468mod update_annotation_store_version;
469
470mod update_run_cache;
471
472mod update_run_group;
473
474mod update_sequence_store;
475
476mod update_variant_store;
477
478mod update_workflow;
479
480mod update_workflow_version;
481
482mod upload_read_set_part;