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;

/// VerifyAssertionResponse : Response of verifying the IDP assertion.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VerifyAssertionResponse {
    /// The action code.
    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
    pub action: Option<String>,
    /// URL for OTA app installation.
    #[serde(rename = "appInstallationUrl", skip_serializing_if = "Option::is_none")]
    pub app_installation_url: Option<String>,
    /// The custom scheme used by mobile app.
    #[serde(rename = "appScheme", skip_serializing_if = "Option::is_none")]
    pub app_scheme: Option<String>,
    /// The opaque value used by the client to maintain context info between the authentication request and the IDP callback.
    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
    pub context: Option<String>,
    /// The birth date of the IdP account.
    #[serde(rename = "dateOfBirth", skip_serializing_if = "Option::is_none")]
    pub date_of_birth: Option<String>,
    /// The display 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>,
    /// It's true if the email is recycled.
    #[serde(rename = "emailRecycled", skip_serializing_if = "Option::is_none")]
    pub email_recycled: Option<bool>,
    /// The value is true if the IDP is also the email provider. It means the user owns the email.
    #[serde(rename = "emailVerified", skip_serializing_if = "Option::is_none")]
    pub email_verified: Option<bool>,
    /// Client error code.
    #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")]
    pub error_message: 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 unique ID identifies the IdP account.
    #[serde(rename = "federatedId", skip_serializing_if = "Option::is_none")]
    pub federated_id: Option<String>,
    /// The first name of the user.
    #[serde(rename = "firstName", skip_serializing_if = "Option::is_none")]
    pub first_name: Option<String>,
    /// The full name of the user.
    #[serde(rename = "fullName", skip_serializing_if = "Option::is_none")]
    pub full_name: Option<String>,
    /// The ID token.
    #[serde(rename = "idToken", skip_serializing_if = "Option::is_none")]
    pub id_token: Option<String>,
    /// It's the identifier param in the createAuthUri request if the identifier is an email. It can be used to check whether the user input email is different from the asserted email.
    #[serde(rename = "inputEmail", skip_serializing_if = "Option::is_none")]
    pub input_email: Option<String>,
    /// True if it's a new user sign-in, false if it's a returning user.
    #[serde(rename = "isNewUser", skip_serializing_if = "Option::is_none")]
    pub is_new_user: Option<bool>,
    /// The fixed string \"identitytoolkit#VerifyAssertionResponse\".
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The language preference of the user.
    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
    pub language: Option<String>,
    /// The last name of the user.
    #[serde(rename = "lastName", skip_serializing_if = "Option::is_none")]
    pub last_name: 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>,
    /// Whether the assertion is from a non-trusted IDP and need account linking confirmation.
    #[serde(rename = "needConfirmation", skip_serializing_if = "Option::is_none")]
    pub need_confirmation: Option<bool>,
    /// Whether need client to supply email to complete the federated login flow.
    #[serde(rename = "needEmail", skip_serializing_if = "Option::is_none")]
    pub need_email: Option<bool>,
    /// The nick name of the user.
    #[serde(rename = "nickName", skip_serializing_if = "Option::is_none")]
    pub nick_name: 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 OIDC id token.
    #[serde(rename = "oauthIdToken", skip_serializing_if = "Option::is_none")]
    pub oauth_id_token: Option<String>,
    /// The user approved request token for the OpenID OAuth extension.
    #[serde(rename = "oauthRequestToken", skip_serializing_if = "Option::is_none")]
    pub oauth_request_token: Option<String>,
    /// The scope for the OpenID OAuth extension.
    #[serde(rename = "oauthScope", skip_serializing_if = "Option::is_none")]
    pub oauth_scope: Option<String>,
    /// The OAuth1 access token secret.
    #[serde(rename = "oauthTokenSecret", skip_serializing_if = "Option::is_none")]
    pub oauth_token_secret: Option<String>,
    /// The original email stored in the mapping storage. It's returned when the federated ID is associated to a different email.
    #[serde(rename = "originalEmail", skip_serializing_if = "Option::is_none")]
    pub original_email: Option<String>,
    /// The URI of the public accessible profiel picture.
    #[serde(rename = "photoUrl", skip_serializing_if = "Option::is_none")]
    pub photo_url: Option<String>,
    /// The IdP ID. For white listed IdPs it's a short domain name e.g. google.com, aol.com, live.net and yahoo.com. If the \"providerId\" param is set to OpenID OP identifer other than the whilte listed IdPs the OP identifier is returned. If the \"identifier\" param is federated ID in the createAuthUri request. The domain part of the federated ID is returned.
    #[serde(rename = "providerId", skip_serializing_if = "Option::is_none")]
    pub provider_id: Option<String>,
    /// Raw IDP-returned user info.
    #[serde(rename = "rawUserInfo", skip_serializing_if = "Option::is_none")]
    pub raw_user_info: 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>,
    /// The screen_name of a Twitter user or the login name at Github.
    #[serde(rename = "screenName", skip_serializing_if = "Option::is_none")]
    pub screen_name: Option<String>,
    /// The timezone of the user.
    #[serde(rename = "timeZone", skip_serializing_if = "Option::is_none")]
    pub time_zone: Option<String>,
    /// When action is 'map', contains the idps which can be used for confirmation.
    #[serde(rename = "verifiedProvider", skip_serializing_if = "Option::is_none")]
    pub verified_provider: Option<Vec<String>>,
}

impl VerifyAssertionResponse {
    /// Response of verifying the IDP assertion.
    pub fn new() -> VerifyAssertionResponse {
        VerifyAssertionResponse {
            action: None,
            app_installation_url: None,
            app_scheme: None,
            context: None,
            date_of_birth: None,
            display_name: None,
            email: None,
            email_recycled: None,
            email_verified: None,
            error_message: None,
            expires_in: None,
            federated_id: None,
            first_name: None,
            full_name: None,
            id_token: None,
            input_email: None,
            is_new_user: None,
            kind: None,
            language: None,
            last_name: None,
            local_id: None,
            need_confirmation: None,
            need_email: None,
            nick_name: None,
            oauth_access_token: None,
            oauth_authorization_code: None,
            oauth_expire_in: None,
            oauth_id_token: None,
            oauth_request_token: None,
            oauth_scope: None,
            oauth_token_secret: None,
            original_email: None,
            photo_url: None,
            provider_id: None,
            raw_user_info: None,
            refresh_token: None,
            screen_name: None,
            time_zone: None,
            verified_provider: None,
        }
    }
}
