/*
 * 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 InitiateWithdrawDtoData {
    /// Account address to withdraw from
    #[serde(rename = "account")]
    pub account: String,
    /// Bytes32 encoded subaccount name (0x prefix, zero padded)
    #[serde(rename = "subaccount")]
    pub subaccount: String,
    /// Address of token to be withdrawn
    #[serde(rename = "token")]
    pub token: String,
    /// Amount to withdraw in native units expressed as a decimal (precision: 9)
    #[serde(rename = "amount")]
    pub amount: rust_decimal::Decimal,
    /// Bytes32 encoded LayerZero destination address (with 0x prefix, left zero padded)
    #[serde(rename = "lzDestinationAddress")]
    pub lz_destination_address: String,
    /// LayerZero destination endpoint ID for the transfer (zero if not bridging)
    #[serde(rename = "lzDestinationEid")]
    pub lz_destination_eid: LzDestinationEid,
    /// Message nonce timestamp (nanoseconds since Unix Epoch)
    #[serde(rename = "nonce")]
    pub nonce: String,
    /// Message signedAt current timestamp (seconds since Unix Epoch)
    #[serde(rename = "signedAt")]
    pub signed_at: i64,
}

impl InitiateWithdrawDtoData {
    pub fn new(
        account: String,
        subaccount: String,
        token: String,
        amount: rust_decimal::Decimal,
        lz_destination_address: String,
        lz_destination_eid: LzDestinationEid,
        nonce: String,
        signed_at: i64,
    ) -> InitiateWithdrawDtoData {
        InitiateWithdrawDtoData {
            account,
            subaccount,
            token,
            amount,
            lz_destination_address,
            lz_destination_eid,
            nonce,
            signed_at,
        }
    }
}
/// LayerZero destination endpoint ID for the transfer (zero if not bridging)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LzDestinationEid {
    #[serde(rename = "0")]
    NONE,
    #[serde(rename = "40422")]
    ETHEREAL_TESTNET,
    #[serde(rename = "40231")]
    ARBITRUM_SEPOLIA,
    #[serde(rename = "40161")]
    ETHEREUM_SEPOLIA,
    #[serde(rename = "30391")]
    ETHEREAL_MAINNET,
    #[serde(rename = "30110")]
    ARBITRUM_MAINNET,
    #[serde(rename = "30101")]
    ETHEREUM_MAINNET,
}

impl Default for LzDestinationEid {
    fn default() -> LzDestinationEid {
        Self::NONE
    }
}
