deriv_api_schema/parameters.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/buy_contract_for_multiple_accounts/send.json
4
5// Use direct crate names for imports within generated files
6use serde::{Deserialize, Serialize};
7
8
9use chrono::{DateTime, Utc};
10
11// Import shared types from the *same* crate
12use crate::contract_type::ContractType;
13use crate::duration_unit::DurationUnit;
14
15// It's a struct
16/// [Optional] Used to pass the parameters for contract buy.
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(rename_all = "snake_case")]
19pub struct Parameters {
20 /// [Optional] Proposed `payout` or `stake` value\n
21 // Correct serde attribute construction - Use helper
22 #[serde(skip_serializing_if = "Option::is_none")]
23 pub amount: Option<String>,
24 /// [Optional] Markup added to contract prices (as a percentage of contract payout)\n
25 // Correct serde attribute construction - Use helper
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub app_markup_percentage: Option<String>,
28 /// [Optional] Barrier for the contract (or last digit prediction for digit contracts). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), where entry spot would be adjusted accordingly with that amount to define a barrier, except for Synthetic Indices as they support both relative and absolute barriers.\n
29 // Correct serde attribute construction - Use helper
30 #[serde(skip_serializing_if = "Option::is_none")]
31 pub barrier: Option<String>,
32 /// [Optional] Low barrier for the contract (for contracts with two barriers). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), where entry spot would be adjusted accordingly with that amount to define a barrier, except for Synthetic Indices as they support both relative and absolute barriers.\n
33 // Correct serde attribute construction - Use helper
34 #[serde(skip_serializing_if = "Option::is_none")]
35 pub barrier2: Option<String>,
36 /// [Optional] Indicate whether amount is 'payout' or 'stake'.\n
37 // Correct serde attribute construction - Use helper
38 #[serde(skip_serializing_if = "Option::is_none")]
39 pub basis: Option<String>,
40 /// A valid contract-type\n
41 // Correct serde attribute construction - Use helper
42
43 pub contract_type: ContractType,
44 /// This can only be the account-holder's currency\n
45 // Correct serde attribute construction - Use helper
46
47 pub currency: String,
48 /// [Optional] Epoch value of the expiry time of the contract. You must either specify `date_expiry` or `duration`.\n
49 // Correct serde attribute construction - Use helper
50 #[serde(skip_serializing_if = "Option::is_none")]
51 pub date_expiry: Option<String>,
52 /// [Optional] For forward-starting contracts, epoch value of the starting time of the contract.\n
53 // Correct serde attribute construction - Use helper
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub date_start: Option<DateTime<Utc>>,
56 /// [Optional] Duration quantity\n
57 // Correct serde attribute construction - Use helper
58 #[serde(skip_serializing_if = "Option::is_none")]
59 pub duration: Option<i64>,
60 /// [Optional] Duration unit is `s`: seconds, `m`: minutes, `h`: hours, `d`: days, `t`: ticks\n
61 // Correct serde attribute construction - Use helper
62 #[serde(skip_serializing_if = "Option::is_none")]
63 pub duration_unit: Option<DurationUnit>,
64 /// [Optional] The multiplier for non-binary options. E.g. lookbacks.\n
65 // Correct serde attribute construction - Use helper
66 #[serde(skip_serializing_if = "Option::is_none")]
67 pub multiplier: Option<f64>,
68 /// [Optional] The tick that is predicted to have the highest/lowest value - for tickhigh and ticklow contracts.\n
69 // Correct serde attribute construction - Use helper
70 #[serde(skip_serializing_if = "Option::is_none")]
71 pub selected_tick: Option<String>,
72 /// Symbol code\n
73 // Correct serde attribute construction - Use helper
74
75 pub symbol: String,
76}
77