bluefin_api 1.2.0

Bluefin API
Documentation
/*
 * Bluefin API
 *
 * Bluefin API
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// OrderCancellationUpdate : Details of an order cancellation.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderCancellationUpdate {
    /// The unique hash of the order.
    #[serde(rename = "orderHash")]
    pub order_hash: String,
    /// The client-provided order ID.
    #[serde(rename = "clientOrderId", skip_serializing_if = "Option::is_none")]
    pub client_order_id: Option<String>,
    /// The symbol of the market.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The address of the account.
    #[serde(rename = "accountAddress")]
    pub account_address: String,
    /// The timestamp of the order creation in milliseconds.
    #[serde(rename = "createdAtMillis")]
    pub created_at_millis: i64,
    #[serde(rename = "cancellationReason")]
    pub cancellation_reason: models::OrderCancelReason,
    #[serde(rename = "failureToCancelReason", skip_serializing_if = "Option::is_none")]
    pub failure_to_cancel_reason: Option<models::OrderCancellationFailureReason>,
    /// The remaining quantity of the order.
    #[serde(rename = "remainingQuantityE9")]
    pub remaining_quantity_e9: String,
}

impl OrderCancellationUpdate {
    /// Details of an order cancellation.
    pub fn new(order_hash: String, symbol: String, account_address: String, created_at_millis: i64, cancellation_reason: models::OrderCancelReason, remaining_quantity_e9: String) -> OrderCancellationUpdate {
        OrderCancellationUpdate {
            order_hash,
            client_order_id: None,
            symbol,
            account_address,
            created_at_millis,
            cancellation_reason,
            failure_to_cancel_reason: None,
            remaining_quantity_e9,
        }
    }
}