deriv_api_schema/p2p_advert_list_request.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/p2p_advert_list/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::hide_ineligible::HideIneligible;
13use crate::hide_client_schedule_unavailable::HideClientScheduleUnavailable;
14use crate::use_client_limits::UseClientLimits;
15use crate::counterparty_type::CounterpartyType;
16use crate::sort_by::SortBy;
17use crate::block_trade::BlockTrade;
18use crate::favourites_only::FavouritesOnly;
19
20/// Returns available adverts for use with `p2p_order_create` .
21#[derive(Debug, Clone, Serialize, Deserialize)]
22#[serde(rename_all = "snake_case")]
23pub struct P2pAdvertListRequest {
24 /// [Optional] ID of the advertiser to list adverts for.\n
25 // Correct serde attribute construction - Use helper
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub advertiser_id: Option<String>,
28 /// [Optional] Search for advertiser by name. Partial matches will be returned.\n
29 // Correct serde attribute construction - Use helper
30 #[serde(skip_serializing_if = "Option::is_none")]
31 pub advertiser_name: Option<String>,
32 /// [Optional] How much to buy or sell, used to calculate prices.\n
33 // Correct serde attribute construction - Use helper
34 #[serde(skip_serializing_if = "Option::is_none")]
35 pub amount: Option<String>,
36 /// [Optional] Return block trade adverts when 1, non-block trade adverts when 0 (default).\n
37 // Correct serde attribute construction - Use helper
38 #[serde(skip_serializing_if = "Option::is_none")]
39 pub block_trade: Option<BlockTrade>,
40 /// [Optional] Filter the adverts by `counterparty_type`.\n
41 // Correct serde attribute construction - Use helper
42 #[serde(skip_serializing_if = "Option::is_none")]
43 pub counterparty_type: Option<CounterpartyType>,
44 /// [Optional] Only show adverts from favourite advertisers. Default is 0.\n
45 // Correct serde attribute construction - Use helper
46 #[serde(skip_serializing_if = "Option::is_none")]
47 pub favourites_only: Option<FavouritesOnly>,
48 /// [Optional] If set to 1, adverts for which the current user's shcedule does not have availability from now until the full possible order expiry are not returned.\n
49 // Correct serde attribute construction - Use helper
50 #[serde(skip_serializing_if = "Option::is_none")]
51 pub hide_client_schedule_unavailable: Option<HideClientScheduleUnavailable>,
52 /// [Optional] If set to 1, adverts for which the current user does not meet counteryparty terms are not returned.\n
53 // Correct serde attribute construction - Use helper
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub hide_ineligible: Option<HideIneligible>,
56 /// [Optional] Used for paging.\n
57 // Correct serde attribute construction - Use helper
58 #[serde(skip_serializing_if = "Option::is_none")]
59 pub limit: Option<i64>,
60 /// [Optional] Currency to conduct payment transaction in. If not provided, only ads from country of residence will be returned.\n
61 // Correct serde attribute construction - Use helper
62 #[serde(skip_serializing_if = "Option::is_none")]
63 pub local_currency: Option<String>,
64 /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
65 // Correct serde attribute construction - Use helper
66 #[serde(skip_serializing_if = "Option::is_none")]
67 pub loginid: Option<String>,
68 /// [Optional] Used for paging.\n
69 // Correct serde attribute construction - Use helper
70 #[serde(skip_serializing_if = "Option::is_none")]
71 pub offset: Option<i64>,
72 /// Must be 1\n
73 // Correct serde attribute construction - Use helper
74
75 pub p2p_advert_list: i64,
76 /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
77 // Correct serde attribute construction - Use helper
78 #[serde(skip_serializing_if = "Option::is_none")]
79 pub passthrough: Option<Value>,
80 /// [Optional] Search by supported payment methods.\n
81 // Correct serde attribute construction - Use helper
82 #[serde(skip_serializing_if = "Option::is_none")]
83 pub payment_method: Option<Vec<String>>,
84 /// [Optional] Used to map request to response.\n
85 // Correct serde attribute construction - Use helper
86 #[serde(skip_serializing_if = "Option::is_none")]
87 pub req_id: Option<i64>,
88 /// [Optional] How the results are sorted.\n
89 // Correct serde attribute construction - Use helper
90 #[serde(skip_serializing_if = "Option::is_none")]
91 pub sort_by: Option<SortBy>,
92 /// [Optional] If set to 1, ads that exceed this account's balance or turnover limits will not be shown.\n
93 // Correct serde attribute construction - Use helper
94 #[serde(skip_serializing_if = "Option::is_none")]
95 pub use_client_limits: Option<UseClientLimits>,
96}
97