codexsdk 1.0.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * moon-vault-api
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Estimate {
    #[serde(rename = "fromAmount")]
    pub from_amount: String,
    #[serde(rename = "toAmount")]
    pub to_amount: String,
    #[serde(rename = "toAmountMin")]
    pub to_amount_min: String,
    #[serde(rename = "approvalAddress")]
    pub approval_address: String,
    #[serde(rename = "gasCosts")]
    pub gas_costs: Vec<models::GasCost>,
    #[serde(rename = "executionDuration")]
    pub execution_duration: f64,
    #[serde(rename = "feeCosts", skip_serializing_if = "Option::is_none")]
    pub fee_costs: Option<Vec<models::FeeCost>>,
    #[serde(rename = "fromAmountUSD")]
    pub from_amount_usd: String,
    #[serde(rename = "toAmountUSD")]
    pub to_amount_usd: String,
}

impl Estimate {
    pub fn new(from_amount: String, to_amount: String, to_amount_min: String, approval_address: String, gas_costs: Vec<models::GasCost>, execution_duration: f64, from_amount_usd: String, to_amount_usd: String) -> Estimate {
        Estimate {
            from_amount,
            to_amount,
            to_amount_min,
            approval_address,
            gas_costs,
            execution_duration,
            fee_costs: None,
            from_amount_usd,
            to_amount_usd,
        }
    }
}