aws_sdk_omics/waiters/
workflow_version_active.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `workflow_version_active` waiter.
5///
6/// This builder is intended to be used similar to the other fluent builders for
7/// normal operations on the client. However, instead of a `send` method, it has
8/// a `wait` method that takes a maximum amount of time to wait.
9///
10/// Construct this fluent builder using the client by importing the
11/// [`Waiters`](crate::client::Waiters) trait and calling the methods
12/// prefixed with `wait_until`.
13///
14#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct WorkflowVersionActiveFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::get_workflow_version::builders::GetWorkflowVersionInputBuilder,
18}
19impl WorkflowVersionActiveFluentBuilder {
20    /// Creates a new `WorkflowVersionActiveFluentBuilder`.
21    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
22        Self {
23            handle,
24            inner: ::std::default::Default::default(),
25        }
26    }
27    /// Access the GetWorkflowVersion as a reference.
28    pub fn as_input(&self) -> &crate::operation::get_workflow_version::builders::GetWorkflowVersionInputBuilder {
29        &self.inner
30    }
31    /// Wait until a workflow version is active.
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::workflow_version_active::WorkflowVersionActiveFinalPoll,
37        crate::waiters::workflow_version_active::WaitUntilWorkflowVersionActiveError,
38    > {
39        let input = self
40            .inner
41            .build()
42            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
43        let runtime_plugins = crate::operation::get_workflow_version::GetWorkflowVersion::operation_runtime_plugins(
44            self.handle.runtime_plugins.clone(),
45            &self.handle.conf,
46            ::std::option::Option::None,
47        )
48        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
49        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
50        let runtime_components_builder = runtime_plugins
51            .apply_client_configuration(&mut cfg)
52            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
53        let time_components = runtime_components_builder.into_time_components();
54        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
55        let time_source = time_components.time_source().expect("a time source is required by waiters");
56
57        let acceptor = move |result: ::std::result::Result<
58            &crate::operation::get_workflow_version::GetWorkflowVersionOutput,
59            &crate::operation::get_workflow_version::GetWorkflowVersionError,
60        >| {
61            // Matches: {"output":{"path":"status","expected":"ACTIVE","comparator":"stringEquals"}}
62            if crate::waiters::matchers::match_get_workflow_version_a0b9c099115634691(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"status","expected":"CREATING","comparator":"stringEquals"}}
66            if crate::waiters::matchers::match_get_workflow_version_ab538ef2e7cb9d2b4(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
68            }
69            // Matches: {"output":{"path":"status","expected":"UPDATING","comparator":"stringEquals"}}
70            if crate::waiters::matchers::match_get_workflow_version_45c85fb7765d90d16(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
72            }
73            // Matches: {"output":{"path":"status","expected":"FAILED","comparator":"stringEquals"}}
74            if crate::waiters::matchers::match_get_workflow_version_f9c483f08ce8cb218(result) {
75                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
76            }
77            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
78        };
79        let operation = move || {
80            let input = input.clone();
81            let runtime_plugins = runtime_plugins.clone();
82            async move { crate::operation::get_workflow_version::GetWorkflowVersion::orchestrate(&runtime_plugins, input).await }
83        };
84        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
85            .min_delay(::std::time::Duration::from_secs(3))
86            .max_delay(::std::time::Duration::from_secs(30))
87            .max_wait(max_wait)
88            .time_source(time_source)
89            .sleep_impl(sleep_impl)
90            .acceptor(acceptor)
91            .operation(operation)
92            .build();
93        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
94    }
95    /// <p>The workflow's ID. The <code>workflowId</code> is not the UUID.</p>
96    pub fn workflow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.inner = self.inner.workflow_id(input.into());
98        self
99    }
100    /// <p>The workflow's ID. The <code>workflowId</code> is not the UUID.</p>
101    pub fn set_workflow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.inner = self.inner.set_workflow_id(input);
103        self
104    }
105    /// <p>The workflow's ID. The <code>workflowId</code> is not the UUID.</p>
106    pub fn get_workflow_id(&self) -> &::std::option::Option<::std::string::String> {
107        self.inner.get_workflow_id()
108    }
109    /// <p>The workflow version name.</p>
110    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.inner = self.inner.version_name(input.into());
112        self
113    }
114    /// <p>The workflow version name.</p>
115    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.inner = self.inner.set_version_name(input);
117        self
118    }
119    /// <p>The workflow version name.</p>
120    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
121        self.inner.get_version_name()
122    }
123    /// <p>The workflow's type.</p>
124    pub fn r#type(mut self, input: crate::types::WorkflowType) -> Self {
125        self.inner = self.inner.r#type(input);
126        self
127    }
128    /// <p>The workflow's type.</p>
129    pub fn set_type(mut self, input: ::std::option::Option<crate::types::WorkflowType>) -> Self {
130        self.inner = self.inner.set_type(input);
131        self
132    }
133    /// <p>The workflow's type.</p>
134    pub fn get_type(&self) -> &::std::option::Option<crate::types::WorkflowType> {
135        self.inner.get_type()
136    }
137    ///
138    /// Appends an item to `export`.
139    ///
140    /// To override the contents of this collection use [`set_export`](Self::set_export).
141    ///
142    /// <p>The export format for the workflow.</p>
143    pub fn export(mut self, input: crate::types::WorkflowExport) -> Self {
144        self.inner = self.inner.export(input);
145        self
146    }
147    /// <p>The export format for the workflow.</p>
148    pub fn set_export(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowExport>>) -> Self {
149        self.inner = self.inner.set_export(input);
150        self
151    }
152    /// <p>The export format for the workflow.</p>
153    pub fn get_export(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WorkflowExport>> {
154        self.inner.get_export()
155    }
156    /// <p>The 12-digit account ID of the workflow owner. The workflow owner ID can be retrieved using the <code>GetShare</code> API operation. If you are the workflow owner, you do not need to include this ID.</p>
157    pub fn workflow_owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.workflow_owner_id(input.into());
159        self
160    }
161    /// <p>The 12-digit account ID of the workflow owner. The workflow owner ID can be retrieved using the <code>GetShare</code> API operation. If you are the workflow owner, you do not need to include this ID.</p>
162    pub fn set_workflow_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_workflow_owner_id(input);
164        self
165    }
166    /// <p>The 12-digit account ID of the workflow owner. The workflow owner ID can be retrieved using the <code>GetShare</code> API operation. If you are the workflow owner, you do not need to include this ID.</p>
167    pub fn get_workflow_owner_id(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_workflow_owner_id()
169    }
170}
171
172/// Successful return type for the `workflow_version_active` waiter.
173pub type WorkflowVersionActiveFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
174    crate::operation::get_workflow_version::GetWorkflowVersionOutput,
175    ::aws_smithy_runtime_api::client::result::SdkError<
176        crate::operation::get_workflow_version::GetWorkflowVersionError,
177        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
178    >,
179>;
180
181/// Error type for the `workflow_version_active` waiter.
182pub type WaitUntilWorkflowVersionActiveError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
183    crate::operation::get_workflow_version::GetWorkflowVersionOutput,
184    crate::operation::get_workflow_version::GetWorkflowVersionError,
185>;