pub struct HostSession {
pub bot_name: String,
pub session_id: String,
pub agent_id: Option<String>,
pub routine_url: Option<String>,
pub routine_bearer: Option<String>,
pub device_token: Option<String>,
pub product_nick: Option<String>,
}Expand description
One bot session the host says lives on this machine.
routine_url and routine_bearer are optional and stay in memory.
They are not part of a session record on disk.
Fields§
§bot_name: StringDisplay name the host already shows (Alice, Привет мир).
session_id: StringSession id the host already assigned. This is the mail session, not the Grok Bot agent id.
agent_id: Option<String>Grok Bot agent id for [createAgentAutomation]. Absent means this
session does not get a webhook routine.
routine_url: Option<String>Routine URL for this session, if the host has one. Not a file.
routine_bearer: Option<String>Bearer for that routine POST. Memory only.
device_token: Option<String>Device bearer from the host keychain, for a session that already
registered. None on the first connect.
product_nick: Option<String>Product-session mode: the product nick. With it, device_token is the
product session token and every call goes through the product proxy.
Implementations§
Source§impl HostSession
impl HostSession
Sourcepub fn new(bot_name: impl Into<String>, session_id: impl Into<String>) -> Self
pub fn new(bot_name: impl Into<String>, session_id: impl Into<String>) -> Self
A session with no routine and no stored device bearer.
Sourcepub fn with_product(
self,
nick: impl Into<String>,
token: impl Into<String>,
) -> Self
pub fn with_product( self, nick: impl Into<String>, token: impl Into<String>, ) -> Self
Product-session mode for this session: log in at the product as
nick with an existing product session token.
Sourcepub fn with_routine(
self,
url: impl Into<String>,
bearer: Option<String>,
) -> Self
pub fn with_routine( self, url: impl Into<String>, bearer: Option<String>, ) -> Self
Attaches a routine target. The bearer is kept only as this value.
Sourcepub fn with_device_token(self, token: impl Into<String>) -> Self
pub fn with_device_token(self, token: impl Into<String>) -> Self
Device bearer the host keychain already holds.