aws_sdk_ec2/waiters/
security_group_vpc_association_disassociated.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `security_group_vpc_association_disassociated` 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 SecurityGroupVpcAssociationDisassociatedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_security_group_vpc_associations::builders::DescribeSecurityGroupVpcAssociationsInputBuilder,
18}
19impl SecurityGroupVpcAssociationDisassociatedFluentBuilder {
20    /// Creates a new `SecurityGroupVpcAssociationDisassociatedFluentBuilder`.
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 DescribeSecurityGroupVpcAssociations as a reference.
28    pub fn as_input(
29        &self,
30    ) -> &crate::operation::describe_security_group_vpc_associations::builders::DescribeSecurityGroupVpcAssociationsInputBuilder {
31        &self.inner
32    }
33    /// Wait for `security_group_vpc_association_disassociated`
34    pub async fn wait(
35        self,
36        max_wait: ::std::time::Duration,
37    ) -> ::std::result::Result<
38        crate::waiters::security_group_vpc_association_disassociated::SecurityGroupVpcAssociationDisassociatedFinalPoll,
39        crate::waiters::security_group_vpc_association_disassociated::WaitUntilSecurityGroupVpcAssociationDisassociatedError,
40    > {
41        let input = self
42            .inner
43            .build()
44            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
45        let runtime_plugins =
46            crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociations::operation_runtime_plugins(
47                self.handle.runtime_plugins.clone(),
48                &self.handle.conf,
49                ::std::option::Option::None,
50            )
51            .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
52        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
53        let runtime_components_builder = runtime_plugins
54            .apply_client_configuration(&mut cfg)
55            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
56        let time_components = runtime_components_builder.into_time_components();
57        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
58        let time_source = time_components.time_source().expect("a time source is required by waiters");
59
60        let acceptor = move |result: ::std::result::Result<
61            &crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsOutput,
62            &crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsError,
63        >| {
64            // Matches: {"output":{"path":"SecurityGroupVpcAssociations[].State","expected":"disassociated","comparator":"allStringEquals"}}
65            if crate::waiters::matchers::match_describe_security_group_vpc_associations_fbd4d7a53fc8bbc73(result) {
66                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
67            }
68            // Matches: {"output":{"path":"SecurityGroupVpcAssociations[].State","expected":"disassociating","comparator":"anyStringEquals"}}
69            if crate::waiters::matchers::match_describe_security_group_vpc_associations_1e8485cf2019c71c7(result) {
70                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
71            }
72            // Matches: {"output":{"path":"SecurityGroupVpcAssociations[].State","expected":"disassociation-failed","comparator":"anyStringEquals"}}
73            if crate::waiters::matchers::match_describe_security_group_vpc_associations_3dceeb9fd052c4973(result) {
74                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
75            }
76            // Matches: {"output":{"path":"length(SecurityGroupVpcAssociations[]) == `0`","expected":"true","comparator":"booleanEquals"}}
77            if crate::waiters::matchers::match_describe_security_group_vpc_associations_9eb23410274361fd5(result) {
78                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
79            }
80            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
81        };
82        let operation = move || {
83            let input = input.clone();
84            let runtime_plugins = runtime_plugins.clone();
85            async move {
86                crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociations::orchestrate(&runtime_plugins, input)
87                    .await
88            }
89        };
90        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
91            .min_delay(::std::time::Duration::from_secs(10))
92            .max_delay(::std::time::Duration::from_secs(120))
93            .max_wait(max_wait)
94            .time_source(time_source)
95            .sleep_impl(sleep_impl)
96            .acceptor(acceptor)
97            .operation(operation)
98            .build();
99        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
100    }
101    ///
102    /// Appends an item to `Filters`.
103    ///
104    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
105    ///
106    /// <p>Security group VPC association filters.</p>
107    /// <ul>
108    /// <li>
109    /// <p><code>group-id</code>: The security group ID.</p></li>
110    /// <li>
111    /// <p><code>group-owner-id</code>: The group owner ID.</p></li>
112    /// <li>
113    /// <p><code>state</code>: The state of the association.</p></li>
114    /// <li>
115    /// <p><code>vpc-id</code>: The ID of the associated VPC.</p></li>
116    /// <li>
117    /// <p><code>vpc-owner-id</code>: The account ID of the VPC owner.</p></li>
118    /// </ul>
119    pub fn filters(mut self, input: crate::types::Filter) -> Self {
120        self.inner = self.inner.filters(input);
121        self
122    }
123    /// <p>Security group VPC association filters.</p>
124    /// <ul>
125    /// <li>
126    /// <p><code>group-id</code>: The security group ID.</p></li>
127    /// <li>
128    /// <p><code>group-owner-id</code>: The group owner ID.</p></li>
129    /// <li>
130    /// <p><code>state</code>: The state of the association.</p></li>
131    /// <li>
132    /// <p><code>vpc-id</code>: The ID of the associated VPC.</p></li>
133    /// <li>
134    /// <p><code>vpc-owner-id</code>: The account ID of the VPC owner.</p></li>
135    /// </ul>
136    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
137        self.inner = self.inner.set_filters(input);
138        self
139    }
140    /// <p>Security group VPC association filters.</p>
141    /// <ul>
142    /// <li>
143    /// <p><code>group-id</code>: The security group ID.</p></li>
144    /// <li>
145    /// <p><code>group-owner-id</code>: The group owner ID.</p></li>
146    /// <li>
147    /// <p><code>state</code>: The state of the association.</p></li>
148    /// <li>
149    /// <p><code>vpc-id</code>: The ID of the associated VPC.</p></li>
150    /// <li>
151    /// <p><code>vpc-owner-id</code>: The account ID of the VPC owner.</p></li>
152    /// </ul>
153    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
154        self.inner.get_filters()
155    }
156    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
157    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.next_token(input.into());
159        self
160    }
161    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
162    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_next_token(input);
164        self
165    }
166    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
167    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_next_token()
169    }
170    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
171    pub fn max_results(mut self, input: i32) -> Self {
172        self.inner = self.inner.max_results(input);
173        self
174    }
175    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
176    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
177        self.inner = self.inner.set_max_results(input);
178        self
179    }
180    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
181    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
182        self.inner.get_max_results()
183    }
184    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
185    pub fn dry_run(mut self, input: bool) -> Self {
186        self.inner = self.inner.dry_run(input);
187        self
188    }
189    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
190    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
191        self.inner = self.inner.set_dry_run(input);
192        self
193    }
194    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
195    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
196        self.inner.get_dry_run()
197    }
198}
199
200/// Successful return type for the `security_group_vpc_association_disassociated` waiter.
201pub type SecurityGroupVpcAssociationDisassociatedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
202    crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsOutput,
203    ::aws_smithy_runtime_api::client::result::SdkError<
204        crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsError,
205        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
206    >,
207>;
208
209/// Error type for the `security_group_vpc_association_disassociated` waiter.
210pub type WaitUntilSecurityGroupVpcAssociationDisassociatedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
211    crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsOutput,
212    crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsError,
213>;