♻️ refactor(trash): use GmailClient instead of credential string
- use GmailClient to manage gmail API interactions - remove credential string
This commit is contained in:
committed by
Jeremiah Russell
parent
a22ce8e882
commit
da8304e02f
@@ -1,6 +1,6 @@
|
|||||||
use google_gmail1::api::BatchModifyMessagesRequest;
|
use google_gmail1::api::BatchModifyMessagesRequest;
|
||||||
|
|
||||||
use crate::{MessageList, Result};
|
use crate::{GmailClient, MessageList, Result};
|
||||||
|
|
||||||
/// Struct for trashing messages
|
/// Struct for trashing messages
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -10,8 +10,8 @@ pub struct Trash {
|
|||||||
|
|
||||||
impl Trash {
|
impl Trash {
|
||||||
/// Create a new Trash struct
|
/// Create a new Trash struct
|
||||||
pub async fn new(credential: &str) -> Result<Self> {
|
pub async fn new(client: &GmailClient) -> Result<Self> {
|
||||||
let message_list = MessageList::new(credential).await?;
|
let message_list = MessageList::new(client).await?;
|
||||||
Ok(Trash { message_list })
|
Ok(Trash { message_list })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user