gitbundle_sdk/models/
token_create_output.rs

1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.0.0
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 TokenCreateOutput {
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(rename = "model")]
27    pub model: Box<models::TokenModel>,
28}
29
30impl TokenCreateOutput {
31    pub fn new(access_token: String, model: models::TokenModel) -> TokenCreateOutput {
32        TokenCreateOutput {
33            access_token,
34            expires_at: None,
35            model: Box::new(model),
36        }
37    }
38}