aws_sdk_proton/waiters/
service_created.rs

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