aws-sdk-ecr 1.105.0

AWS SDK for Amazon Elastic Container Registry
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

///
/// Fluent builder for the `lifecycle_policy_preview_complete` waiter.
///
/// This builder is intended to be used similar to the other fluent builders for
/// normal operations on the client. However, instead of a `send` method, it has
/// a `wait` method that takes a maximum amount of time to wait.
///
/// Construct this fluent builder using the client by importing the
/// [`Waiters`](crate::client::Waiters) trait and calling the methods
/// prefixed with `wait_until`.
///
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct LifecyclePolicyPreviewCompleteFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_lifecycle_policy_preview::builders::GetLifecyclePolicyPreviewInputBuilder,
}
impl LifecyclePolicyPreviewCompleteFluentBuilder {
    /// Creates a new `LifecyclePolicyPreviewCompleteFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
        }
    }
    /// Access the GetLifecyclePolicyPreview as a reference.
    pub fn as_input(&self) -> &crate::operation::get_lifecycle_policy_preview::builders::GetLifecyclePolicyPreviewInputBuilder {
        &self.inner
    }
    /// Wait until a lifecycle policy preview request is complete and results can be accessed
    pub async fn wait(
        self,
        max_wait: ::std::time::Duration,
    ) -> ::std::result::Result<
        crate::waiters::lifecycle_policy_preview_complete::LifecyclePolicyPreviewCompleteFinalPoll,
        crate::waiters::lifecycle_policy_preview_complete::WaitUntilLifecyclePolicyPreviewCompleteError,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
        let runtime_plugins = crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreview::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            ::std::option::Option::None,
        )
        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
        let runtime_components_builder = runtime_plugins
            .apply_client_configuration(&mut cfg)
            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
        let time_components = runtime_components_builder.into_time_components();
        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
        let time_source = time_components.time_source().expect("a time source is required by waiters");

        let acceptor = move |result: ::std::result::Result<
            &crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewOutput,
            &crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewError,
        >| {
            // Matches: {"output":{"path":"status","expected":"COMPLETE","comparator":"stringEquals"}}
            if crate::waiters::matchers::match_get_lifecycle_policy_preview_757237db6f4c6e630(result) {
                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
            }
            // Matches: {"output":{"path":"status","expected":"FAILED","comparator":"stringEquals"}}
            if crate::waiters::matchers::match_get_lifecycle_policy_preview_f9c483f08ce8cb218(result) {
                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
            }
            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
        };
        let operation = move || {
            let input = input.clone();
            let runtime_plugins = runtime_plugins.clone();
            async move { crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreview::orchestrate(&runtime_plugins, input).await }
        };
        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
            .min_delay(::std::time::Duration::from_secs(5))
            .max_delay(::std::time::Duration::from_secs(120))
            .max_wait(max_wait)
            .time_source(time_source)
            .sleep_impl(sleep_impl)
            .acceptor(acceptor)
            .operation(operation)
            .build();
        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
    }
    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
    pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.registry_id(input.into());
        self
    }
    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
    pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_registry_id(input);
        self
    }
    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.</p>
    pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_registry_id()
    }
    /// <p>The name of the repository.</p>
    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.repository_name(input.into());
        self
    }
    /// <p>The name of the repository.</p>
    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_repository_name(input);
        self
    }
    /// <p>The name of the repository.</p>
    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_repository_name()
    }
    ///
    /// Appends an item to `imageIds`.
    ///
    /// To override the contents of this collection use [`set_image_ids`](Self::set_image_ids).
    ///
    /// <p>The list of imageIDs to be included.</p>
    pub fn image_ids(mut self, input: crate::types::ImageIdentifier) -> Self {
        self.inner = self.inner.image_ids(input);
        self
    }
    /// <p>The list of imageIDs to be included.</p>
    pub fn set_image_ids(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImageIdentifier>>) -> Self {
        self.inner = self.inner.set_image_ids(input);
        self
    }
    /// <p>The list of imageIDs to be included.</p>
    pub fn get_image_ids(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageIdentifier>> {
        self.inner.get_image_ids()
    }
    /// <p>The <code>nextToken</code> value returned from a previous paginated
 <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code> was used and the
 results exceeded the value of that parameter. Pagination continues from the end of the
 previous results that returned the <code>nextToken</code> value. This value is
 <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_token(input.into());
        self
    }
    /// <p>The <code>nextToken</code> value returned from a previous paginated
 <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code> was used and the
 results exceeded the value of that parameter. Pagination continues from the end of the
 previous results that returned the <code>nextToken</code> value. This value is
 <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_token(input);
        self
    }
    /// <p>The <code>nextToken</code> value returned from a previous paginated
 <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code> was used and the
 results exceeded the value of that parameter. Pagination continues from the end of the
 previous results that returned the <code>nextToken</code> value. This value is
 <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_token()
    }
    /// <p>The maximum number of repository results returned by <code>GetLifecyclePolicyPreviewRequest</code> in
 paginated output. When this parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns
 <code>maxResults</code> results in a single page along with a <code>nextToken</code>
 response element. The remaining results of the initial request can be seen by sending
 another <code>GetLifecyclePolicyPreviewRequest</code> request with the returned <code>nextToken</code>
 value. This value can be between 1 and 100. If this
 parameter is not used, then <code>GetLifecyclePolicyPreviewRequest</code> returns up to
100 results and a <code>nextToken</code> value, if
 applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.inner = self.inner.max_results(input);
        self
    }
    /// <p>The maximum number of repository results returned by <code>GetLifecyclePolicyPreviewRequest</code> in
 paginated output. When this parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns
 <code>maxResults</code> results in a single page along with a <code>nextToken</code>
 response element. The remaining results of the initial request can be seen by sending
 another <code>GetLifecyclePolicyPreviewRequest</code> request with the returned <code>nextToken</code>
 value. This value can be between 1 and 100. If this
 parameter is not used, then <code>GetLifecyclePolicyPreviewRequest</code> returns up to
100 results and a <code>nextToken</code> value, if
 applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_results(input);
        self
    }
    /// <p>The maximum number of repository results returned by <code>GetLifecyclePolicyPreviewRequest</code> in
 paginated output. When this parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns
 <code>maxResults</code> results in a single page along with a <code>nextToken</code>
 response element. The remaining results of the initial request can be seen by sending
 another <code>GetLifecyclePolicyPreviewRequest</code> request with the returned <code>nextToken</code>
 value. This value can be between 1 and 100. If this
 parameter is not used, then <code>GetLifecyclePolicyPreviewRequest</code> returns up to
100 results and a <code>nextToken</code> value, if
 applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_results()
    }
    /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
    pub fn filter(mut self, input: crate::types::LifecyclePolicyPreviewFilter) -> Self {
        self.inner = self.inner.filter(input);
        self
    }
    /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::LifecyclePolicyPreviewFilter>) -> Self {
        self.inner = self.inner.set_filter(input);
        self
    }
    /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
    pub fn get_filter(&self) -> &::std::option::Option<crate::types::LifecyclePolicyPreviewFilter> {
        self.inner.get_filter()
    }
}

/// Successful return type for the `lifecycle_policy_preview_complete` waiter.
pub type LifecyclePolicyPreviewCompleteFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
    crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewOutput,
    ::aws_smithy_runtime_api::client::result::SdkError<
        crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewError,
        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
    >,
>;

/// Error type for the `lifecycle_policy_preview_complete` waiter.
pub type WaitUntilLifecyclePolicyPreviewCompleteError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
    crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewOutput,
    crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewError,
>;