1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#[derive(Clone)]
pub struct DataServiceCredentials {
access_token: String,
}
impl DataServiceCredentials {
pub fn new(access_token: &str) -> Self {
Self {
access_token: access_token.to_string(),
}
}
pub fn access_token(&self) -> String {
self.access_token.to_string()
}
pub fn as_header(&self) -> String {
format!("Bearer {}", self.access_token)
}
}