Skip to main content

etopay_api_types/api/
dlt.rs

1use super::networks::ApiNetwork;
2use crate::api::decimal::Decimal;
3use serde::{Deserialize, Serialize};
4
5/// Get/set system/user address query parameters
6#[derive(Debug, Deserialize, Serialize, Clone)]
7#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema, utoipa::IntoParams))]
8pub struct AddressQueryParameters {
9    pub network_key: String,
10}
11
12/// Get User address request
13#[derive(Debug, Default, Deserialize, Serialize, Clone)]
14#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
15pub struct SetUserAddressRequest {
16    /// User address
17    pub address: String,
18}
19
20/// Get user address response
21#[derive(Default, Serialize, Deserialize)]
22#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
23pub struct GetUserAddressResponse {
24    /// User address
25    pub address: String,
26}
27
28#[derive(Debug, Deserialize, Serialize, Clone)]
29#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
30pub struct SetPreferredNetworkRequest {
31    /// The key to the preferred network, or None if it should be cleared.
32    pub network_key: Option<String>,
33}
34
35#[derive(Debug, Deserialize, Serialize, Clone)]
36#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
37pub struct GetPreferredNetworkResponse {
38    /// The input string representing the network key, or None if it is not set.
39    pub network_key: Option<String>,
40}
41
42// Get networks from the backend
43#[derive(Debug, Deserialize, Serialize, Clone)]
44#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
45pub struct ApiGetNetworksResponse {
46    pub networks: Vec<ApiNetwork>,
47}
48
49// data objects
50
51#[derive(Debug, Deserialize, Serialize, Clone)]
52#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
53pub struct Course {
54    pub course: Decimal,
55    pub date: String,
56}
57
58// requests
59
60// get course
61
62#[derive(Debug, Deserialize, Serialize, Clone)]
63#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema, utoipa::IntoParams))]
64pub struct GetCourseRequestQueries {
65    pub network_key: String,
66}
67
68#[derive(Debug, Deserialize, Serialize)]
69#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema, utoipa::IntoParams))]
70pub struct GetCourseResponse {
71    pub course: Course,
72}
73
74// get course history
75
76#[derive(Debug, Deserialize, Serialize, Clone)]
77#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema, utoipa::IntoParams))]
78pub struct GetCourseHistoryRequestQueries {
79    pub network_key: String,
80    pub from_date: Option<String>,
81    pub to_date: Option<String>,
82}
83
84#[derive(Debug, Deserialize, Serialize)]
85#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
86pub struct GetCourseHistoryResponse {
87    pub courses: Vec<Course>,
88}