p7m_userauth/models/
client.rs

1/*
2 * User and Authentication Backend
3 *
4 * # API for authentication and managing user accounts  This is the API of the service at P7M that manages tenants, accounts and authentication. It is the basis of many services of P7M.  The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0.  When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
5 *
6 * The version of the OpenAPI document: 0.14.2
7 * Contact: tech@p7m.de
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Client {
16    #[serde(rename = "clientId")]
17    pub client_id: uuid::Uuid,
18    #[serde(rename = "name")]
19    pub name: String,
20    #[serde(rename = "redirectUri")]
21    pub redirect_uri: String,
22    #[serde(rename = "refreshToken")]
23    pub refresh_token: bool,
24    #[serde(rename = "sessionDuration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub session_duration: Option<Option<i32>>,
26    #[serde(rename = "lastChange")]
27    pub last_change: String,
28}
29
30impl Client {
31    pub fn new(client_id: uuid::Uuid, name: String, redirect_uri: String, refresh_token: bool, last_change: String) -> Client {
32        Client {
33            client_id,
34            name,
35            redirect_uri,
36            refresh_token,
37            session_duration: None,
38            last_change,
39        }
40    }
41}
42