aws_sdk_omics/operation/create_run_cache/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_run_cache::_create_run_cache_output::CreateRunCacheOutputBuilder;
3
4pub use crate::operation::create_run_cache::_create_run_cache_input::CreateRunCacheInputBuilder;
5
6impl crate::operation::create_run_cache::builders::CreateRunCacheInputBuilder {
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_run_cache::CreateRunCacheOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_run_cache::CreateRunCacheError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_run_cache();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateRunCache`.
24///
25/// <p>You can create a run cache to save the task outputs from completed tasks in a run for a private workflow. Subsequent runs use the task outputs from the cache, rather than computing the task outputs again. You specify an Amazon S3 location where HealthOmics saves the cached data. This data must be immediately accessible (not in an archived state).</p>
26/// <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/workflow-cache-create.html">Creating a run cache</a> in the AWS HealthOmics User Guide.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateRunCacheFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_run_cache::builders::CreateRunCacheInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_run_cache::CreateRunCacheOutput,
36        crate::operation::create_run_cache::CreateRunCacheError,
37    > for CreateRunCacheFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_run_cache::CreateRunCacheOutput,
45            crate::operation::create_run_cache::CreateRunCacheError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateRunCacheFluentBuilder {
52    /// Creates a new `CreateRunCacheFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateRunCache as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_run_cache::builders::CreateRunCacheInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_run_cache::CreateRunCacheOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_run_cache::CreateRunCacheError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_run_cache::CreateRunCache::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_run_cache::CreateRunCache::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_run_cache::CreateRunCacheOutput,
98        crate::operation::create_run_cache::CreateRunCacheError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>Default cache behavior for runs that use this cache. Supported values are:</p>
113    /// <p><code>CACHE_ON_FAILURE</code>: Caches task outputs from completed tasks for runs that fail. This setting is useful if you're debugging a workflow that fails after several tasks completed successfully. The subsequent run uses the cache outputs for previously-completed tasks if the task definition, inputs, and container in ECR are identical to the prior run.</p>
114    /// <p><code>CACHE_ALWAYS</code>: Caches task outputs from completed tasks for all runs. This setting is useful in development mode, but do not use it in a production setting.</p>
115    /// <p>If you don't specify a value, the default behavior is CACHE_ON_FAILURE. When you start a run that uses this cache, you can override the default cache behavior.</p>
116    /// <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/how-run-cache.html#run-cache-behavior">Run cache behavior</a> in the AWS HealthOmics User Guide.</p>
117    pub fn cache_behavior(mut self, input: crate::types::CacheBehavior) -> Self {
118        self.inner = self.inner.cache_behavior(input);
119        self
120    }
121    /// <p>Default cache behavior for runs that use this cache. Supported values are:</p>
122    /// <p><code>CACHE_ON_FAILURE</code>: Caches task outputs from completed tasks for runs that fail. This setting is useful if you're debugging a workflow that fails after several tasks completed successfully. The subsequent run uses the cache outputs for previously-completed tasks if the task definition, inputs, and container in ECR are identical to the prior run.</p>
123    /// <p><code>CACHE_ALWAYS</code>: Caches task outputs from completed tasks for all runs. This setting is useful in development mode, but do not use it in a production setting.</p>
124    /// <p>If you don't specify a value, the default behavior is CACHE_ON_FAILURE. When you start a run that uses this cache, you can override the default cache behavior.</p>
125    /// <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/how-run-cache.html#run-cache-behavior">Run cache behavior</a> in the AWS HealthOmics User Guide.</p>
126    pub fn set_cache_behavior(mut self, input: ::std::option::Option<crate::types::CacheBehavior>) -> Self {
127        self.inner = self.inner.set_cache_behavior(input);
128        self
129    }
130    /// <p>Default cache behavior for runs that use this cache. Supported values are:</p>
131    /// <p><code>CACHE_ON_FAILURE</code>: Caches task outputs from completed tasks for runs that fail. This setting is useful if you're debugging a workflow that fails after several tasks completed successfully. The subsequent run uses the cache outputs for previously-completed tasks if the task definition, inputs, and container in ECR are identical to the prior run.</p>
132    /// <p><code>CACHE_ALWAYS</code>: Caches task outputs from completed tasks for all runs. This setting is useful in development mode, but do not use it in a production setting.</p>
133    /// <p>If you don't specify a value, the default behavior is CACHE_ON_FAILURE. When you start a run that uses this cache, you can override the default cache behavior.</p>
134    /// <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/how-run-cache.html#run-cache-behavior">Run cache behavior</a> in the AWS HealthOmics User Guide.</p>
135    pub fn get_cache_behavior(&self) -> &::std::option::Option<crate::types::CacheBehavior> {
136        self.inner.get_cache_behavior()
137    }
138    /// <p>Specify the S3 location for storing the cached task outputs. This data must be immediately accessible (not in an archived state).</p>
139    pub fn cache_s3_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.cache_s3_location(input.into());
141        self
142    }
143    /// <p>Specify the S3 location for storing the cached task outputs. This data must be immediately accessible (not in an archived state).</p>
144    pub fn set_cache_s3_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_cache_s3_location(input);
146        self
147    }
148    /// <p>Specify the S3 location for storing the cached task outputs. This data must be immediately accessible (not in an archived state).</p>
149    pub fn get_cache_s3_location(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_cache_s3_location()
151    }
152    /// <p>Enter a description of the run cache.</p>
153    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.description(input.into());
155        self
156    }
157    /// <p>Enter a description of the run cache.</p>
158    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_description(input);
160        self
161    }
162    /// <p>Enter a description of the run cache.</p>
163    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_description()
165    }
166    /// <p>Enter a user-friendly name for the run cache.</p>
167    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.inner = self.inner.name(input.into());
169        self
170    }
171    /// <p>Enter a user-friendly name for the run cache.</p>
172    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.inner = self.inner.set_name(input);
174        self
175    }
176    /// <p>Enter a user-friendly name for the run cache.</p>
177    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
178        self.inner.get_name()
179    }
180    /// <p>A unique request token, to ensure idempotency. If you don't specify a token, HealthOmics automatically generates a universally unique identifier (UUID) for the request.</p>
181    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.request_id(input.into());
183        self
184    }
185    /// <p>A unique request token, to ensure idempotency. If you don't specify a token, HealthOmics automatically generates a universally unique identifier (UUID) for the request.</p>
186    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.inner = self.inner.set_request_id(input);
188        self
189    }
190    /// <p>A unique request token, to ensure idempotency. If you don't specify a token, HealthOmics automatically generates a universally unique identifier (UUID) for the request.</p>
191    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_request_id()
193    }
194    ///
195    /// Adds a key-value pair to `tags`.
196    ///
197    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
198    ///
199    /// <p>Specify one or more tags to associate with this run cache.</p>
200    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.inner = self.inner.tags(k.into(), v.into());
202        self
203    }
204    /// <p>Specify one or more tags to associate with this run cache.</p>
205    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
206        self.inner = self.inner.set_tags(input);
207        self
208    }
209    /// <p>Specify one or more tags to associate with this run cache.</p>
210    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
211        self.inner.get_tags()
212    }
213    /// <p>The AWS account ID of the expected owner of the S3 bucket for the run cache. If not provided, your account ID is set as the owner of the bucket.</p>
214    pub fn cache_bucket_owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.inner = self.inner.cache_bucket_owner_id(input.into());
216        self
217    }
218    /// <p>The AWS account ID of the expected owner of the S3 bucket for the run cache. If not provided, your account ID is set as the owner of the bucket.</p>
219    pub fn set_cache_bucket_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220        self.inner = self.inner.set_cache_bucket_owner_id(input);
221        self
222    }
223    /// <p>The AWS account ID of the expected owner of the S3 bucket for the run cache. If not provided, your account ID is set as the owner of the bucket.</p>
224    pub fn get_cache_bucket_owner_id(&self) -> &::std::option::Option<::std::string::String> {
225        self.inner.get_cache_bucket_owner_id()
226    }
227}