-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_dex_analytics.go
429 lines (355 loc) · 10.7 KB
/
model_dex_analytics.go
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
/*
Trader Joe Dex API
<p>Discover DeFi with Trader Joe, a leading decentralized exchange. Trade a wide variety of tokens, earn rewards, and engage in secure, peer-to-peer transactions. Trader Joe makes DeFi easy and accessible.
API version: 1.0.0
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package traderjoesdk
import (
"encoding/json"
"fmt"
"time"
)
// checks if the DexAnalytics type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DexAnalytics{}
// DexAnalytics struct for DexAnalytics
type DexAnalytics struct {
Date time.Time `json:"date"`
Timestamp int32 `json:"timestamp"`
ReserveUsd float32 `json:"reserveUsd"`
ReserveNative float32 `json:"reserveNative"`
VolumeUsd float32 `json:"volumeUsd"`
VolumeNative float32 `json:"volumeNative"`
FeesUsd float32 `json:"feesUsd"`
FeesNative float32 `json:"feesNative"`
ProtocolFeesUsd float32 `json:"protocolFeesUsd"`
ProtocolFeesNative float32 `json:"protocolFeesNative"`
AdditionalProperties map[string]interface{}
}
type _DexAnalytics DexAnalytics
// NewDexAnalytics instantiates a new DexAnalytics object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDexAnalytics(date time.Time, timestamp int32, reserveUsd float32, reserveNative float32, volumeUsd float32, volumeNative float32, feesUsd float32, feesNative float32, protocolFeesUsd float32, protocolFeesNative float32) *DexAnalytics {
this := DexAnalytics{}
this.Date = date
this.Timestamp = timestamp
this.ReserveUsd = reserveUsd
this.ReserveNative = reserveNative
this.VolumeUsd = volumeUsd
this.VolumeNative = volumeNative
this.FeesUsd = feesUsd
this.FeesNative = feesNative
this.ProtocolFeesUsd = protocolFeesUsd
this.ProtocolFeesNative = protocolFeesNative
return &this
}
// NewDexAnalyticsWithDefaults instantiates a new DexAnalytics object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDexAnalyticsWithDefaults() *DexAnalytics {
this := DexAnalytics{}
return &this
}
// GetDate returns the Date field value
func (o *DexAnalytics) GetDate() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.Date
}
// GetDateOk returns a tuple with the Date field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetDateOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.Date, true
}
// SetDate sets field value
func (o *DexAnalytics) SetDate(v time.Time) {
o.Date = v
}
// GetTimestamp returns the Timestamp field value
func (o *DexAnalytics) GetTimestamp() int32 {
if o == nil {
var ret int32
return ret
}
return o.Timestamp
}
// GetTimestampOk returns a tuple with the Timestamp field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetTimestampOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Timestamp, true
}
// SetTimestamp sets field value
func (o *DexAnalytics) SetTimestamp(v int32) {
o.Timestamp = v
}
// GetReserveUsd returns the ReserveUsd field value
func (o *DexAnalytics) GetReserveUsd() float32 {
if o == nil {
var ret float32
return ret
}
return o.ReserveUsd
}
// GetReserveUsdOk returns a tuple with the ReserveUsd field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetReserveUsdOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.ReserveUsd, true
}
// SetReserveUsd sets field value
func (o *DexAnalytics) SetReserveUsd(v float32) {
o.ReserveUsd = v
}
// GetReserveNative returns the ReserveNative field value
func (o *DexAnalytics) GetReserveNative() float32 {
if o == nil {
var ret float32
return ret
}
return o.ReserveNative
}
// GetReserveNativeOk returns a tuple with the ReserveNative field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetReserveNativeOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.ReserveNative, true
}
// SetReserveNative sets field value
func (o *DexAnalytics) SetReserveNative(v float32) {
o.ReserveNative = v
}
// GetVolumeUsd returns the VolumeUsd field value
func (o *DexAnalytics) GetVolumeUsd() float32 {
if o == nil {
var ret float32
return ret
}
return o.VolumeUsd
}
// GetVolumeUsdOk returns a tuple with the VolumeUsd field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetVolumeUsdOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.VolumeUsd, true
}
// SetVolumeUsd sets field value
func (o *DexAnalytics) SetVolumeUsd(v float32) {
o.VolumeUsd = v
}
// GetVolumeNative returns the VolumeNative field value
func (o *DexAnalytics) GetVolumeNative() float32 {
if o == nil {
var ret float32
return ret
}
return o.VolumeNative
}
// GetVolumeNativeOk returns a tuple with the VolumeNative field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetVolumeNativeOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.VolumeNative, true
}
// SetVolumeNative sets field value
func (o *DexAnalytics) SetVolumeNative(v float32) {
o.VolumeNative = v
}
// GetFeesUsd returns the FeesUsd field value
func (o *DexAnalytics) GetFeesUsd() float32 {
if o == nil {
var ret float32
return ret
}
return o.FeesUsd
}
// GetFeesUsdOk returns a tuple with the FeesUsd field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetFeesUsdOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.FeesUsd, true
}
// SetFeesUsd sets field value
func (o *DexAnalytics) SetFeesUsd(v float32) {
o.FeesUsd = v
}
// GetFeesNative returns the FeesNative field value
func (o *DexAnalytics) GetFeesNative() float32 {
if o == nil {
var ret float32
return ret
}
return o.FeesNative
}
// GetFeesNativeOk returns a tuple with the FeesNative field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetFeesNativeOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.FeesNative, true
}
// SetFeesNative sets field value
func (o *DexAnalytics) SetFeesNative(v float32) {
o.FeesNative = v
}
// GetProtocolFeesUsd returns the ProtocolFeesUsd field value
func (o *DexAnalytics) GetProtocolFeesUsd() float32 {
if o == nil {
var ret float32
return ret
}
return o.ProtocolFeesUsd
}
// GetProtocolFeesUsdOk returns a tuple with the ProtocolFeesUsd field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetProtocolFeesUsdOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.ProtocolFeesUsd, true
}
// SetProtocolFeesUsd sets field value
func (o *DexAnalytics) SetProtocolFeesUsd(v float32) {
o.ProtocolFeesUsd = v
}
// GetProtocolFeesNative returns the ProtocolFeesNative field value
func (o *DexAnalytics) GetProtocolFeesNative() float32 {
if o == nil {
var ret float32
return ret
}
return o.ProtocolFeesNative
}
// GetProtocolFeesNativeOk returns a tuple with the ProtocolFeesNative field value
// and a boolean to check if the value has been set.
func (o *DexAnalytics) GetProtocolFeesNativeOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.ProtocolFeesNative, true
}
// SetProtocolFeesNative sets field value
func (o *DexAnalytics) SetProtocolFeesNative(v float32) {
o.ProtocolFeesNative = v
}
func (o DexAnalytics) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DexAnalytics) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["date"] = o.Date
toSerialize["timestamp"] = o.Timestamp
toSerialize["reserveUsd"] = o.ReserveUsd
toSerialize["reserveNative"] = o.ReserveNative
toSerialize["volumeUsd"] = o.VolumeUsd
toSerialize["volumeNative"] = o.VolumeNative
toSerialize["feesUsd"] = o.FeesUsd
toSerialize["feesNative"] = o.FeesNative
toSerialize["protocolFeesUsd"] = o.ProtocolFeesUsd
toSerialize["protocolFeesNative"] = o.ProtocolFeesNative
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DexAnalytics) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"date",
"timestamp",
"reserveUsd",
"reserveNative",
"volumeUsd",
"volumeNative",
"feesUsd",
"feesNative",
"protocolFeesUsd",
"protocolFeesNative",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDexAnalytics := _DexAnalytics{}
err = json.Unmarshal(data, &varDexAnalytics)
if err != nil {
return err
}
*o = DexAnalytics(varDexAnalytics)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "date")
delete(additionalProperties, "timestamp")
delete(additionalProperties, "reserveUsd")
delete(additionalProperties, "reserveNative")
delete(additionalProperties, "volumeUsd")
delete(additionalProperties, "volumeNative")
delete(additionalProperties, "feesUsd")
delete(additionalProperties, "feesNative")
delete(additionalProperties, "protocolFeesUsd")
delete(additionalProperties, "protocolFeesNative")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDexAnalytics struct {
value *DexAnalytics
isSet bool
}
func (v NullableDexAnalytics) Get() *DexAnalytics {
return v.value
}
func (v *NullableDexAnalytics) Set(val *DexAnalytics) {
v.value = val
v.isSet = true
}
func (v NullableDexAnalytics) IsSet() bool {
return v.isSet
}
func (v *NullableDexAnalytics) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDexAnalytics(val *DexAnalytics) *NullableDexAnalytics {
return &NullableDexAnalytics{value: val, isSet: true}
}
func (v NullableDexAnalytics) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDexAnalytics) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}