fizzy_sdk/generated/services/
identity.rs1use crate::client::Scope;
4use crate::error::Error;
5use crate::generated::routes;
6use crate::generated::types::*;
7
8pub struct IdentityService<'a> {
10 scope: Scope<'a>,
11}
12
13impl<'a> IdentityService<'a> {
14 pub(crate) fn new(scope: Scope<'a>) -> Self {
15 Self { scope }
16 }
17
18 pub fn scope(&self) -> &Scope<'a> {
20 &self.scope
21 }
22
23 pub async fn get_my_identity(&self) -> Result<Identity, Error> {
27 let operation = self.scope.operation(&routes::GET_MY_IDENTITY, &[])?;
28 self.scope.client().send(operation).await
29 }
30
31 pub async fn update_my_timezone(
35 &self,
36 body: &UpdateMyTimezoneRequestContent,
37 ) -> Result<(), Error> {
38 let mut operation = self.scope.operation(&routes::UPDATE_MY_TIMEZONE, &[])?;
39 operation.json(body)?;
40 self.scope.client().send_unit(operation).await
41 }
42}