deriv_api_schema/p2p_order_create_request.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/p2p_order_create/send.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
12
13/// Creates a P2P order for the specified advert.
14#[derive(Debug, Clone, Serialize, Deserialize)]
15#[serde(rename_all = "snake_case")]
16pub struct P2pOrderCreateRequest {
17 /// The unique identifier for the advert to create an order against.\n
18 // Correct serde attribute construction - Use helper
19
20 pub advert_id: String,
21 /// The amount of currency to be bought or sold.\n
22 // Correct serde attribute construction - Use helper
23
24 pub amount: String,
25 /// [Optional] Seller contact information. Only applicable for 'sell orders'.\n
26 // Correct serde attribute construction - Use helper
27 #[serde(skip_serializing_if = "Option::is_none")]
28 pub contact_info: Option<String>,
29 /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
30 // Correct serde attribute construction - Use helper
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub loginid: Option<String>,
33 /// Field 'p2p_order_create' mapped to Value due to complexity/potential issues.\n
34 // Correct serde attribute construction - Use helper
35
36 pub p2p_order_create: Value,
37 /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
38 // Correct serde attribute construction - Use helper
39 #[serde(skip_serializing_if = "Option::is_none")]
40 pub passthrough: Option<Value>,
41 /// [Optional] Payment instructions, only applicable for sell orders.\n
42 // Correct serde attribute construction - Use helper
43 #[serde(skip_serializing_if = "Option::is_none")]
44 pub payment_info: Option<String>,
45 /// IDs of payment methods, only applicable for sell orders.\n
46 // Correct serde attribute construction - Use helper
47 #[serde(skip_serializing_if = "Option::is_none")]
48 pub payment_method_ids: Option<Vec<i64>>,
49 /// [Optional] Conversion rate from account currency to local currency, only applicable for floating rate adverts.\n
50 // Correct serde attribute construction - Use helper
51 #[serde(skip_serializing_if = "Option::is_none")]
52 pub rate: Option<f64>,
53 /// [Optional] Used to map request to response.\n
54 // Correct serde attribute construction - Use helper
55 #[serde(skip_serializing_if = "Option::is_none")]
56 pub req_id: Option<i64>,
57 /// [Optional] If set to 1, will send updates whenever there is an update to the order.\n
58 // Correct serde attribute construction - Use helper
59 #[serde(skip_serializing_if = "Option::is_none")]
60 pub subscribe: Option<i64>,
61}
62