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