Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

856 B
Raw Blame
mod get_previews;

#[derive(Clone, Debug)]
pub struct EmailServiceClientExternal {
    url: String,
    client: reqwest::Client,
}

impl EmailServiceClientExternal {
    pub fn new(url: String) -> Self {
        Self {
            url,
            client: reqwest::Client::new(),
        }
    }

    #[allow(unused)]
    pub(crate) fn request(
        &self,
        method: reqwest::Method,
        path: &str,
        jwt_token: &str,
    ) -> reqwest::RequestBuilder {
        self.request_url(method, format!("{}{}", self.url, path).as_str(), jwt_token)
    }

    pub(crate) fn request_url(
        &self,
        method: reqwest::Method,
        url: &str,
        jwt_token: &str,
    ) -> reqwest::RequestBuilder {
        self.client
            .request(method, url)
            .header("Authorization", format!("Bearer {}", jwt_token))
    }
}