/*
 * Ethereal Exchange API
 *
 * Ethereal HTTP API for real-time trading, order management, and market data access.
 *
 * The version of the OpenAPI document: 0.1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClaimReferralCodeDtoData {
    /// Address that signed this message
    #[serde(rename = "sender")]
    pub sender: String,
    /// Intent of the message (action to be taken)
    #[serde(rename = "intent")]
    pub intent: Intent,
    /// Message signedAt current timestamp (seconds since Unix Epoch)
    #[serde(rename = "signedAt")]
    pub signed_at: i64,
    /// The referral code to claim
    #[serde(rename = "code")]
    pub code: String,
}

impl ClaimReferralCodeDtoData {
    pub fn new(
        sender: String,
        intent: Intent,
        signed_at: i64,
        code: String,
    ) -> ClaimReferralCodeDtoData {
        ClaimReferralCodeDtoData {
            sender,
            intent,
            signed_at,
            code,
        }
    }
}
/// Intent of the message (action to be taken)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Intent {
    #[serde(rename = "0")]
    REFERRAL_ACTIVATION,
    #[serde(rename = "1")]
    REFERRAL_CLAIM,
    #[serde(rename = "2")]
    REFERRAL_READ,
}

impl Default for Intent {
    fn default() -> Intent {
        Self::REFERRAL_ACTIVATION
    }
}
