1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! MockClient helpers for Amazon OpenSearch Service API.
//!
//! Auto-generated extension methods for ergonomic test setup.
//! **Do not edit manually** — modify the manifest and re-run codegen.
#[cfg(any(test, feature = "test-support"))]
use crate::mock_client::{ExpectationBuilder, MockClient};
/// Extension trait for MockClient with Amazon OpenSearch Service helpers.
#[cfg(any(test, feature = "test-support"))]
pub trait OpensearchMockHelpers {
/// Helper to expect `list_domain_names`: Returns the names of all Amazon OpenSearch Service
/// domains owned by the current user in the active Region.
fn expect_list_domain_names(&mut self, engine_type: &str) -> ExpectationBuilder<'_>;
/// Helper to expect `describe_domain`: Returns domain configuration information about the
/// specified Amazon OpenSearch Service domain.
fn expect_describe_domain(&mut self, domain_name: &str) -> ExpectationBuilder<'_>;
/// Helper to expect `delete_domain`: Deletes an Amazon OpenSearch Service domain and all of its
/// data.
fn expect_delete_domain(&mut self, domain_name: &str) -> ExpectationBuilder<'_>;
}
#[cfg(any(test, feature = "test-support"))]
impl OpensearchMockHelpers for MockClient {
/// Helper to expect `list_domain_names`: Returns the names of all Amazon OpenSearch Service
/// domains owned by the current user in the active Region.
fn expect_list_domain_names(
&mut self,
engine_type: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let mut path = "/2021-01-01/domain".to_string();
let mut __qp: Vec<String> = Vec::new();
if !engine_type.is_empty() {
__qp.push(format!("engineType={}", engine_type));
}
if !__qp.is_empty() {
path = format!("{}?{}", path, __qp.join("&"));
}
self.expect_get(&path)
}
/// Helper to expect `describe_domain`: Returns domain configuration information about the
/// specified Amazon OpenSearch Service domain.
fn expect_describe_domain(
&mut self,
domain_name: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let path = format!("/2021-01-01/opensearch/domain/{domain_name}");
self.expect_get(&path)
}
/// Helper to expect `delete_domain`: Deletes an Amazon OpenSearch Service domain and all of its
/// data.
fn expect_delete_domain(
&mut self,
domain_name: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let path = format!("/2021-01-01/opensearch/domain/{domain_name}");
self.expect_delete(&path)
}
}