use serde::{Deserialize, Serialize}; /*
                                      * Google Identity Toolkit API
                                      *
                                      * Help the third party sites to implement federated login.
                                      *
                                      * The version of the OpenAPI document: v3
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::identitytoolkit_v3::models;

/// EmailLinkSigninResponse : Response of email signIn.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EmailLinkSigninResponse {
    /// The user's email.
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Expiration time of STS id token in seconds.
    #[serde(rename = "expiresIn", skip_serializing_if = "Option::is_none")]
    pub expires_in: Option<String>,
    /// The STS id token to login the newly signed in user.
    #[serde(rename = "idToken", skip_serializing_if = "Option::is_none")]
    pub id_token: Option<String>,
    /// Whether the user is new.
    #[serde(rename = "isNewUser", skip_serializing_if = "Option::is_none")]
    pub is_new_user: Option<bool>,
    /// The fixed string \"identitytoolkit#EmailLinkSigninResponse\".
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The RP local ID of the user.
    #[serde(rename = "localId", skip_serializing_if = "Option::is_none")]
    pub local_id: Option<String>,
    /// The refresh token for the signed in user.
    #[serde(rename = "refreshToken", skip_serializing_if = "Option::is_none")]
    pub refresh_token: Option<String>,
}

impl EmailLinkSigninResponse {
    /// Response of email signIn.
    pub fn new() -> EmailLinkSigninResponse {
        EmailLinkSigninResponse {
            email: None,
            expires_in: None,
            id_token: None,
            is_new_user: None,
            kind: None,
            local_id: None,
            refresh_token: None,
        }
    }
}
