aws_sdk_ecr/waiters/lifecycle_policy_preview_complete.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `lifecycle_policy_preview_complete` 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 LifecyclePolicyPreviewCompleteFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::get_lifecycle_policy_preview::builders::GetLifecyclePolicyPreviewInputBuilder,
18}
19impl LifecyclePolicyPreviewCompleteFluentBuilder {
20 /// Creates a new `LifecyclePolicyPreviewCompleteFluentBuilder`.
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 GetLifecyclePolicyPreview as a reference.
28 pub fn as_input(&self) -> &crate::operation::get_lifecycle_policy_preview::builders::GetLifecyclePolicyPreviewInputBuilder {
29 &self.inner
30 }
31 /// Wait until a lifecycle policy preview request is complete and results can be accessed
32 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::lifecycle_policy_preview_complete::LifecyclePolicyPreviewCompleteFinalPoll,
37 crate::waiters::lifecycle_policy_preview_complete::WaitUntilLifecyclePolicyPreviewCompleteError,
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::get_lifecycle_policy_preview::GetLifecyclePolicyPreview::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::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewOutput,
59 &crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewError,
60 >| {
61 // Matches: {"output":{"path":"status","expected":"COMPLETE","comparator":"stringEquals"}}
62 if crate::waiters::matchers::match_get_lifecycle_policy_preview_757237db6f4c6e630(result) {
63 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64 }
65 // Matches: {"output":{"path":"status","expected":"FAILED","comparator":"stringEquals"}}
66 if crate::waiters::matchers::match_get_lifecycle_policy_preview_f9c483f08ce8cb218(result) {
67 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68 }
69 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
70 };
71 let operation = move || {
72 let input = input.clone();
73 let runtime_plugins = runtime_plugins.clone();
74 async move { crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreview::orchestrate(&runtime_plugins, input).await }
75 };
76 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
77 .min_delay(::std::time::Duration::from_secs(5))
78 .max_delay(::std::time::Duration::from_secs(120))
79 .max_wait(max_wait)
80 .time_source(time_source)
81 .sleep_impl(sleep_impl)
82 .acceptor(acceptor)
83 .operation(operation)
84 .build();
85 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
86 }
87 /// <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>
88 pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.inner = self.inner.registry_id(input.into());
90 self
91 }
92 /// <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>
93 pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.inner = self.inner.set_registry_id(input);
95 self
96 }
97 /// <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>
98 pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
99 self.inner.get_registry_id()
100 }
101 /// <p>The name of the repository.</p>
102 pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.inner = self.inner.repository_name(input.into());
104 self
105 }
106 /// <p>The name of the repository.</p>
107 pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.inner = self.inner.set_repository_name(input);
109 self
110 }
111 /// <p>The name of the repository.</p>
112 pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
113 self.inner.get_repository_name()
114 }
115 ///
116 /// Appends an item to `imageIds`.
117 ///
118 /// To override the contents of this collection use [`set_image_ids`](Self::set_image_ids).
119 ///
120 /// <p>The list of imageIDs to be included.</p>
121 pub fn image_ids(mut self, input: crate::types::ImageIdentifier) -> Self {
122 self.inner = self.inner.image_ids(input);
123 self
124 }
125 /// <p>The list of imageIDs to be included.</p>
126 pub fn set_image_ids(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImageIdentifier>>) -> Self {
127 self.inner = self.inner.set_image_ids(input);
128 self
129 }
130 /// <p>The list of imageIDs to be included.</p>
131 pub fn get_image_ids(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageIdentifier>> {
132 self.inner.get_image_ids()
133 }
134 /// <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>
135 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.next_token(input.into());
137 self
138 }
139 /// <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>
140 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_next_token(input);
142 self
143 }
144 /// <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>
145 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_next_token()
147 }
148 /// <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>
149 pub fn max_results(mut self, input: i32) -> Self {
150 self.inner = self.inner.max_results(input);
151 self
152 }
153 /// <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>
154 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
155 self.inner = self.inner.set_max_results(input);
156 self
157 }
158 /// <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>
159 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
160 self.inner.get_max_results()
161 }
162 /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
163 pub fn filter(mut self, input: crate::types::LifecyclePolicyPreviewFilter) -> Self {
164 self.inner = self.inner.filter(input);
165 self
166 }
167 /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
168 pub fn set_filter(mut self, input: ::std::option::Option<crate::types::LifecyclePolicyPreviewFilter>) -> Self {
169 self.inner = self.inner.set_filter(input);
170 self
171 }
172 /// <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>
173 pub fn get_filter(&self) -> &::std::option::Option<crate::types::LifecyclePolicyPreviewFilter> {
174 self.inner.get_filter()
175 }
176}
177
178/// Successful return type for the `lifecycle_policy_preview_complete` waiter.
179pub type LifecyclePolicyPreviewCompleteFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
180 crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewOutput,
181 ::aws_smithy_runtime_api::client::result::SdkError<
182 crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewError,
183 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
184 >,
185>;
186
187/// Error type for the `lifecycle_policy_preview_complete` waiter.
188pub type WaitUntilLifecyclePolicyPreviewCompleteError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
189 crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewOutput,
190 crate::operation::get_lifecycle_policy_preview::GetLifecyclePolicyPreviewError,
191>;