imgur_openapi/models/
access_token.rs

1/*
2 * Imgur API
3 *
4 * Imgur's API exposes the entire Imgur infrastructure via a standardized programmatic interface. Using Imgur's API, you can do just about anything you can do on imgur.com, while using your programming language of choice.
5 *
6 * The version of the OpenAPI document: 0.4.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct AccessToken {
16    #[serde(rename = "access_token")]
17    pub access_token: String,
18    #[serde(rename = "account_id")]
19    pub account_id: i32,
20    #[serde(rename = "account_username")]
21    pub account_username: String,
22    #[serde(rename = "expires_in")]
23    pub expires_in: i32,
24    #[serde(rename = "refresh_token")]
25    pub refresh_token: String,
26    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
27    pub scope: Option<String>,
28    #[serde(rename = "token_type")]
29    pub token_type: String,
30}
31
32impl AccessToken {
33    pub fn new(access_token: String, account_id: i32, account_username: String, expires_in: i32, refresh_token: String, token_type: String) -> AccessToken {
34        AccessToken {
35            access_token,
36            account_id,
37            account_username,
38            expires_in,
39            refresh_token,
40            scope: None,
41            token_type,
42        }
43    }
44}
45
46