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 [`DeleteS3AccessPolicy`](crate::operation::delete_s3_access_policy) operation has
63/// a [`Client::delete_s3_access_policy`], 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.delete_s3_access_policy()
69///     .s3_access_point_arn("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}
184impl Waiters for Client {
185    fn wait_until_annotation_import_job_created(&self) -> crate::waiters::annotation_import_job_created::AnnotationImportJobCreatedFluentBuilder {
186        crate::waiters::annotation_import_job_created::AnnotationImportJobCreatedFluentBuilder::new(self.handle.clone())
187    }
188    fn wait_until_annotation_store_created(&self) -> crate::waiters::annotation_store_created::AnnotationStoreCreatedFluentBuilder {
189        crate::waiters::annotation_store_created::AnnotationStoreCreatedFluentBuilder::new(self.handle.clone())
190    }
191    fn wait_until_annotation_store_deleted(&self) -> crate::waiters::annotation_store_deleted::AnnotationStoreDeletedFluentBuilder {
192        crate::waiters::annotation_store_deleted::AnnotationStoreDeletedFluentBuilder::new(self.handle.clone())
193    }
194    fn wait_until_annotation_store_version_created(
195        &self,
196    ) -> crate::waiters::annotation_store_version_created::AnnotationStoreVersionCreatedFluentBuilder {
197        crate::waiters::annotation_store_version_created::AnnotationStoreVersionCreatedFluentBuilder::new(self.handle.clone())
198    }
199    fn wait_until_annotation_store_version_deleted(
200        &self,
201    ) -> crate::waiters::annotation_store_version_deleted::AnnotationStoreVersionDeletedFluentBuilder {
202        crate::waiters::annotation_store_version_deleted::AnnotationStoreVersionDeletedFluentBuilder::new(self.handle.clone())
203    }
204    fn wait_until_read_set_activation_job_completed(
205        &self,
206    ) -> crate::waiters::read_set_activation_job_completed::ReadSetActivationJobCompletedFluentBuilder {
207        crate::waiters::read_set_activation_job_completed::ReadSetActivationJobCompletedFluentBuilder::new(self.handle.clone())
208    }
209    fn wait_until_read_set_export_job_completed(&self) -> crate::waiters::read_set_export_job_completed::ReadSetExportJobCompletedFluentBuilder {
210        crate::waiters::read_set_export_job_completed::ReadSetExportJobCompletedFluentBuilder::new(self.handle.clone())
211    }
212    fn wait_until_read_set_import_job_completed(&self) -> crate::waiters::read_set_import_job_completed::ReadSetImportJobCompletedFluentBuilder {
213        crate::waiters::read_set_import_job_completed::ReadSetImportJobCompletedFluentBuilder::new(self.handle.clone())
214    }
215    fn wait_until_reference_import_job_completed(&self) -> crate::waiters::reference_import_job_completed::ReferenceImportJobCompletedFluentBuilder {
216        crate::waiters::reference_import_job_completed::ReferenceImportJobCompletedFluentBuilder::new(self.handle.clone())
217    }
218    fn wait_until_run_running(&self) -> crate::waiters::run_running::RunRunningFluentBuilder {
219        crate::waiters::run_running::RunRunningFluentBuilder::new(self.handle.clone())
220    }
221    fn wait_until_run_completed(&self) -> crate::waiters::run_completed::RunCompletedFluentBuilder {
222        crate::waiters::run_completed::RunCompletedFluentBuilder::new(self.handle.clone())
223    }
224    fn wait_until_task_running(&self) -> crate::waiters::task_running::TaskRunningFluentBuilder {
225        crate::waiters::task_running::TaskRunningFluentBuilder::new(self.handle.clone())
226    }
227    fn wait_until_task_completed(&self) -> crate::waiters::task_completed::TaskCompletedFluentBuilder {
228        crate::waiters::task_completed::TaskCompletedFluentBuilder::new(self.handle.clone())
229    }
230    fn wait_until_variant_import_job_created(&self) -> crate::waiters::variant_import_job_created::VariantImportJobCreatedFluentBuilder {
231        crate::waiters::variant_import_job_created::VariantImportJobCreatedFluentBuilder::new(self.handle.clone())
232    }
233    fn wait_until_variant_store_created(&self) -> crate::waiters::variant_store_created::VariantStoreCreatedFluentBuilder {
234        crate::waiters::variant_store_created::VariantStoreCreatedFluentBuilder::new(self.handle.clone())
235    }
236    fn wait_until_variant_store_deleted(&self) -> crate::waiters::variant_store_deleted::VariantStoreDeletedFluentBuilder {
237        crate::waiters::variant_store_deleted::VariantStoreDeletedFluentBuilder::new(self.handle.clone())
238    }
239    fn wait_until_workflow_active(&self) -> crate::waiters::workflow_active::WorkflowActiveFluentBuilder {
240        crate::waiters::workflow_active::WorkflowActiveFluentBuilder::new(self.handle.clone())
241    }
242}
243
244impl Client {
245    /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig).
246    ///
247    /// # Panics
248    ///
249    /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
250    ///     the `sleep_impl` on the Config passed into this function to fix it.
251    /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
252    ///     `http_connector` on the Config passed into this function to fix it.
253    /// - 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.
254    #[track_caller]
255    pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
256        Self::from_conf(sdk_config.into())
257    }
258}
259
260mod abort_multipart_read_set_upload;
261
262mod accept_share;
263
264mod batch_delete_read_set;
265
266mod cancel_annotation_import_job;
267
268mod cancel_run;
269
270mod cancel_variant_import_job;
271
272mod complete_multipart_read_set_upload;
273
274mod create_annotation_store;
275
276mod create_annotation_store_version;
277
278mod create_multipart_read_set_upload;
279
280mod create_reference_store;
281
282mod create_run_cache;
283
284mod create_run_group;
285
286mod create_sequence_store;
287
288mod create_share;
289
290mod create_variant_store;
291
292mod create_workflow;
293
294/// Operation customization and supporting types.
295///
296/// The underlying HTTP requests made during an operation can be customized
297/// by calling the `customize()` method on the builder returned from a client
298/// operation call. For example, this can be used to add an additional HTTP header:
299///
300/// ```ignore
301/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_omics::Error> {
302/// # let client: aws_sdk_omics::Client = unimplemented!();
303/// use ::http::header::{HeaderName, HeaderValue};
304///
305/// let result = client.delete_s3_access_policy()
306///     .customize()
307///     .mutate_request(|req| {
308///         // Add `x-example-header` with value
309///         req.headers_mut()
310///             .insert(
311///                 HeaderName::from_static("x-example-header"),
312///                 HeaderValue::from_static("1"),
313///             );
314///     })
315///     .send()
316///     .await;
317/// # }
318/// ```
319pub mod customize;
320
321mod delete_annotation_store;
322
323mod delete_annotation_store_versions;
324
325mod delete_reference;
326
327mod delete_reference_store;
328
329mod delete_run;
330
331mod delete_run_cache;
332
333mod delete_run_group;
334
335mod delete_s3_access_policy;
336
337mod delete_sequence_store;
338
339mod delete_share;
340
341mod delete_variant_store;
342
343mod delete_workflow;
344
345mod get_annotation_import_job;
346
347mod get_annotation_store;
348
349mod get_annotation_store_version;
350
351mod get_read_set;
352
353mod get_read_set_activation_job;
354
355mod get_read_set_export_job;
356
357mod get_read_set_import_job;
358
359mod get_read_set_metadata;
360
361mod get_reference;
362
363mod get_reference_import_job;
364
365mod get_reference_metadata;
366
367mod get_reference_store;
368
369mod get_run;
370
371mod get_run_cache;
372
373mod get_run_group;
374
375mod get_run_task;
376
377mod get_s3_access_policy;
378
379mod get_sequence_store;
380
381mod get_share;
382
383mod get_variant_import_job;
384
385mod get_variant_store;
386
387mod get_workflow;
388
389mod list_annotation_import_jobs;
390
391mod list_annotation_store_versions;
392
393mod list_annotation_stores;
394
395mod list_multipart_read_set_uploads;
396
397mod list_read_set_activation_jobs;
398
399mod list_read_set_export_jobs;
400
401mod list_read_set_import_jobs;
402
403mod list_read_set_upload_parts;
404
405mod list_read_sets;
406
407mod list_reference_import_jobs;
408
409mod list_reference_stores;
410
411mod list_references;
412
413mod list_run_caches;
414
415mod list_run_groups;
416
417mod list_run_tasks;
418
419mod list_runs;
420
421mod list_sequence_stores;
422
423mod list_shares;
424
425mod list_tags_for_resource;
426
427mod list_variant_import_jobs;
428
429mod list_variant_stores;
430
431mod list_workflows;
432
433mod put_s3_access_policy;
434
435mod start_annotation_import_job;
436
437mod start_read_set_activation_job;
438
439mod start_read_set_export_job;
440
441mod start_read_set_import_job;
442
443mod start_reference_import_job;
444
445mod start_run;
446
447mod start_variant_import_job;
448
449mod tag_resource;
450
451mod untag_resource;
452
453mod update_annotation_store;
454
455mod update_annotation_store_version;
456
457mod update_run_cache;
458
459mod update_run_group;
460
461mod update_sequence_store;
462
463mod update_variant_store;
464
465mod update_workflow;
466
467mod upload_read_set_part;