aws_sdk_acm/waiters/
certificate_validated.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `certificate_validated` 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 CertificateValidatedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_certificate::builders::DescribeCertificateInputBuilder,
18}
19impl CertificateValidatedFluentBuilder {
20    /// Creates a new `CertificateValidatedFluentBuilder`.
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 DescribeCertificate as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_certificate::builders::DescribeCertificateInputBuilder {
29        &self.inner
30    }
31    /// Wait for `certificate_validated`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::certificate_validated::CertificateValidatedFinalPoll,
37        crate::waiters::certificate_validated::WaitUntilCertificateValidatedError,
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::describe_certificate::DescribeCertificate::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::describe_certificate::DescribeCertificateOutput,
59            &crate::operation::describe_certificate::DescribeCertificateError,
60        >| {
61            // Matches: {"output":{"path":"Certificate.DomainValidationOptions[].ValidationStatus","expected":"SUCCESS","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_certificate_edd2f3a0f91460e77(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"Certificate.DomainValidationOptions[].ValidationStatus","expected":"PENDING_VALIDATION","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_certificate_5b511d44cf4d9f812(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
68            }
69            // Matches: {"output":{"path":"Certificate.Status","expected":"FAILED","comparator":"stringEquals"}}
70            if crate::waiters::matchers::match_describe_certificate_6207b47990b355394(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72            }
73            // Matches: {"errorType":"ResourceNotFoundException"}
74            if crate::waiters::matchers::match_describe_certificate_1cce2c05524fb92d4(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::describe_certificate::DescribeCertificate::orchestrate(&runtime_plugins, input).await }
83        };
84        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
85            .min_delay(::std::time::Duration::from_secs(60))
86            .max_delay(::std::time::Duration::from_secs(120))
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 Amazon Resource Name (ARN) of the ACM certificate. The ARN must have the following form:</p>
96    /// <p><code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code></p>
97    /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
98    pub fn certificate_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.inner = self.inner.certificate_arn(input.into());
100        self
101    }
102    /// <p>The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have the following form:</p>
103    /// <p><code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code></p>
104    /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
105    pub fn set_certificate_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.inner = self.inner.set_certificate_arn(input);
107        self
108    }
109    /// <p>The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have the following form:</p>
110    /// <p><code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code></p>
111    /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>
112    pub fn get_certificate_arn(&self) -> &::std::option::Option<::std::string::String> {
113        self.inner.get_certificate_arn()
114    }
115}
116
117/// Successful return type for the `certificate_validated` waiter.
118pub type CertificateValidatedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
119    crate::operation::describe_certificate::DescribeCertificateOutput,
120    ::aws_smithy_runtime_api::client::result::SdkError<
121        crate::operation::describe_certificate::DescribeCertificateError,
122        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
123    >,
124>;
125
126/// Error type for the `certificate_validated` waiter.
127pub type WaitUntilCertificateValidatedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
128    crate::operation::describe_certificate::DescribeCertificateOutput,
129    crate::operation::describe_certificate::DescribeCertificateError,
130>;