pub async fn group_has_member(&self, group_id: &str, email: &str) -> Result<bool, APIError> {
        // Build the request.
        let request = self.request(DIRECTORY_ENDPOINT, Method::GET, &format!("groups/{}/hasMember/{}", group_id, email), (), None);

        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                });
            }
        };

        // Try to deserialize the response.
        let value: MembersHasMember = resp.json().await.unwrap();

        Ok(value.is_member)
    }
/// Check if a user is a member of a Google group.
Check if a user is a member of a Google group.
Check if a user is a member of a Google group .
pub async fn group_has_member(&self, group_id: &str, email: &str) -> Result<bool, APIError> {
        // Build the request.
        let request = self.request(DIRECTORY_ENDPOINT, Method::GET, &format!("groups/{}/hasMember/{}", group_id, email), (), None);
        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                });
            }
        };
        // Try to deserialize the response.
        let value: MembersHasMember = resp.json().await.unwrap();
        Ok(value.is_member)
    }
pub async fn group_has_member ( & self , group_id : & str , email : & str ) -> Result < bool , APIError > { // Build the request. let request = self . request ( DIRECTORY_ENDPOINT , Method :: GET , & format ! ( " " group_id email ) , ( ) , None ) ; let resp = self . client . execute ( request ) . await . unwrap ( ) ; match resp . status ( ) { StatusCode :: OK => ( ) , s => { return Err ( APIError { status_code : s , body : resp . text ( ) . await . unwrap ( ) , } ) ; } } ; // Try to deserialize the response. let value : MembersHasMember = resp . json ( ) . await . unwrap ( ) ; Ok ( value . is_member ) }
Check if a user is a member of a Google group.
Check if a user is a member of a Google group .
&self
group_id
&str
email
&str
&self
group_id
&str
email
&str