1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Ethereal Exchange API
*
* Ethereal HTTP API for real-time trading, order management, and market data access.
*
* The version of the OpenAPI document: 0.1.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReferralDto {
/// Id representing the referral
#[serde(rename = "id")]
pub id: uuid::Uuid,
/// Address of the referee (non-checksummed)
#[serde(rename = "referee")]
pub referee: String,
/// Address of the referrer (non-checksummed; undefined if not set)
#[serde(rename = "referrer", skip_serializing_if = "Option::is_none")]
pub referrer: Option<String>,
/// The referee's referral code to be shared and claimed by others (undefined if not activated)
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
/// Number of remaining times the referral code can be claimed
#[serde(rename = "codeUsageRemaining")]
pub code_usage_remaining: f64,
/// Total points (excl. referral points) earned by the referee since referee claimed the code
#[serde(rename = "refereeTotalPoints")]
pub referee_total_points: String,
/// Timestamp of when this referral was activated (ms since Unix Epoch)
#[serde(rename = "createdAt")]
pub created_at: f64,
}
impl ReferralDto {
pub fn new(
id: uuid::Uuid,
referee: String,
code_usage_remaining: f64,
referee_total_points: String,
created_at: f64,
) -> ReferralDto {
ReferralDto {
id,
referee,
referrer: None,
code: None,
code_usage_remaining,
referee_total_points,
created_at,
}
}
}