pub struct ChatResource<'a> { /* private fields */ }Expand description
client.chat()
Implementations§
Source§impl<'a> ChatResource<'a>
impl<'a> ChatResource<'a>
Sourcepub fn create(&self, body: &ChatCreate) -> Result<Chat>
pub fn create(&self, body: &ChatCreate) -> Result<Chat>
Start new chat
POST /chat
Starts synchronization of a chat room with Matrix. New rooms have STARTING status and record the current user as creator.
§Example
let body = models::ChatCreate {
domain_id: 9,
guid: "681F54E3-2EB7-40A4-84F0-EFF8E8F05727".into(),
prefix: "ctg".into(),
roomname: "Technical team".into(),
..Default::default()
};
let result = client.chat().create(&body)?;
println!("{:?}", result.creator);Sourcepub fn delete(&self, guid: impl Display) -> Result<()>
pub fn delete(&self, guid: impl Display) -> Result<()>
Delete a chat
DELETE /chat/{guid}
Deletes the local chat room record. A missing record is treated as already deleted.
Use Self::delete_with to pass query parameters.
§Example
client.chat().delete("681F54E3-2EB7-40A4-84F0-EFF8E8F05727")?;Sourcepub fn delete_with(
&self,
guid: impl Display,
query: &DeleteChatGuidQuery,
) -> Result<()>
pub fn delete_with( &self, guid: impl Display, query: &DeleteChatGuidQuery, ) -> Result<()>
Delete a chat
Like Self::delete, with query parameters.
DELETE /chat/{guid}
Deletes the local chat room record. A missing record is treated as already deleted.
Sourcepub fn list(&self) -> Result<Vec<Chat>>
pub fn list(&self) -> Result<Vec<Chat>>
Get all chats
GET /chat
Returns all chat rooms, or only rooms matching the supplied synchronization token.
Use Self::list_with to pass query parameters.
§Example
for chat in client.chat().list()? {
println!("{:?}", chat.creator);
}Sourcepub fn list_with(&self, query: &GetChatQuery) -> Result<Vec<Chat>>
pub fn list_with(&self, query: &GetChatQuery) -> Result<Vec<Chat>>
Get all chats
Like Self::list, with query parameters.
GET /chat
Returns all chat rooms, or only rooms matching the supplied synchronization token.
Sourcepub fn patch(&self, guid: impl Display, body: &ChatUpdate) -> Result<Chat>
pub fn patch(&self, guid: impl Display, body: &ChatUpdate) -> Result<Chat>
Update a chat
PATCH /chat/{guid}
Updates chat room metadata or requests a lifecycle transition.
§Example
let body = models::ChatUpdate {
creator: Some(1),
..Default::default()
};
let result = client.chat().patch("681F54E3-2EB7-40A4-84F0-EFF8E8F05727", &body)?;
println!("{:?}", result.creator);