aws_sdk_proton/waiters/
service_deleted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `service_deleted` 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 ServiceDeletedFluentBuilder {
17    handle: ::std::sync::Arc<crate::client::Handle>,
18    inner: crate::operation::get_service::builders::GetServiceInputBuilder,
19}
20impl ServiceDeletedFluentBuilder {
21    /// Creates a new `ServiceDeletedFluentBuilder`.
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 deleted after DeleteService is invoked
33    pub async fn wait(
34        self,
35        max_wait: ::std::time::Duration,
36    ) -> ::std::result::Result<crate::waiters::service_deleted::ServiceDeletedFinalPoll, crate::waiters::service_deleted::WaitUntilServiceDeletedError>
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: {"errorType":"ResourceNotFoundException"}
61            if crate::waiters::matchers::match_get_service_1cce2c05524fb92d4(result) {
62                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
63            }
64            // Matches: {"output":{"path":"service.status","expected":"DELETE_FAILED","comparator":"stringEquals"}}
65            if crate::waiters::matchers::match_get_service_2e17268fe9502816d(result) {
66                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
67            }
68            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
69        };
70        let operation = move || {
71            let input = input.clone();
72            let runtime_plugins = runtime_plugins.clone();
73            async move { crate::operation::get_service::GetService::orchestrate(&runtime_plugins, input).await }
74        };
75        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
76            .min_delay(::std::time::Duration::from_secs(5))
77            .max_delay(::std::time::Duration::from_secs(4999))
78            .max_wait(max_wait)
79            .time_source(time_source)
80            .sleep_impl(sleep_impl)
81            .acceptor(acceptor)
82            .operation(operation)
83            .build();
84        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
85    }
86    /// <p>The name of the service that you want to get the detailed data for.</p>
87    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.inner = self.inner.name(input.into());
89        self
90    }
91    /// <p>The name of the service that you want to get the detailed data for.</p>
92    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.inner = self.inner.set_name(input);
94        self
95    }
96    /// <p>The name of the service that you want to get the detailed data for.</p>
97    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
98        self.inner.get_name()
99    }
100}
101
102/// Successful return type for the `service_deleted` waiter.
103pub type ServiceDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
104    crate::operation::get_service::GetServiceOutput,
105    ::aws_smithy_runtime_api::client::result::SdkError<
106        crate::operation::get_service::GetServiceError,
107        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
108    >,
109>;
110
111/// Error type for the `service_deleted` waiter.
112pub type WaitUntilServiceDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
113    crate::operation::get_service::GetServiceOutput,
114    crate::operation::get_service::GetServiceError,
115>;