deriv_api_schema/
p2p_advert_update_request.rs

1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/p2p_advert_update/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
12use crate::rate_type::RateType;
13use crate::is_active::IsActive;
14use crate::delete::Delete;
15
16/// Updates a P2P advert. Can only be used by the advertiser.
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(rename_all = "snake_case")]
19pub struct P2pAdvertUpdateRequest {
20    /// [Optional] Advertiser contact information.\n
21    // Correct serde attribute construction - Use helper
22    #[serde(skip_serializing_if = "Option::is_none")] 
23    pub contact_info: Option<String>,
24    /// [Optional] If set to 1, permanently deletes the advert.\n
25    // Correct serde attribute construction - Use helper
26    #[serde(skip_serializing_if = "Option::is_none")] 
27    pub delete: Option<Delete>,
28    /// [Optional] General information about the advert.\n
29    // Correct serde attribute construction - Use helper
30    #[serde(skip_serializing_if = "Option::is_none")] 
31    pub description: Option<String>,
32    /// [Optional] 2 letter country codes. Counterparties who do not live in these countries will not be allowed to place orders against this advert. An empty array or null value will clear the condition.\n
33    // Correct serde attribute construction - Use helper
34    #[serde(skip_serializing_if = "Option::is_none")] 
35    pub eligible_countries: Option<String>,
36    /// The unique identifier for this advert.\n
37    // Correct serde attribute construction - Use helper
38    
39    pub id: String,
40    /// [Optional] Activate or deactivate the advert.\n
41    // Correct serde attribute construction - Use helper
42    #[serde(skip_serializing_if = "Option::is_none")] 
43    pub is_active: Option<IsActive>,
44    /// [Optional] Local currency for this advert.\n
45    // Correct serde attribute construction - Use helper
46    #[serde(skip_serializing_if = "Option::is_none")] 
47    pub local_currency: Option<String>,
48    /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
49    // Correct serde attribute construction - Use helper
50    #[serde(skip_serializing_if = "Option::is_none")] 
51    pub loginid: Option<String>,
52    /// [Optional] Maximum allowed amount for the orders of this advert, in advertiser's `account_currency`. Should be more than or equal to `min_order_amount`.\n
53    // Correct serde attribute construction - Use helper
54    #[serde(skip_serializing_if = "Option::is_none")] 
55    pub max_order_amount: Option<String>,
56    /// [Optional] Counterparties who have a 30 day completion rate less than this value will not be allowed to place orders against this advert. A an empty array or null value will clear the condition.\n
57    // Correct serde attribute construction - Use helper
58    #[serde(skip_serializing_if = "Option::is_none")] 
59    pub min_completion_rate: Option<String>,
60    /// [Optional] Counterparties who joined less than this number of days ago will not be allowed to place orders against this advert. A null value will clear the condition.\n
61    // Correct serde attribute construction - Use helper
62    #[serde(skip_serializing_if = "Option::is_none")] 
63    pub min_join_days: Option<String>,
64    /// [Optional] Minimum allowed amount for the orders of this advert, in advertiser's `account_currency`. Should be less than or equal to `max_order_amount`.\n
65    // Correct serde attribute construction - Use helper
66    #[serde(skip_serializing_if = "Option::is_none")] 
67    pub min_order_amount: Option<String>,
68    /// [Optional] Counterparties who have an average rating less than this value will not be allowed to place orders against this advert. A null value will clear the condition.\n
69    // Correct serde attribute construction - Use helper
70    #[serde(skip_serializing_if = "Option::is_none")] 
71    pub min_rating: Option<String>,
72    /// [Optional] Expiry period (seconds) for order created against this ad.\n
73    // Correct serde attribute construction - Use helper
74    #[serde(skip_serializing_if = "Option::is_none")] 
75    pub order_expiry_period: Option<i64>,
76    /// Field 'p2p_advert_update' mapped to Value due to complexity/potential issues.\n
77    // Correct serde attribute construction - Use helper
78    
79    pub p2p_advert_update: Value,
80    /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
81    // Correct serde attribute construction - Use helper
82    #[serde(skip_serializing_if = "Option::is_none")] 
83    pub passthrough: Option<Value>,
84    /// [Optional] Payment instructions.\n
85    // Correct serde attribute construction - Use helper
86    #[serde(skip_serializing_if = "Option::is_none")] 
87    pub payment_info: Option<String>,
88    /// [Optional] IDs of previously saved payment methods as returned from p2p_advertiser_payment_methods, only applicable for sell ads. Exisiting methods will be replaced.\n
89    // Correct serde attribute construction - Use helper
90    #[serde(skip_serializing_if = "Option::is_none")] 
91    pub payment_method_ids: Option<Vec<i64>>,
92    /// [Optional] Payment method identifiers as returned from p2p_payment_methods, only applicable for buy ads. Exisiting methods will be replaced.\n
93    // Correct serde attribute construction - Use helper
94    #[serde(skip_serializing_if = "Option::is_none")] 
95    pub payment_method_names: Option<Vec<String>>,
96    /// [Optional] Conversion rate from advertiser's account currency to `local_currency`. An absolute rate value (fixed), or percentage offset from current market rate (floating).\n
97    // Correct serde attribute construction - Use helper
98    #[serde(skip_serializing_if = "Option::is_none")] 
99    pub rate: Option<String>,
100    /// [Optional] Type of rate, fixed or floating.\n
101    // Correct serde attribute construction - Use helper
102    #[serde(skip_serializing_if = "Option::is_none")] 
103    pub rate_type: Option<RateType>,
104    /// [Optional] The total available amount of the advert, in advertiser's account currency.\n
105    // Correct serde attribute construction - Use helper
106    #[serde(skip_serializing_if = "Option::is_none")] 
107    pub remaining_amount: Option<String>,
108    /// [Optional] Used to map request to response.\n
109    // Correct serde attribute construction - Use helper
110    #[serde(skip_serializing_if = "Option::is_none")] 
111    pub req_id: Option<i64>,
112}
113