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
107
108
109
110
111
112
113
114
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DatasetColumn {
order: Option<f32>,
name: Option<String>,
#[serde(rename = "type")]
field_type: Option<String>,
#[serde(rename = "originalType")]
original_type: Option<String>,
description: Option<String>,
}
impl DatasetColumn {
pub fn new(name: impl ToString) -> Self {
Self {
name: Some(name.to_string()),
..Default::default()
}
}
pub fn set_order(&mut self, order: f32) {
self.order = Some(order);
}
pub fn with_order(mut self, order: f32) -> DatasetColumn {
self.order = Some(order);
self
}
pub fn order(&self) -> Option<&f32> {
self.order.as_ref()
}
pub fn reset_order(&mut self) {
self.order = None;
}
pub fn set_name(&mut self, name: String) {
self.name = Some(name);
}
pub fn with_name(mut self, name: String) -> DatasetColumn {
self.name = Some(name);
self
}
pub fn name(&self) -> Option<&String> {
self.name.as_ref()
}
pub fn reset_name(&mut self) {
self.name = None;
}
pub fn set_type(&mut self, _type: String) {
self.field_type = Some(_type);
}
pub fn with_type(mut self, _type: String) -> DatasetColumn {
self.field_type = Some(_type);
self
}
pub fn get_type(&self) -> Option<&String> {
self.field_type.as_ref()
}
pub fn reset_type(&mut self) {
self.field_type = None;
}
pub fn set_original_type(&mut self, original_type: String) {
self.original_type = Some(original_type);
}
pub fn with_original_type(mut self, original_type: String) -> DatasetColumn {
self.original_type = Some(original_type);
self
}
pub fn original_type(&self) -> Option<&String> {
self.original_type.as_ref()
}
pub fn reset_original_type(&mut self) {
self.original_type = None;
}
pub fn set_description(&mut self, description: String) {
self.description = Some(description);
}
pub fn with_description(mut self, description: String) -> DatasetColumn {
self.description = Some(description);
self
}
pub fn description(&self) -> Option<&String> {
self.description.as_ref()
}
pub fn reset_description(&mut self) {
self.description = None;
}
}