gsuite_api/
two_step_verification.rs

1use crate::Client;
2use crate::ClientResult;
3
4pub struct TwoStepVerification {
5    pub client: Client,
6}
7
8impl TwoStepVerification {
9    #[doc(hidden)]
10    pub fn new(client: Client) -> Self {
11        TwoStepVerification { client }
12    }
13
14    /**
15     * This function performs a `POST` to the `/admin/directory/v1/users/{userKey}/twoStepVerification/turnOff` endpoint.
16     *
17     * Turns off 2-Step Verification for user.
18     *
19     * **Parameters:**
20     *
21     * * `user_key: &str` -- Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.
22     */
23    pub async fn turn_off(&self, user_key: &str) -> ClientResult<crate::Response<()>> {
24        let url = self.client.url(
25            &format!(
26                "/admin/directory/v1/users/{}/twoStepVerification/turnOff",
27                crate::progenitor_support::encode_path(user_key),
28            ),
29            None,
30        );
31        self.client
32            .post(
33                &url,
34                crate::Message {
35                    body: None,
36                    content_type: None,
37                },
38            )
39            .await
40    }
41}