google_drive/
channels.rs

1use crate::Client;
2use crate::ClientResult;
3
4pub struct Channels {
5    pub client: Client,
6}
7
8impl Channels {
9    #[doc(hidden)]
10    pub fn new(client: Client) -> Self {
11        Channels { client }
12    }
13
14    /**
15     * This function performs a `POST` to the `/channels/stop` endpoint.
16     *
17     * Stop watching resources through this channel
18     */
19    pub async fn stop(&self, body: &crate::types::Channel) -> ClientResult<crate::Response<()>> {
20        let url = self.client.url("/channels/stop", None);
21        self.client
22            .post(
23                &url,
24                crate::Message {
25                    body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
26                    content_type: Some("application/json".to_string()),
27                },
28            )
29            .await
30    }
31}