aws_sdk_proton/waiters/
service_updated.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `service_updated` 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#[deprecated(note = "AWS Proton is not accepting new customers.", since = "10/07/2025")]
15#[derive(::std::clone::Clone, ::std::fmt::Debug)]
16pub struct ServiceUpdatedFluentBuilder {
17    handle: ::std::sync::Arc<crate::client::Handle>,
18    inner: crate::operation::get_service::builders::GetServiceInputBuilder,
19}
20impl ServiceUpdatedFluentBuilder {
21    /// Creates a new `ServiceUpdatedFluentBuilder`.
22    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
23        Self {
24            handle,
25            inner: ::std::default::Default::default(),
26        }
27    }
28    /// Access the GetService as a reference.
29    pub fn as_input(&self) -> &crate::operation::get_service::builders::GetServiceInputBuilder {
30        &self.inner
31    }
32    /// Wait until a Service, its instances, and possibly pipeline have been deployed after UpdateService is invoked
33    pub async fn wait(
34        self,
35        max_wait: ::std::time::Duration,
36    ) -> ::std::result::Result<crate::waiters::service_updated::ServiceUpdatedFinalPoll, crate::waiters::service_updated::WaitUntilServiceUpdatedError>
37    {
38        let input = self
39            .inner
40            .build()
41            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
42        let runtime_plugins = crate::operation::get_service::GetService::operation_runtime_plugins(
43            self.handle.runtime_plugins.clone(),
44            &self.handle.conf,
45            ::std::option::Option::None,
46        )
47        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
48        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
49        let runtime_components_builder = runtime_plugins
50            .apply_client_configuration(&mut cfg)
51            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
52        let time_components = runtime_components_builder.into_time_components();
53        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
54        let time_source = time_components.time_source().expect("a time source is required by waiters");
55
56        let acceptor = move |result: ::std::result::Result<
57            &crate::operation::get_service::GetServiceOutput,
58            &crate::operation::get_service::GetServiceError,
59        >| {
60            // Matches: {"output":{"path":"service.status","expected":"ACTIVE","comparator":"stringEquals"}}
61            if crate::waiters::matchers::match_get_service_2fa8e698c4f041742(result) {
62                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
63            }
64            // Matches: {"output":{"path":"service.status","expected":"UPDATE_FAILED_CLEANUP_COMPLETE","comparator":"stringEquals"}}
65            if crate::waiters::matchers::match_get_service_4db8e3fbb4b0e28e9(result) {
66                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
67            }
68            // Matches: {"output":{"path":"service.status","expected":"UPDATE_FAILED_CLEANUP_FAILED","comparator":"stringEquals"}}
69            if crate::waiters::matchers::match_get_service_1c25d8f6b67efecce(result) {
70                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
71            }
72            // Matches: {"output":{"path":"service.status","expected":"UPDATE_FAILED","comparator":"stringEquals"}}
73            if crate::waiters::matchers::match_get_service_6310802c4721a37d3(result) {
74                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
75            }
76            // Matches: {"output":{"path":"service.status","expected":"UPDATE_COMPLETE_CLEANUP_FAILED","comparator":"stringEquals"}}
77            if crate::waiters::matchers::match_get_service_55d0862750015e99e(result) {
78                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
79            }
80            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
81        };
82        let operation = move || {
83            let input = input.clone();
84            let runtime_plugins = runtime_plugins.clone();
85            async move { crate::operation::get_service::GetService::orchestrate(&runtime_plugins, input).await }
86        };
87        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
88            .min_delay(::std::time::Duration::from_secs(5))
89            .max_delay(::std::time::Duration::from_secs(4999))
90            .max_wait(max_wait)
91            .time_source(time_source)
92            .sleep_impl(sleep_impl)
93            .acceptor(acceptor)
94            .operation(operation)
95            .build();
96        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
97    }
98    /// <p>The name of the service that you want to get the detailed data for.</p>
99    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.inner = self.inner.name(input.into());
101        self
102    }
103    /// <p>The name of the service that you want to get the detailed data for.</p>
104    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.inner = self.inner.set_name(input);
106        self
107    }
108    /// <p>The name of the service that you want to get the detailed data for.</p>
109    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
110        self.inner.get_name()
111    }
112}
113
114/// Successful return type for the `service_updated` waiter.
115pub type ServiceUpdatedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
116    crate::operation::get_service::GetServiceOutput,
117    ::aws_smithy_runtime_api::client::result::SdkError<
118        crate::operation::get_service::GetServiceError,
119        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
120    >,
121>;
122
123/// Error type for the `service_updated` waiter.
124pub type WaitUntilServiceUpdatedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
125    crate::operation::get_service::GetServiceOutput,
126    crate::operation::get_service::GetServiceError,
127>;