Skip to main content

fizzy_sdk/generated/services/
identity.rs

1// Generated by fizzy-sdk-generator from openapi.json and behavior-model.json. DO NOT EDIT.
2
3use crate::client::Scope;
4use crate::error::Error;
5use crate::generated::routes;
6use crate::generated::types::*;
7
8/// The `Identity` operations.
9pub 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    /// The client and account these operations send through.
19    pub fn scope(&self) -> &Scope<'a> {
20        &self.scope
21    }
22
23    /// `GetMyIdentity` — `GET /my/identity.json`.
24    ///
25    /// Sent up to 3 times, backing off from 1000 ms, when the answer is 429, 500 or 503.
26    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    /// `UpdateMyTimezone` — `PATCH /{accountId}/my/timezone.json`.
32    ///
33    /// Sent up to 3 times, backing off from 1000 ms, when the answer is 429, 500 or 503.
34    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}