1use crate::Client;
2use crate::ClientResult;
3
4pub struct Api {
5 pub client: Client,
6}
7
8impl Api {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 Api { client }
12 }
13
14 pub async fn test(
27 &self,
28 error: &str,
29 foo_: &str,
30 ) -> ClientResult<crate::Response<crate::types::DndEndSchema>> {
31 let mut query_args: Vec<(String, String)> = Default::default();
32 if !error.is_empty() {
33 query_args.push(("error".to_string(), error.to_string()));
34 }
35 if !foo_.is_empty() {
36 query_args.push(("foo".to_string(), foo_.to_string()));
37 }
38 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
39 let url = self.client.url(&format!("/api.test?{}", query_), None);
40 self.client
41 .get(
42 &url,
43 crate::Message {
44 body: None,
45 content_type: None,
46 },
47 )
48 .await
49 }
50}