1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use anyhow::Result;

use crate::Client;

pub struct Updates {
    pub client: Client,
}

impl Updates {
    #[doc(hidden)]
    pub fn new(client: Client) -> Self {
        Updates { client }
    }

    /**
     * Refresh update metadata.
     *
     * This function performs a `POST` to the `/updates/refresh` endpoint.
     */
    pub async fn refresh(&self) -> Result<()> {
        let url = "/updates/refresh".to_string();
        self.client.post(&url, None).await
    }
}