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;

/// VerifyPasswordResponse : Request of verifying the password.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VerifyPasswordResponse {
    /// The name of the user.
    #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// The email returned by the IdP. NOTE: The federated login user may not own the email.
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// If idToken is STS id token, then this field will be expiration time of STS id token in seconds.
    #[serde(rename = "expiresIn", skip_serializing_if = "Option::is_none")]
    pub expires_in: Option<String>,
    /// The GITKit token for authenticated user.
    #[serde(rename = "idToken", skip_serializing_if = "Option::is_none")]
    pub id_token: Option<String>,
    /// The fixed string \"identitytoolkit#VerifyPasswordResponse\".
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The RP local ID if it's already been mapped to the IdP account identified by the federated ID.
    #[serde(rename = "localId", skip_serializing_if = "Option::is_none")]
    pub local_id: Option<String>,
    /// The OAuth2 access token.
    #[serde(rename = "oauthAccessToken", skip_serializing_if = "Option::is_none")]
    pub oauth_access_token: Option<String>,
    /// The OAuth2 authorization code.
    #[serde(
        rename = "oauthAuthorizationCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub oauth_authorization_code: Option<String>,
    /// The lifetime in seconds of the OAuth2 access token.
    #[serde(rename = "oauthExpireIn", skip_serializing_if = "Option::is_none")]
    pub oauth_expire_in: Option<i32>,
    /// The URI of the user's photo at IdP
    #[serde(rename = "photoUrl", skip_serializing_if = "Option::is_none")]
    pub photo_url: Option<String>,
    /// If idToken is STS id token, then this field will be refresh token.
    #[serde(rename = "refreshToken", skip_serializing_if = "Option::is_none")]
    pub refresh_token: Option<String>,
    /// Whether the email is registered.
    #[serde(rename = "registered", skip_serializing_if = "Option::is_none")]
    pub registered: Option<bool>,
}

impl VerifyPasswordResponse {
    /// Request of verifying the password.
    pub fn new() -> VerifyPasswordResponse {
        VerifyPasswordResponse {
            display_name: None,
            email: None,
            expires_in: None,
            id_token: None,
            kind: None,
            local_id: None,
            oauth_access_token: None,
            oauth_authorization_code: None,
            oauth_expire_in: None,
            photo_url: None,
            refresh_token: None,
            registered: None,
        }
    }
}
