/*
 * OpenAPI
 *
 * OpenAPI
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TokenTransferMessageData {
    #[serde(rename = "t")]
    pub t: i64,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "sid")]
    pub sid: uuid::Uuid,
    #[serde(rename = "tName")]
    pub t_name: String,
    /// Token address as hex string.
    #[serde(rename = "tAddr")]
    pub t_addr: String,
    #[serde(rename = "typ")]
    pub typ: models::TransferDtoOrderType,
    #[serde(rename = "st")]
    pub st: models::TransferDtoOrderStatus,
    /// Transfer amount as a decimal string.
    #[serde(rename = "amt")]
    pub amt: rust_decimal::Decimal,
    /// Transfer fee as a decimal string.
    #[serde(rename = "fee")]
    pub fee: rust_decimal::Decimal,
    #[serde(rename = "iniBk", skip_serializing_if = "Option::is_none")]
    pub ini_bk: Option<String>,
    #[serde(rename = "finBk", skip_serializing_if = "Option::is_none")]
    pub fin_bk: Option<String>,
    /// Initial transaction hash as hex string.
    #[serde(rename = "iniTx", skip_serializing_if = "Option::is_none")]
    pub ini_tx: Option<String>,
    /// Final transaction hash as hex string.
    #[serde(rename = "finTx", skip_serializing_if = "Option::is_none")]
    pub fin_tx: Option<String>,
    /// LayerZero address as hex string.
    #[serde(rename = "lzAddr", skip_serializing_if = "Option::is_none")]
    pub lz_addr: Option<String>,
    #[serde(rename = "lzEid", skip_serializing_if = "Option::is_none")]
    pub lz_eid: Option<i64>,
}

impl TokenTransferMessageData {
    pub fn new(
        t: i64,
        id: uuid::Uuid,
        sid: uuid::Uuid,
        t_name: String,
        t_addr: String,
        typ: models::TransferDtoOrderType,
        st: models::TransferDtoOrderStatus,
        amt: rust_decimal::Decimal,
        fee: rust_decimal::Decimal,
    ) -> TokenTransferMessageData {
        TokenTransferMessageData {
            t,
            id,
            sid,
            t_name,
            t_addr,
            typ,
            st,
            amt,
            fee,
            ini_bk: None,
            fin_bk: None,
            ini_tx: None,
            fin_tx: None,
            lz_addr: None,
            lz_eid: None,
        }
    }
}
