pub struct SessionData {Show 16 fields
pub user_id: String,
pub user_name: String,
pub user_shortname: String,
pub email: String,
pub user_type: String,
pub broker: String,
pub exchanges: Vec<String>,
pub products: Vec<String>,
pub order_types: Vec<String>,
pub api_key: String,
pub access_token: String,
pub public_token: String,
pub refresh_token: String,
pub login_time: String,
pub meta: Option<SessionMeta>,
pub avatar_url: Option<String>,
}
Expand description
Response from the generate_session
API call
Fields§
§user_id: String
The unique, permanent user id registered with the broker and the exchanges
user_name: String
User’s real name
user_shortname: String
Shortened version of the user’s real name
email: String
User’s email
user_type: String
User’s registered role at the broker. This will be individual for all retail users
broker: String
The broker ID
exchanges: Vec<String>
Exchanges enabled for trading on the user’s account
products: Vec<String>
Margin product types enabled for the user
order_types: Vec<String>
Order types enabled for the user
api_key: String
The API key for which the authentication was performed
access_token: String
The authentication token that’s used with every subsequent request Unless this is invalidated using the API, or invalidated by a master-logout from the Kite Web trading terminal, it’ll expire at 6 AM on the next day (regulatory requirement)
public_token: String
A token for public session validation where requests may be exposed to the public
refresh_token: String
A token for getting long standing read permissions. This is only available to certain approved platforms
login_time: String
User’s last login time
meta: Option<SessionMeta>
Session metadata containing demat_consent and other user metadata
avatar_url: Option<String>
Full URL to the user’s avatar (PNG image) if there’s one
Implementations§
Source§impl SessionData
impl SessionData
Sourcepub fn has_exchange(&self, exchange: &str) -> bool
pub fn has_exchange(&self, exchange: &str) -> bool
Check if the user has access to a specific exchange
Sourcepub fn has_product(&self, product: &str) -> bool
pub fn has_product(&self, product: &str) -> bool
Check if the user has access to a specific product
Sourcepub fn has_order_type(&self, order_type: &str) -> bool
pub fn has_order_type(&self, order_type: &str) -> bool
Check if the user has access to a specific order type
Trait Implementations§
Source§impl Clone for SessionData
impl Clone for SessionData
Source§fn clone(&self) -> SessionData
fn clone(&self) -> SessionData
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more