pub fn new_with_auth<T>(refresh_token: String, access_token: T) -> Result<Self>
    where
        T: Into<Option<String>>,
    {
        if refresh_token.is_empty() {
            bail!("Empty refresh token passed to new_with_auth. Please report this as a bug.");
        }
        let access_token = Mutex::new(access_token.into().unwrap_or("".to_string()));
        Ok(Self {
            _api_base: Url::parse(API_BASE).expect("parse API_BASE"),
            storage_base: Url::parse(STORAGE_BASE).expect("parse STORAGE_BASE"),
            refresh_token: Some(refresh_token),
            access_token,
        })
    }
/// Allow access to public and private (auth-required) GCS data.
///
/// The `refresh_token` must not be an empty string (this will generate an
/// Err Result.
///
/// The `access_token` is not required, but if it happens to be available,
/// i.e. if a code exchange was just done, it avoids an extra round-trip to
/// provide it here.
Allow access to public and private (auth-required) GCS data.
The `refresh_token` must not be an empty string (this will generate an
Err Result.

The `access_token` is not required, but if it happens to be available,
i.e. if a code exchange was just done, it avoids an extra round-trip to
provide it here.
Allow access to public and private ( auth - required ) GCS data . The ` refresh_token ` must not be an empty string ( this will generate an Err Result . The ` access_token ` is not required but if it happens to be available i . e . if a code exchange was just done it avoids an extra round - trip to provide it here .
pub fn new_with_auth<T>(refresh_token: String, access_token: T) -> Result<Self>
    where
        T: Into<Option<String>>,
    {
        if refresh_token.is_empty() {
            bail!("Empty refresh token passed to new_with_auth. Please report this as a bug.");
        }
        let access_token = Mutex::new(access_token.into().unwrap_or("".to_string()));
        Ok(Self {
            _api_base: Url::parse(API_BASE).expect("parse API_BASE"),
            storage_base: Url::parse(STORAGE_BASE).expect("parse STORAGE_BASE"),
            refresh_token: Some(refresh_token),
            access_token,
        })
    }
pub fn new_with_auth < T > ( refresh_token : String , access_token : T ) -> Result < Self > where T : Into < Option < String > > , { if refresh_token . is_empty ( ) { bail ! ( " " ) ; } let access_token = Mutex :: new ( access_token . into ( ) . unwrap_or ( " " . to_string ( ) ) ) ; Ok ( Self { _api_base : Url :: parse ( API_BASE ) . expect ( " " ) , storage_base : Url :: parse ( STORAGE_BASE ) . expect ( " " ) , refresh_token : Some ( refresh_token ) , access_token , } ) }
Allow access to public and private (auth-required) GCS data.
Allow access to public and private ( auth - required ) GCS data .
refresh_token
String
access_token
T
refresh_token
String
access_token
T