pub struct GraphClient { /* private fields */ }Implementations§
Source§impl GraphClient
impl GraphClient
pub fn new(access_token: String) -> Self
Sourcepub fn clone_for_background(&self) -> Self
pub fn clone_for_background(&self) -> Self
Create an independent copy for background tasks (token is cloned, zeroized on drop)
pub fn set_token(&mut self, token: String)
pub async fn get_me(&self) -> Result<User>
pub async fn list_chats(&self) -> Result<Vec<Chat>>
pub async fn get_messages( &self, chat_id: &str, ) -> Result<(Vec<Message>, Option<String>)>
Sourcepub async fn get_messages_delta(
&self,
chat_id: &str,
delta_link: Option<&str>,
) -> Result<(Vec<Message>, Option<String>)>
pub async fn get_messages_delta( &self, chat_id: &str, delta_link: Option<&str>, ) -> Result<(Vec<Message>, Option<String>)>
Fetch only new/changed messages since the last delta token. On first call pass None for delta_link to get initial state + token.
pub async fn get_messages_page( &self, next_link: &str, ) -> Result<(Vec<Message>, Option<String>)>
pub async fn send_message( &self, chat_id: &str, content: &str, ) -> Result<Message>
pub async fn send_reply( &self, chat_id: &str, reply_to_id: &str, content: &str, ) -> Result<Message>
pub async fn update_message( &self, chat_id: &str, message_id: &str, content: &str, ) -> Result<Message>
pub async fn soft_delete_message( &self, chat_id: &str, message_id: &str, ) -> Result<()>
pub async fn create_chat(&self, user_email: &str, my_id: &str) -> Result<Chat>
pub async fn search_users(&self, query: &str) -> Result<Vec<User>>
pub async fn get_chat_members(&self, chat_id: &str) -> Result<Vec<ChatMember>>
pub async fn rename_chat(&self, chat_id: &str, topic: &str) -> Result<()>
pub async fn add_chat_member(&self, chat_id: &str, user_id: &str) -> Result<()>
pub async fn remove_chat_member( &self, chat_id: &str, membership_id: &str, ) -> Result<()>
pub async fn set_reaction( &self, chat_id: &str, message_id: &str, reaction_type: &str, ) -> Result<()>
pub async fn set_channel_reaction( &self, team_id: &str, channel_id: &str, message_id: &str, reaction_type: &str, ) -> Result<()>
pub async fn unset_reaction( &self, chat_id: &str, message_id: &str, reaction_type: &str, ) -> Result<()>
pub async fn get_my_presence(&self) -> Result<Presence>
pub async fn get_presences( &self, user_ids: &[String], ) -> Result<Vec<UserPresence>>
pub async fn set_my_presence( &self, availability: &str, activity: &str, ) -> Result<()>
pub async fn list_teams(&self) -> Result<Vec<Team>>
pub async fn list_channels(&self, team_id: &str) -> Result<Vec<Channel>>
pub async fn get_channel_members( &self, team_id: &str, channel_id: &str, ) -> Result<Vec<ChannelMember>>
pub async fn get_channel_messages( &self, team_id: &str, channel_id: &str, ) -> Result<(Vec<Message>, Option<String>)>
pub async fn send_channel_message( &self, team_id: &str, channel_id: &str, content: &str, ) -> Result<Message>
pub async fn reply_to_channel_message( &self, team_id: &str, channel_id: &str, message_id: &str, content: &str, ) -> Result<Message>
Sourcepub async fn upload_file(
&self,
filename: &str,
bytes: Vec<u8>,
) -> Result<DriveItem>
pub async fn upload_file( &self, filename: &str, bytes: Vec<u8>, ) -> Result<DriveItem>
Upload a file to OneDrive (Microsoft Teams Chat Files folder) and return the DriveItem
Sourcepub async fn send_message_with_attachment(
&self,
chat_id: &str,
filename: &str,
drive_item: &DriveItem,
) -> Result<Message>
pub async fn send_message_with_attachment( &self, chat_id: &str, filename: &str, drive_item: &DriveItem, ) -> Result<Message>
Send a chat message with a file attachment reference
Sourcepub async fn send_channel_message_with_attachment(
&self,
team_id: &str,
channel_id: &str,
filename: &str,
drive_item: &DriveItem,
) -> Result<Message>
pub async fn send_channel_message_with_attachment( &self, team_id: &str, channel_id: &str, filename: &str, drive_item: &DriveItem, ) -> Result<Message>
Send a channel message with a file attachment reference
pub async fn search_messages(&self, query: &str) -> Result<Vec<SearchHit>>
pub async fn mark_chat_read(&self, chat_id: &str, user_id: &str) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphClient
impl !RefUnwindSafe for GraphClient
impl Send for GraphClient
impl Sync for GraphClient
impl Unpin for GraphClient
impl UnsafeUnpin for GraphClient
impl !UnwindSafe for GraphClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more