use crate::client::FyersClient;
use crate::error::Result;
use crate::models::user::ProfileResponse;
use crate::transport::get_authenticated_json;
#[derive(Debug, Clone, Copy)]
pub struct ProfileService<'a> {
client: &'a FyersClient,
}
impl<'a> ProfileService<'a> {
pub(crate) const fn new(client: &'a FyersClient) -> Self {
Self { client }
}
pub const fn client(&self) -> &'a FyersClient {
self.client
}
pub async fn get(&self) -> Result<ProfileResponse> {
get_authenticated_json(self.client.http(), self.client.config(), "profile").await
}
}