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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! MockClient helpers for Amazon Elastic Kubernetes 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 Elastic Kubernetes Service helpers.
#[cfg(any(test, feature = "test-support"))]
pub trait EksMockHelpers {
/// Helper to expect `describe_cluster`: Returns descriptive information about an Amazon EKS
/// cluster.
fn expect_describe_cluster(&mut self, name: &str) -> ExpectationBuilder<'_>;
/// Helper to expect `list_nodegroups`: Lists the managed node groups associated with the
/// specified cluster.
fn expect_list_nodegroups(
&mut self,
name: &str,
max_results: &str,
next_token: &str,
) -> ExpectationBuilder<'_>;
/// Helper to expect `describe_nodegroup`: Returns descriptive information about an Amazon EKS
/// node group.
fn expect_describe_nodegroup(
&mut self,
name: &str,
nodegroup_name: &str,
) -> ExpectationBuilder<'_>;
/// Helper to expect `update_nodegroup_config`: Updates an Amazon EKS managed node group
/// configuration.
fn expect_update_nodegroup_config(
&mut self,
name: &str,
nodegroup_name: &str,
) -> ExpectationBuilder<'_>;
}
#[cfg(any(test, feature = "test-support"))]
impl EksMockHelpers for MockClient {
/// Helper to expect `describe_cluster`: Returns descriptive information about an Amazon EKS
/// cluster.
fn expect_describe_cluster(
&mut self,
name: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let path = format!("/clusters/{name}");
self.expect_get(&path)
}
/// Helper to expect `list_nodegroups`: Lists the managed node groups associated with the
/// specified cluster.
fn expect_list_nodegroups(
&mut self,
name: &str,
max_results: &str,
next_token: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let mut path = format!("/clusters/{name}/node-groups");
let mut __qp: Vec<String> = Vec::new();
if !max_results.is_empty() {
__qp.push(format!("maxResults={}", max_results));
}
if !next_token.is_empty() {
__qp.push(format!("nextToken={}", next_token));
}
if !__qp.is_empty() {
path = format!("{}?{}", path, __qp.join("&"));
}
self.expect_get(&path)
}
/// Helper to expect `describe_nodegroup`: Returns descriptive information about an Amazon EKS
/// node group.
fn expect_describe_nodegroup(
&mut self,
name: &str,
nodegroup_name: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let path = format!("/clusters/{name}/node-groups/{nodegroup_name}");
self.expect_get(&path)
}
/// Helper to expect `update_nodegroup_config`: Updates an Amazon EKS managed node group
/// configuration.
fn expect_update_nodegroup_config(
&mut self,
name: &str,
nodegroup_name: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let path = format!("/clusters/{name}/node-groups/{nodegroup_name}/update-config");
self.expect_post(&path)
}
}