Skip to main content

gitbundle_sdk/models/
login_output.rs

1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.4.1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LoginOutput {
17    #[serde(rename = "access_token")]
18    pub access_token: String,
19    #[serde(
20        rename = "expires_at",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub expires_at: Option<Option<i64>>,
26    #[serde(
27        rename = "two_factor_enabled",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub two_factor_enabled: Option<Option<bool>>,
33}
34
35impl LoginOutput {
36    pub fn new(access_token: String) -> LoginOutput {
37        LoginOutput {
38            access_token,
39            expires_at: None,
40            two_factor_enabled: None,
41        }
42    }
43}