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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* 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 PointsSeasonSummaryDto {
/// Id representing the summary of points in this season
#[serde(rename = "id")]
pub id: uuid::Uuid,
/// Address of the account (non-checksummed)
#[serde(rename = "address")]
pub address: String,
/// Season number
#[serde(rename = "season")]
pub season: f64,
/// Total points earned including referral points in this season expressed as a decimal (precision: 9)
#[serde(rename = "totalPoints")]
pub total_points: String,
/// Total points earned before most recent distribution expressed as a decimal (precision: 9)
#[serde(rename = "previousTotalPoints")]
pub previous_total_points: String,
/// Referral points earned expressed as a decimal (precision: 9)
#[serde(rename = "referralPoints")]
pub referral_points: String,
/// Referral points earned before most recent distribution expressed as a decimal (precision: 9)
#[serde(rename = "previousReferralPoints")]
pub previous_referral_points: String,
/// Current rank in this season
#[serde(rename = "rank")]
pub rank: f64,
/// Rank before most recent distribution
#[serde(rename = "previousRank")]
pub previous_rank: f64,
/// Account tier derived based on activity this season
#[serde(rename = "tier")]
pub tier: Tier,
/// Points season summary creation timestamp (ms since Unix Epoch)
#[serde(rename = "createdAt")]
pub created_at: f64,
/// Points season summary last update timestamp (ms since Unix Epoch)
#[serde(rename = "updatedAt")]
pub updated_at: f64,
}
impl PointsSeasonSummaryDto {
pub fn new(
id: uuid::Uuid,
address: String,
season: f64,
total_points: String,
previous_total_points: String,
referral_points: String,
previous_referral_points: String,
rank: f64,
previous_rank: f64,
tier: Tier,
created_at: f64,
updated_at: f64,
) -> PointsSeasonSummaryDto {
PointsSeasonSummaryDto {
id,
address,
season,
total_points,
previous_total_points,
referral_points,
previous_referral_points,
rank,
previous_rank,
tier,
created_at,
updated_at,
}
}
}
/// Account tier derived based on activity this season
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Tier {
#[serde(rename = "0")]
TIER_0,
#[serde(rename = "1")]
TIER_1,
#[serde(rename = "2")]
TIER_2,
#[serde(rename = "3")]
TIER_3,
#[serde(rename = "4")]
TIER_4,
#[serde(rename = "5")]
TIER_5,
}
impl Default for Tier {
fn default() -> Tier {
Self::TIER_0
}
}