♻️ refactor(message): rename message to message_list
- rename `message.rs` to `message_list.rs` to improve clarity - update struct name from `Message` to `MessageList`
This commit is contained in:
committed by
Jeremiah Russell
parent
36d92b4126
commit
188a311175
@@ -15,14 +15,14 @@ use crate::{Credential, Error};
|
|||||||
pub const DEFAULT_MAX_RESULTS: &str = "10";
|
pub const DEFAULT_MAX_RESULTS: &str = "10";
|
||||||
|
|
||||||
/// Struct to capture configuration for List API call.
|
/// Struct to capture configuration for List API call.
|
||||||
pub struct Message {
|
pub struct MessageList {
|
||||||
hub: Gmail<HttpsConnector<HttpConnector>>,
|
hub: Gmail<HttpsConnector<HttpConnector>>,
|
||||||
max_results: u32,
|
max_results: u32,
|
||||||
label_ids: Vec<String>,
|
label_ids: Vec<String>,
|
||||||
query: String,
|
query: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Message {
|
impl MessageList {
|
||||||
/// Create a new List struct and add the Gmail api connection.
|
/// Create a new List struct and add the Gmail api connection.
|
||||||
pub async fn new(credential: &str) -> Result<Self, Error> {
|
pub async fn new(credential: &str) -> Result<Self, Error> {
|
||||||
let (config_dir, secret) = {
|
let (config_dir, secret) = {
|
||||||
@@ -52,7 +52,7 @@ impl Message {
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Ok(Message {
|
Ok(MessageList {
|
||||||
hub: Gmail::new(client, auth),
|
hub: Gmail::new(client, auth),
|
||||||
max_results: DEFAULT_MAX_RESULTS.parse::<u32>().unwrap(),
|
max_results: DEFAULT_MAX_RESULTS.parse::<u32>().unwrap(),
|
||||||
label_ids: Vec::new(),
|
label_ids: Vec::new(),
|
||||||
Reference in New Issue
Block a user