#![allow(missing_docs, unreachable_pub, clippy::all, clippy::pedantic)]
use crate::client::Client;
use crate::error::Error;
use crate::generated::routes;
use crate::generated::types::*;
pub struct Identity<'a> {
client: &'a Client,
}
impl<'a> Identity<'a> {
pub(crate) fn new(client: &'a Client) -> Self {
Self { client }
}
pub fn client(&self) -> &'a Client {
self.client
}
pub async fn get(&self) -> Result<GetIdentityResponseContent, Error> {
let operation = self.client.operation(&routes::GET_IDENTITY, &[]);
self.client.send(operation).await
}
pub async fn get_navigation(&self) -> Result<GetNavigationResponseContent, Error> {
let operation = self.client.operation(&routes::GET_NAVIGATION, &[]);
self.client.send(operation).await
}
pub async fn update_first_week_day(
&self,
body: &UpdateFirstWeekDayRequestContent,
) -> Result<UpdateFirstWeekDayResponseContent, Error> {
let mut operation = self.client.operation(&routes::UPDATE_FIRST_WEEK_DAY, &[]);
operation.json(body)?;
self.client.send(operation).await
}
pub async fn update_time_format(
&self,
body: &UpdateTimeFormatRequestContent,
) -> Result<UpdateTimeFormatResponseContent, Error> {
let mut operation = self.client.operation(&routes::UPDATE_TIME_FORMAT, &[]);
operation.json(body)?;
self.client.send(operation).await
}
}