deriv_api_schema/
buy_response.rs

1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/buy/receive.json
4
5// Use direct crate names for imports
6use serde::{Deserialize, Serialize};
7use serde_json::Value;
8
9
10
11// Import required types from the *same* crate
12use crate::buy::Buy;
13use crate::subscription::Subscription;
14
15/// A message with transaction results is received
16#[derive(Debug, Clone, Serialize, Deserialize)]
17#[serde(rename_all = "snake_case")]
18pub struct BuyResponse {
19    /// Receipt confirmation for the purchase\n
20    // Correct serde attribute construction - Use helper
21    #[serde(skip_serializing_if = "Option::is_none")] 
22    pub buy: Option<Buy>,
23    /// Echo of the request made.\n
24    // Correct serde attribute construction - Use helper
25    
26    pub echo_req: Value,
27    /// Action name of the request made.\n
28    // Correct serde attribute construction - Use helper
29    
30    pub msg_type: String,
31    /// Optional field sent in request to map to response, present only when request contains `req_id`.\n
32    // Correct serde attribute construction - Use helper
33    #[serde(skip_serializing_if = "Option::is_none")] 
34    pub req_id: Option<i64>,
35    /// For subscription requests only.\n
36    // Correct serde attribute construction - Use helper
37    #[serde(skip_serializing_if = "Option::is_none")] 
38    pub subscription: Option<Subscription>,
39}
40