aws_sdk_rds/waiters/tenant_database_available.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `tenant_database_available` 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 TenantDatabaseAvailableFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::describe_tenant_databases::builders::DescribeTenantDatabasesInputBuilder,
18}
19impl TenantDatabaseAvailableFluentBuilder {
20 /// Creates a new `TenantDatabaseAvailableFluentBuilder`.
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 DescribeTenantDatabases as a reference.
28 pub fn as_input(&self) -> &crate::operation::describe_tenant_databases::builders::DescribeTenantDatabasesInputBuilder {
29 &self.inner
30 }
31 /// Wait for `tenant_database_available`
32 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::tenant_database_available::TenantDatabaseAvailableFinalPoll,
37 crate::waiters::tenant_database_available::WaitUntilTenantDatabaseAvailableError,
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_tenant_databases::DescribeTenantDatabases::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_tenant_databases::DescribeTenantDatabasesOutput,
59 &crate::operation::describe_tenant_databases::DescribeTenantDatabasesError,
60 >| {
61 // Matches: {"output":{"path":"TenantDatabases[].Status","expected":"available","comparator":"allStringEquals"}}
62 if crate::waiters::matchers::match_describe_tenant_databases_3a1dbc6eb46ce3a53(result) {
63 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64 }
65 // Matches: {"output":{"path":"TenantDatabases[].Status","expected":"deleted","comparator":"anyStringEquals"}}
66 if crate::waiters::matchers::match_describe_tenant_databases_0ad44dabc6d308f78(result) {
67 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68 }
69 // Matches: {"output":{"path":"TenantDatabases[].Status","expected":"incompatible-parameters","comparator":"anyStringEquals"}}
70 if crate::waiters::matchers::match_describe_tenant_databases_bc89b71f216c7b4b6(result) {
71 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72 }
73 // Matches: {"output":{"path":"TenantDatabases[].Status","expected":"incompatible-restore","comparator":"anyStringEquals"}}
74 if crate::waiters::matchers::match_describe_tenant_databases_819020f4629ee5588(result) {
75 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
76 }
77 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
78 };
79 let operation = move || {
80 let input = input.clone();
81 let runtime_plugins = runtime_plugins.clone();
82 async move { crate::operation::describe_tenant_databases::DescribeTenantDatabases::orchestrate(&runtime_plugins, input).await }
83 };
84 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
85 .min_delay(::std::time::Duration::from_secs(30))
86 .max_delay(::std::time::Duration::from_secs(120))
87 .max_wait(max_wait)
88 .time_source(time_source)
89 .sleep_impl(sleep_impl)
90 .acceptor(acceptor)
91 .operation(operation)
92 .build();
93 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
94 }
95 /// <p>The user-supplied DB instance identifier, which must match the identifier of an existing instance owned by the Amazon Web Services account. This parameter isn't case-sensitive.</p>
96 pub fn db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.inner = self.inner.db_instance_identifier(input.into());
98 self
99 }
100 /// <p>The user-supplied DB instance identifier, which must match the identifier of an existing instance owned by the Amazon Web Services account. This parameter isn't case-sensitive.</p>
101 pub fn set_db_instance_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.inner = self.inner.set_db_instance_identifier(input);
103 self
104 }
105 /// <p>The user-supplied DB instance identifier, which must match the identifier of an existing instance owned by the Amazon Web Services account. This parameter isn't case-sensitive.</p>
106 pub fn get_db_instance_identifier(&self) -> &::std::option::Option<::std::string::String> {
107 self.inner.get_db_instance_identifier()
108 }
109 /// <p>The user-supplied tenant database name, which must match the name of an existing tenant database on the specified DB instance owned by your Amazon Web Services account. This parameter isn’t case-sensitive.</p>
110 pub fn tenant_db_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.inner = self.inner.tenant_db_name(input.into());
112 self
113 }
114 /// <p>The user-supplied tenant database name, which must match the name of an existing tenant database on the specified DB instance owned by your Amazon Web Services account. This parameter isn’t case-sensitive.</p>
115 pub fn set_tenant_db_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.inner = self.inner.set_tenant_db_name(input);
117 self
118 }
119 /// <p>The user-supplied tenant database name, which must match the name of an existing tenant database on the specified DB instance owned by your Amazon Web Services account. This parameter isn’t case-sensitive.</p>
120 pub fn get_tenant_db_name(&self) -> &::std::option::Option<::std::string::String> {
121 self.inner.get_tenant_db_name()
122 }
123 ///
124 /// Appends an item to `Filters`.
125 ///
126 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
127 ///
128 /// <p>A filter that specifies one or more database tenants to describe.</p>
129 /// <p>Supported filters:</p>
130 /// <ul>
131 /// <li>
132 /// <p><code>tenant-db-name</code> - Tenant database names. The results list only includes information about the tenant databases that match these tenant DB names.</p></li>
133 /// <li>
134 /// <p><code>tenant-database-resource-id</code> - Tenant database resource identifiers.</p></li>
135 /// <li>
136 /// <p><code>dbi-resource-id</code> - DB instance resource identifiers. The results list only includes information about the tenants contained within the DB instances identified by these resource identifiers.</p></li>
137 /// </ul>
138 pub fn filters(mut self, input: crate::types::Filter) -> Self {
139 self.inner = self.inner.filters(input);
140 self
141 }
142 /// <p>A filter that specifies one or more database tenants to describe.</p>
143 /// <p>Supported filters:</p>
144 /// <ul>
145 /// <li>
146 /// <p><code>tenant-db-name</code> - Tenant database names. The results list only includes information about the tenant databases that match these tenant DB names.</p></li>
147 /// <li>
148 /// <p><code>tenant-database-resource-id</code> - Tenant database resource identifiers.</p></li>
149 /// <li>
150 /// <p><code>dbi-resource-id</code> - DB instance resource identifiers. The results list only includes information about the tenants contained within the DB instances identified by these resource identifiers.</p></li>
151 /// </ul>
152 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
153 self.inner = self.inner.set_filters(input);
154 self
155 }
156 /// <p>A filter that specifies one or more database tenants to describe.</p>
157 /// <p>Supported filters:</p>
158 /// <ul>
159 /// <li>
160 /// <p><code>tenant-db-name</code> - Tenant database names. The results list only includes information about the tenant databases that match these tenant DB names.</p></li>
161 /// <li>
162 /// <p><code>tenant-database-resource-id</code> - Tenant database resource identifiers.</p></li>
163 /// <li>
164 /// <p><code>dbi-resource-id</code> - DB instance resource identifiers. The results list only includes information about the tenants contained within the DB instances identified by these resource identifiers.</p></li>
165 /// </ul>
166 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
167 self.inner.get_filters()
168 }
169 /// <p>An optional pagination token provided by a previous <code>DescribeTenantDatabases</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
170 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.inner = self.inner.marker(input.into());
172 self
173 }
174 /// <p>An optional pagination token provided by a previous <code>DescribeTenantDatabases</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
175 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176 self.inner = self.inner.set_marker(input);
177 self
178 }
179 /// <p>An optional pagination token provided by a previous <code>DescribeTenantDatabases</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
180 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_marker()
182 }
183 /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so that you can retrieve the remaining results.</p>
184 pub fn max_records(mut self, input: i32) -> Self {
185 self.inner = self.inner.max_records(input);
186 self
187 }
188 /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so that you can retrieve the remaining results.</p>
189 pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
190 self.inner = self.inner.set_max_records(input);
191 self
192 }
193 /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so that you can retrieve the remaining results.</p>
194 pub fn get_max_records(&self) -> &::std::option::Option<i32> {
195 self.inner.get_max_records()
196 }
197}
198
199/// Successful return type for the `tenant_database_available` waiter.
200pub type TenantDatabaseAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
201 crate::operation::describe_tenant_databases::DescribeTenantDatabasesOutput,
202 ::aws_smithy_runtime_api::client::result::SdkError<
203 crate::operation::describe_tenant_databases::DescribeTenantDatabasesError,
204 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
205 >,
206>;
207
208/// Error type for the `tenant_database_available` waiter.
209pub type WaitUntilTenantDatabaseAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
210 crate::operation::describe_tenant_databases::DescribeTenantDatabasesOutput,
211 crate::operation::describe_tenant_databases::DescribeTenantDatabasesError,
212>;