pub struct ConversationsResource { /* private fields */ }Expand description
Conversations — /api/v2/conversations, including their events and session variables.
Implementations§
Source§impl ConversationsResource
impl ConversationsResource
Sourcepub async fn list_all(&self) -> Result<Vec<Conversation>, ManagerError>
pub async fn list_all(&self) -> Result<Vec<Conversation>, ManagerError>
List all conversations (auto-paginated).
Sourcepub async fn create(
&self,
body: RestCreateConversation,
) -> Result<ConversationItemResponse, ManagerError>
pub async fn create( &self, body: RestCreateConversation, ) -> Result<ConversationItemResponse, ManagerError>
Create a conversation.
Sourcepub async fn get(
&self,
id: &str,
) -> Result<ConversationItemResponse, ManagerError>
pub async fn get( &self, id: &str, ) -> Result<ConversationItemResponse, ManagerError>
Get a conversation by id.
Sourcepub async fn update(
&self,
id: &str,
body: RestUpdateConversation,
) -> Result<ConversationItemResponse, ManagerError>
pub async fn update( &self, id: &str, body: RestUpdateConversation, ) -> Result<ConversationItemResponse, ManagerError>
Update a conversation.
Sourcepub async fn events(
&self,
conversation_id: &str,
) -> Result<Vec<ConversationEvent>, ManagerError>
pub async fn events( &self, conversation_id: &str, ) -> Result<Vec<ConversationEvent>, ManagerError>
List a conversation’s events.
Sourcepub async fn add_event(
&self,
conversation_id: &str,
body: ConversationEventRequest,
) -> Result<ConversationEventItemResponse, ManagerError>
pub async fn add_event( &self, conversation_id: &str, body: ConversationEventRequest, ) -> Result<ConversationEventItemResponse, ManagerError>
Add an event to a conversation.
Sourcepub async fn open(
&self,
conversation_id: &str,
) -> Result<ConversationItemResponse, ManagerError>
pub async fn open( &self, conversation_id: &str, ) -> Result<ConversationItemResponse, ManagerError>
Open a conversation.
Sourcepub async fn close(
&self,
conversation_id: &str,
) -> Result<ConversationItemResponse, ManagerError>
pub async fn close( &self, conversation_id: &str, ) -> Result<ConversationItemResponse, ManagerError>
Close a conversation.
Sourcepub async fn first_event(
&self,
conversation_id: &str,
) -> Result<ConversationEventItemResponse, ManagerError>
pub async fn first_event( &self, conversation_id: &str, ) -> Result<ConversationEventItemResponse, ManagerError>
Get a conversation’s first event.
Sourcepub async fn latest_event(
&self,
conversation_id: &str,
) -> Result<ConversationEventItemResponse, ManagerError>
pub async fn latest_event( &self, conversation_id: &str, ) -> Result<ConversationEventItemResponse, ManagerError>
Get a conversation’s latest event.
Sourcepub async fn all_events(&self) -> Result<Vec<ConversationEvent>, ManagerError>
pub async fn all_events(&self) -> Result<Vec<ConversationEvent>, ManagerError>
List events across all conversations (auto-paginated).
Sourcepub async fn get_session(
&self,
conversation_id: &str,
) -> Result<ConversationSessionVariablesItemResponse, ManagerError>
pub async fn get_session( &self, conversation_id: &str, ) -> Result<ConversationSessionVariablesItemResponse, ManagerError>
Get a conversation’s session variables.
Sourcepub async fn update_session(
&self,
conversation_id: &str,
variables: HashMap<String, Value>,
) -> Result<ConversationSessionVariablesItemResponse, ManagerError>
pub async fn update_session( &self, conversation_id: &str, variables: HashMap<String, Value>, ) -> Result<ConversationSessionVariablesItemResponse, ManagerError>
Update a conversation’s session variables.
Auto Trait Implementations§
impl !RefUnwindSafe for ConversationsResource
impl !UnwindSafe for ConversationsResource
impl Freeze for ConversationsResource
impl Send for ConversationsResource
impl Sync for ConversationsResource
impl Unpin for ConversationsResource
impl UnsafeUnpin for ConversationsResource
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