/// Insert oauth credentials using the OAuthCredential enum.
/// This method is used internally for each of the setter methods.
/// Callers can optionally use this method to set credentials instead
/// of the individual setter methods.
///
/// # Example
/// ```
/// # use graph_oauth::oauth::OAuth;
/// # use graph_oauth::oauth::OAuthCredential;
/// # let mut oauth = OAuth::new();
/// oauth.insert(OAuthCredential::AuthorizeURL, "https://example.com");
/// assert!(oauth.contains(OAuthCredential::AuthorizeURL));
/// println!("{:#?}", oauth.get(OAuthCredential::AuthorizeURL));
/// ```
Insert oauth credentials using the OAuthCredential enum.
This method is used internally for each of the setter methods.
Callers can optionally use this method to set credentials instead
of the individual setter methods.
Insert oauth credentials using the OAuthCredential enum . This method is used internally for each of the setter methods . Callers can optionally use this method to set credentials instead of the individual setter methods .
pub fn insert<V: ToString>(&mut self, oac: OAuthCredential, value: V) -> &mut OAuth {
        let v = value.to_string();
        match oac {
            OAuthCredential::RefreshTokenURL
            | OAuthCredential::PostLogoutRedirectURI
            | OAuthCredential::AccessTokenURL
            | OAuthCredential::AuthorizeURL
            | OAuthCredential::LogoutURL => {
                Url::parse(v.as_ref()).unwrap();
            }
            _ => {}
        }
        self.credentials.insert(oac.to_string(), v);
        self
    }
pub fn insert < V : ToString > ( & mut self , oac : OAuthCredential , value : V ) -> & mut OAuth { let v = value . to_string ( ) ; match oac { OAuthCredential :: RefreshTokenURL | OAuthCredential :: PostLogoutRedirectURI | OAuthCredential :: AccessTokenURL | OAuthCredential :: AuthorizeURL | OAuthCredential :: LogoutURL => { Url :: parse ( v . as_ref ( ) ) . unwrap ( ) ; } _ => { } } self . credentials . insert ( oac . to_string ( ) , v ) ; self }
Insert oauth credentials using the OAuthCredential enum.
Insert oauth credentials using the OAuthCredential enum .
&mut self
oac
OAuthCredential
value
V
example
None
use graph_oauth::oauth::oauth;
None
use graph_oauth::oauth::oauthcredential;
None
let mut oauth = oauth::new();
None