pub fn root_id(&mut self) -> Result<&String, Error> {
        if self.root_id.is_some() {
            return Ok(self.root_id.as_ref().unwrap());
        }

        let parent = self.hub
            .files()
            .list()
            .param("fields", "files(parents)")
            .spaces("drive")
            .corpora("user")
            .page_size(1)
            .q("'root' in parents")
            .add_scope(drive3::Scope::Full)
            .doit()
            .map_err(|e| err_msg(format!("{:#?}", e)))?
            .1
            .files
            .ok_or(err_msg("No files received"))?
            .into_iter()
            .take(1)
            .next()
            .ok_or(err_msg(
                "No files on drive. Can't deduce drive id for 'My Drive'",
            ))?
            .parents
            .ok_or(err_msg(
                "Probed file has no parents. Can't deduce drive id for 'My Drive'",
            ))?
            .into_iter()
            .take(1)
            .next()
            .ok_or(err_msg(
                "No files on drive. Can't deduce drive id for 'My Drive'",
            ))?;

        self.root_id = Some(parent);
        Ok(self.root_id.as_ref().unwrap())
    }
/// Returns the Drive ID of the root "My Drive" directory
Returns the Drive ID of the root "My Drive" directory
Returns the Drive ID of the root " My Drive " directory
pub fn root_id(&mut self) -> Result<&String, Error> {
        if self.root_id.is_some() {
            return Ok(self.root_id.as_ref().unwrap());
        }
        let parent = self.hub
            .files()
            .list()
            .param("fields", "files(parents)")
            .spaces("drive")
            .corpora("user")
            .page_size(1)
            .q("'root' in parents")
            .add_scope(drive3::Scope::Full)
            .doit()
            .map_err(|e| err_msg(format!("{:#?}", e)))?
            .1
            .files
            .ok_or(err_msg("No files received"))?
            .into_iter()
            .take(1)
            .next()
            .ok_or(err_msg(
                "No files on drive. Can't deduce drive id for 'My Drive'",
            ))?
            .parents
            .ok_or(err_msg(
                "Probed file has no parents. Can't deduce drive id for 'My Drive'",
            ))?
            .into_iter()
            .take(1)
            .next()
            .ok_or(err_msg(
                "No files on drive. Can't deduce drive id for 'My Drive'",
            ))?;
        self.root_id = Some(parent);
        Ok(self.root_id.as_ref().unwrap())
    }
pub fn root_id ( & mut self ) -> Result < & String , Error > { if self . root_id . is_some ( ) { return Ok ( self . root_id . as_ref ( ) . unwrap ( ) ) ; } let parent = self . hub . files ( ) . list ( ) . param ( " " , " " ) . spaces ( " " ) . corpora ( " " ) . page_size ( 1 ) . q ( " " ) . add_scope ( drive3 :: Scope :: Full ) . doit ( ) . map_err ( | e | err_msg ( format ! ( " " e ) ) ) ? . 1 . files . ok_or ( err_msg ( " " ) ) ? . into_iter ( ) . take ( 1 ) . next ( ) . ok_or ( err_msg ( " " , ) ) ? . parents . ok_or ( err_msg ( " " , ) ) ? . into_iter ( ) . take ( 1 ) . next ( ) . ok_or ( err_msg ( " " , ) ) ? ; self . root_id = Some ( parent ) ; Ok ( self . root_id . as_ref ( ) . unwrap ( ) ) }
Returns the Drive ID of the root "My Drive" directory
Returns the Drive ID of the root " My Drive " directory
&mut self
&mut self