bw_web_api_rs/endpoints/
gateway.rs1use crate::endpoints::Endpoint;
2use crate::error::ApiError;
3use crate::models::GatewayResponse;
4
5pub struct GatewayEndpoint;
6
7impl GatewayEndpoint {
8 pub fn new() -> Self {
9 Self
10 }
11}
12
13impl Endpoint for GatewayEndpoint {
14 type Request = ();
15 type Response = GatewayResponse;
16
17 fn endpoint(&self) -> String {
18 "/web-api/v1/gateway".to_string()
19 }
20}
21
22impl crate::client::ApiClient {
23 pub async fn get_gateway_status(&self) -> Result<GatewayResponse, ApiError> {
27 let endpoint = GatewayEndpoint::new();
28 self.request(&endpoint, &()).await
29 }
30}