diff --git a/src/gmail_client.rs b/src/gmail_client.rs index 00eb2fa..a1de336 100644 --- a/src/gmail_client.rs +++ b/src/gmail_client.rs @@ -10,7 +10,7 @@ use google_gmail1::{ yup_oauth2::{ApplicationSecret, InstalledFlowAuthenticator, InstalledFlowReturnMethod}, }; -use crate::{Credential, Error, Result}; +use crate::{Credential, Error, MessageList, Result}; /// Default for the maximum number of results to return on a page pub const DEFAULT_MAX_RESULTS: &str = "200"; @@ -104,4 +104,13 @@ impl GmailClient { log::info!("{name}: {id}") } } + + /// Get the hub from the client + pub(crate) fn hub(&self) -> Gmail> { + self.hub.clone() + } + + pub async fn get_messages(&self) -> Result { + MessageList::new(&self).await + } }