fireblocks-sdk 2025.10.17

Rust implementation of the Fireblocks SDK
Documentation
// Fireblocks API
//
// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderDetails {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "via")]
    pub via: models::AccessType,
    #[serde(rename = "status")]
    pub status: models::OrderStatus,
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    #[serde(rename = "receipt", skip_serializing_if = "Option::is_none")]
    pub receipt: Option<models::TransferReceipt>,
    #[serde(rename = "generalFees", skip_serializing_if = "Option::is_none")]
    pub general_fees: Option<Vec<models::Fee>>,
    #[serde(rename = "executionSteps")]
    pub execution_steps: Vec<models::ExecutionStep>,
    #[serde(rename = "executionResponseDetails")]
    pub execution_response_details: models::ExecutionResponseDetails,
    #[serde(rename = "settlement")]
    pub settlement: models::Settlement,
    #[serde(
        rename = "participantsIdentification",
        skip_serializing_if = "Option::is_none"
    )]
    pub participants_identification: Option<models::ParticipantsIdentification>,
    /// Payment instructions for the order, the client can use one of these to
    /// pay the order.
    #[serde(
        rename = "paymentInstructions",
        skip_serializing_if = "Option::is_none"
    )]
    pub payment_instructions: Option<Vec<models::PaymentInstructions>>,
    /// The ID of the user who created the order
    #[serde(rename = "createdBy")]
    pub created_by: String,
    /// Internal reference ID for the customer
    #[serde(
        rename = "customerInternalReferenceId",
        skip_serializing_if = "Option::is_none"
    )]
    pub customer_internal_reference_id: Option<String>,
    /// Optional note for the Order
    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
    pub note: Option<String>,
    #[serde(rename = "expiresAt", skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<String>,
}

impl OrderDetails {
    pub fn new(
        id: String,
        via: models::AccessType,
        status: models::OrderStatus,
        created_at: String,
        execution_steps: Vec<models::ExecutionStep>,
        execution_response_details: models::ExecutionResponseDetails,
        settlement: models::Settlement,
        created_by: String,
    ) -> OrderDetails {
        OrderDetails {
            id,
            via,
            status,
            created_at,
            updated_at: None,
            receipt: None,
            general_fees: None,
            execution_steps,
            execution_response_details,
            settlement,
            participants_identification: None,
            payment_instructions: None,
            created_by,
            customer_internal_reference_id: None,
            note: None,
            expires_at: None,
        }
    }
}