gsuite_api/
privileges.rs

1use crate::Client;
2use crate::ClientResult;
3
4pub struct Privileges {
5    pub client: Client,
6}
7
8impl Privileges {
9    #[doc(hidden)]
10    pub fn new(client: Client) -> Self {
11        Privileges { client }
12    }
13
14    /**
15     * This function performs a `GET` to the `/admin/directory/v1/customer/{customer}/roles/ALL/privileges` endpoint.
16     *
17     * Retrieves a paginated list of all privileges for a customer.
18     *
19     * **Parameters:**
20     *
21     * * `customer: &str` -- Immutable ID of the Google Workspace account.
22     */
23    pub async fn list(
24        &self,
25        customer: &str,
26    ) -> ClientResult<crate::Response<crate::types::Privileges>> {
27        let url = self.client.url(
28            &format!(
29                "/admin/directory/v1/customer/{}/roles/ALL/privileges",
30                crate::progenitor_support::encode_path(customer),
31            ),
32            None,
33        );
34        self.client
35            .get(
36                &url,
37                crate::Message {
38                    body: None,
39                    content_type: None,
40                },
41            )
42            .await
43    }
44}