dtz_identity/models/
token_response.rs1#[allow(unused_imports)]
11use crate::models;
12#[allow(unused_imports)]
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TokenResponse {
17 #[serde(rename = "access_token")]
18 pub access_token: String,
19 #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
20 pub scope: Option<String>,
21 #[serde(rename = "token_type")]
22 pub token_type: String,
23 #[serde(rename = "expires_in")]
24 pub expires_in: f64,
25}
26
27impl TokenResponse {
28 pub fn new(access_token: String, token_type: String, expires_in: f64) -> TokenResponse {
29 TokenResponse {
30 access_token,
31 scope: None,
32 token_type,
33 expires_in,
34 }
35 }
36}
37