open_api_hydra/models/
oauth_token_response.rs

1/*
2 * ORY Hydra
3 *
4 * Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5 *
6 * The version of the OpenAPI document: latest
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// OauthTokenResponse : The token response
12
13
14
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OauthTokenResponse {
17    /// The access token issued by the authorization server.
18    #[serde(rename = "access_token", skip_serializing_if = "Option::is_none")]
19    pub access_token: Option<String>,
20    /// The lifetime in seconds of the access token.  For example, the value \"3600\" denotes that the access token will expire in one hour from the time the response was generated.
21    #[serde(rename = "expires_in", skip_serializing_if = "Option::is_none")]
22    pub expires_in: Option<i64>,
23    /// To retrieve a refresh token request the id_token scope.
24    #[serde(rename = "id_token", skip_serializing_if = "Option::is_none")]
25    pub id_token: Option<i64>,
26    /// The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request.
27    #[serde(rename = "refresh_token", skip_serializing_if = "Option::is_none")]
28    pub refresh_token: Option<String>,
29    /// The scope of the access token
30    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
31    pub scope: Option<i64>,
32    /// The type of the token issued
33    #[serde(rename = "token_type", skip_serializing_if = "Option::is_none")]
34    pub token_type: Option<String>,
35}
36
37impl OauthTokenResponse {
38    /// The token response
39    pub fn new() -> OauthTokenResponse {
40        OauthTokenResponse {
41            access_token: None,
42            expires_in: None,
43            id_token: None,
44            refresh_token: None,
45            scope: None,
46            token_type: None,
47        }
48    }
49}
50
51