aws_sdk_autoscaling/waiters/
group_in_service.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `group_in_service` 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 GroupInServiceFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_auto_scaling_groups::builders::DescribeAutoScalingGroupsInputBuilder,
18}
19impl GroupInServiceFluentBuilder {
20    /// Creates a new `GroupInServiceFluentBuilder`.
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 DescribeAutoScalingGroups as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_auto_scaling_groups::builders::DescribeAutoScalingGroupsInputBuilder {
29        &self.inner
30    }
31    /// Wait for `group_in_service`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::group_in_service::GroupInServiceFinalPoll,
37        crate::waiters::group_in_service::WaitUntilGroupInServiceError,
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_auto_scaling_groups::DescribeAutoScalingGroups::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_auto_scaling_groups::DescribeAutoScalingGroupsOutput,
59            &crate::operation::describe_auto_scaling_groups::DescribeAutoScalingGroupsError,
60        >| {
61            // Matches: {"output":{"path":"contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)","expected":"false","comparator":"booleanEquals"}}
62            if crate::waiters::matchers::match_describe_auto_scaling_groups_2b8809e69e59ad32a(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)","expected":"true","comparator":"booleanEquals"}}
66            if crate::waiters::matchers::match_describe_auto_scaling_groups_ab0cd1b1c8e0267b1(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
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::describe_auto_scaling_groups::DescribeAutoScalingGroups::orchestrate(&runtime_plugins, input).await }
75        };
76        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
77            .min_delay(::std::time::Duration::from_secs(15))
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    ///
88    /// Appends an item to `AutoScalingGroupNames`.
89    ///
90    /// To override the contents of this collection use [`set_auto_scaling_group_names`](Self::set_auto_scaling_group_names).
91    ///
92    /// <p>The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the <code>MaxRecords</code> property.</p>
93    /// <p>If you omit this property, all Auto Scaling groups are described.</p>
94    pub fn auto_scaling_group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.inner = self.inner.auto_scaling_group_names(input.into());
96        self
97    }
98    /// <p>The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the <code>MaxRecords</code> property.</p>
99    /// <p>If you omit this property, all Auto Scaling groups are described.</p>
100    pub fn set_auto_scaling_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
101        self.inner = self.inner.set_auto_scaling_group_names(input);
102        self
103    }
104    /// <p>The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the <code>MaxRecords</code> property.</p>
105    /// <p>If you omit this property, all Auto Scaling groups are described.</p>
106    pub fn get_auto_scaling_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
107        self.inner.get_auto_scaling_group_names()
108    }
109    /// <p>Specifies whether to include information about Amazon EC2 instances in the response. When set to <code>true</code> (default), the response includes instance details.</p>
110    pub fn include_instances(mut self, input: bool) -> Self {
111        self.inner = self.inner.include_instances(input);
112        self
113    }
114    /// <p>Specifies whether to include information about Amazon EC2 instances in the response. When set to <code>true</code> (default), the response includes instance details.</p>
115    pub fn set_include_instances(mut self, input: ::std::option::Option<bool>) -> Self {
116        self.inner = self.inner.set_include_instances(input);
117        self
118    }
119    /// <p>Specifies whether to include information about Amazon EC2 instances in the response. When set to <code>true</code> (default), the response includes instance details.</p>
120    pub fn get_include_instances(&self) -> &::std::option::Option<bool> {
121        self.inner.get_include_instances()
122    }
123    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
124    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.next_token(input.into());
126        self
127    }
128    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
129    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_next_token(input);
131        self
132    }
133    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
134    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_next_token()
136    }
137    /// <p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>
138    pub fn max_records(mut self, input: i32) -> Self {
139        self.inner = self.inner.max_records(input);
140        self
141    }
142    /// <p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>
143    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
144        self.inner = self.inner.set_max_records(input);
145        self
146    }
147    /// <p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>
148    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
149        self.inner.get_max_records()
150    }
151    ///
152    /// Appends an item to `Filters`.
153    ///
154    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
155    ///
156    /// <p>One or more filters to limit the results based on specific tags.</p>
157    pub fn filters(mut self, input: crate::types::Filter) -> Self {
158        self.inner = self.inner.filters(input);
159        self
160    }
161    /// <p>One or more filters to limit the results based on specific tags.</p>
162    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
163        self.inner = self.inner.set_filters(input);
164        self
165    }
166    /// <p>One or more filters to limit the results based on specific tags.</p>
167    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
168        self.inner.get_filters()
169    }
170}
171
172/// Successful return type for the `group_in_service` waiter.
173pub type GroupInServiceFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
174    crate::operation::describe_auto_scaling_groups::DescribeAutoScalingGroupsOutput,
175    ::aws_smithy_runtime_api::client::result::SdkError<
176        crate::operation::describe_auto_scaling_groups::DescribeAutoScalingGroupsError,
177        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
178    >,
179>;
180
181/// Error type for the `group_in_service` waiter.
182pub type WaitUntilGroupInServiceError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
183    crate::operation::describe_auto_scaling_groups::DescribeAutoScalingGroupsOutput,
184    crate::operation::describe_auto_scaling_groups::DescribeAutoScalingGroupsError,
185>;