aws_sdk_ec2/waiters/security_group_vpc_association_associated.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_associated` 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 SecurityGroupVpcAssociationAssociatedFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::describe_security_group_vpc_associations::builders::DescribeSecurityGroupVpcAssociationsInputBuilder,
18}
19impl SecurityGroupVpcAssociationAssociatedFluentBuilder {
20 /// Creates a new `SecurityGroupVpcAssociationAssociatedFluentBuilder`.
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_associated`
34 pub async fn wait(
35 self,
36 max_wait: ::std::time::Duration,
37 ) -> ::std::result::Result<
38 crate::waiters::security_group_vpc_association_associated::SecurityGroupVpcAssociationAssociatedFinalPoll,
39 crate::waiters::security_group_vpc_association_associated::WaitUntilSecurityGroupVpcAssociationAssociatedError,
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":"associated","comparator":"allStringEquals"}}
65 if crate::waiters::matchers::match_describe_security_group_vpc_associations_05a126fd150c44e3d(result) {
66 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
67 }
68 // Matches: {"output":{"path":"SecurityGroupVpcAssociations[].State","expected":"associating","comparator":"anyStringEquals"}}
69 if crate::waiters::matchers::match_describe_security_group_vpc_associations_de185f5a68fb264b0(result) {
70 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
71 }
72 // Matches: {"output":{"path":"SecurityGroupVpcAssociations[].State","expected":"association-failed","comparator":"anyStringEquals"}}
73 if crate::waiters::matchers::match_describe_security_group_vpc_associations_479ea6c443eaa25e7(result) {
74 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
75 }
76 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
77 };
78 let operation = move || {
79 let input = input.clone();
80 let runtime_plugins = runtime_plugins.clone();
81 async move {
82 crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociations::orchestrate(&runtime_plugins, input)
83 .await
84 }
85 };
86 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
87 .min_delay(::std::time::Duration::from_secs(10))
88 .max_delay(::std::time::Duration::from_secs(120))
89 .max_wait(max_wait)
90 .time_source(time_source)
91 .sleep_impl(sleep_impl)
92 .acceptor(acceptor)
93 .operation(operation)
94 .build();
95 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
96 }
97 ///
98 /// Appends an item to `Filters`.
99 ///
100 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
101 ///
102 /// <p>Security group VPC association filters.</p>
103 /// <ul>
104 /// <li>
105 /// <p><code>group-id</code>: The security group ID.</p></li>
106 /// <li>
107 /// <p><code>group-owner-id</code>: The group owner ID.</p></li>
108 /// <li>
109 /// <p><code>state</code>: The state of the association.</p></li>
110 /// <li>
111 /// <p><code>vpc-id</code>: The ID of the associated VPC.</p></li>
112 /// <li>
113 /// <p><code>vpc-owner-id</code>: The account ID of the VPC owner.</p></li>
114 /// </ul>
115 pub fn filters(mut self, input: crate::types::Filter) -> Self {
116 self.inner = self.inner.filters(input);
117 self
118 }
119 /// <p>Security group VPC association filters.</p>
120 /// <ul>
121 /// <li>
122 /// <p><code>group-id</code>: The security group ID.</p></li>
123 /// <li>
124 /// <p><code>group-owner-id</code>: The group owner ID.</p></li>
125 /// <li>
126 /// <p><code>state</code>: The state of the association.</p></li>
127 /// <li>
128 /// <p><code>vpc-id</code>: The ID of the associated VPC.</p></li>
129 /// <li>
130 /// <p><code>vpc-owner-id</code>: The account ID of the VPC owner.</p></li>
131 /// </ul>
132 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
133 self.inner = self.inner.set_filters(input);
134 self
135 }
136 /// <p>Security group VPC association filters.</p>
137 /// <ul>
138 /// <li>
139 /// <p><code>group-id</code>: The security group ID.</p></li>
140 /// <li>
141 /// <p><code>group-owner-id</code>: The group owner ID.</p></li>
142 /// <li>
143 /// <p><code>state</code>: The state of the association.</p></li>
144 /// <li>
145 /// <p><code>vpc-id</code>: The ID of the associated VPC.</p></li>
146 /// <li>
147 /// <p><code>vpc-owner-id</code>: The account ID of the VPC owner.</p></li>
148 /// </ul>
149 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
150 self.inner.get_filters()
151 }
152 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
153 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.inner = self.inner.next_token(input.into());
155 self
156 }
157 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
158 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.inner = self.inner.set_next_token(input);
160 self
161 }
162 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
163 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
164 self.inner.get_next_token()
165 }
166 /// <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>
167 pub fn max_results(mut self, input: i32) -> Self {
168 self.inner = self.inner.max_results(input);
169 self
170 }
171 /// <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>
172 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
173 self.inner = self.inner.set_max_results(input);
174 self
175 }
176 /// <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>
177 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
178 self.inner.get_max_results()
179 }
180 /// <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>
181 pub fn dry_run(mut self, input: bool) -> Self {
182 self.inner = self.inner.dry_run(input);
183 self
184 }
185 /// <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>
186 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
187 self.inner = self.inner.set_dry_run(input);
188 self
189 }
190 /// <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>
191 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
192 self.inner.get_dry_run()
193 }
194}
195
196/// Successful return type for the `security_group_vpc_association_associated` waiter.
197pub type SecurityGroupVpcAssociationAssociatedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
198 crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsOutput,
199 ::aws_smithy_runtime_api::client::result::SdkError<
200 crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsError,
201 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
202 >,
203>;
204
205/// Error type for the `security_group_vpc_association_associated` waiter.
206pub type WaitUntilSecurityGroupVpcAssociationAssociatedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
207 crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsOutput,
208 crate::operation::describe_security_group_vpc_associations::DescribeSecurityGroupVpcAssociationsError,
209>;