#[cfg(any(test, feature = "test-support"))]
use crate::mock_client::{ExpectationBuilder, MockClient};
#[cfg(any(test, feature = "test-support"))]
pub trait ApigatewayMockHelpers {
fn expect_get_rest_apis(&mut self, position: &str, limit: &str) -> ExpectationBuilder<'_>;
fn expect_get_stages(
&mut self,
restapi_id: &str,
deployment_id: &str,
) -> ExpectationBuilder<'_>;
fn expect_update_stage(&mut self, restapi_id: &str, stage_name: &str)
-> ExpectationBuilder<'_>;
}
#[cfg(any(test, feature = "test-support"))]
impl ApigatewayMockHelpers for MockClient {
fn expect_get_rest_apis(
&mut self,
position: &str,
limit: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let mut path = "/restapis".to_string();
let mut __qp: Vec<String> = Vec::new();
if !position.is_empty() {
__qp.push(format!("position={}", position));
}
if !limit.is_empty() {
__qp.push(format!("limit={}", limit));
}
if !__qp.is_empty() {
path = format!("{}?{}", path, __qp.join("&"));
}
self.expect_get(&path)
}
fn expect_get_stages(
&mut self,
restapi_id: &str,
deployment_id: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let mut path = format!("/restapis/{restapi_id}/stages");
let mut __qp: Vec<String> = Vec::new();
if !deployment_id.is_empty() {
__qp.push(format!("deploymentId={}", deployment_id));
}
if !__qp.is_empty() {
path = format!("{}?{}", path, __qp.join("&"));
}
self.expect_get(&path)
}
fn expect_update_stage(
&mut self,
restapi_id: &str,
stage_name: &str,
) -> crate::mock_client::ExpectationBuilder<'_> {
let path = format!("/restapis/{restapi_id}/stages/{stage_name}");
self.expect_patch(&path)
}
}