/
model_quote.go
338 lines (284 loc) · 7.06 KB
/
model_quote.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
/*
Finnhub API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package finnhub
import (
"encoding/json"
)
// Quote struct for Quote
type Quote struct {
// Open price of the day
O *float32 `json:"o,omitempty"`
// High price of the day
H *float32 `json:"h,omitempty"`
// Low price of the day
L *float32 `json:"l,omitempty"`
// Current price
C *float32 `json:"c,omitempty"`
// Previous close price
Pc *float32 `json:"pc,omitempty"`
// Change
D *float32 `json:"d,omitempty"`
// Percent change
Dp *float32 `json:"dp,omitempty"`
}
// NewQuote instantiates a new Quote 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 NewQuote() *Quote {
this := Quote{}
return &this
}
// NewQuoteWithDefaults instantiates a new Quote 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 NewQuoteWithDefaults() *Quote {
this := Quote{}
return &this
}
// GetO returns the O field value if set, zero value otherwise.
func (o *Quote) GetO() float32 {
if o == nil || o.O == nil {
var ret float32
return ret
}
return *o.O
}
// GetOOk returns a tuple with the O field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetOOk() (*float32, bool) {
if o == nil || o.O == nil {
return nil, false
}
return o.O, true
}
// HasO returns a boolean if a field has been set.
func (o *Quote) HasO() bool {
if o != nil && o.O != nil {
return true
}
return false
}
// SetO gets a reference to the given float32 and assigns it to the O field.
func (o *Quote) SetO(v float32) {
o.O = &v
}
// GetH returns the H field value if set, zero value otherwise.
func (o *Quote) GetH() float32 {
if o == nil || o.H == nil {
var ret float32
return ret
}
return *o.H
}
// GetHOk returns a tuple with the H field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetHOk() (*float32, bool) {
if o == nil || o.H == nil {
return nil, false
}
return o.H, true
}
// HasH returns a boolean if a field has been set.
func (o *Quote) HasH() bool {
if o != nil && o.H != nil {
return true
}
return false
}
// SetH gets a reference to the given float32 and assigns it to the H field.
func (o *Quote) SetH(v float32) {
o.H = &v
}
// GetL returns the L field value if set, zero value otherwise.
func (o *Quote) GetL() float32 {
if o == nil || o.L == nil {
var ret float32
return ret
}
return *o.L
}
// GetLOk returns a tuple with the L field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetLOk() (*float32, bool) {
if o == nil || o.L == nil {
return nil, false
}
return o.L, true
}
// HasL returns a boolean if a field has been set.
func (o *Quote) HasL() bool {
if o != nil && o.L != nil {
return true
}
return false
}
// SetL gets a reference to the given float32 and assigns it to the L field.
func (o *Quote) SetL(v float32) {
o.L = &v
}
// GetC returns the C field value if set, zero value otherwise.
func (o *Quote) GetC() float32 {
if o == nil || o.C == nil {
var ret float32
return ret
}
return *o.C
}
// GetCOk returns a tuple with the C field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetCOk() (*float32, bool) {
if o == nil || o.C == nil {
return nil, false
}
return o.C, true
}
// HasC returns a boolean if a field has been set.
func (o *Quote) HasC() bool {
if o != nil && o.C != nil {
return true
}
return false
}
// SetC gets a reference to the given float32 and assigns it to the C field.
func (o *Quote) SetC(v float32) {
o.C = &v
}
// GetPc returns the Pc field value if set, zero value otherwise.
func (o *Quote) GetPc() float32 {
if o == nil || o.Pc == nil {
var ret float32
return ret
}
return *o.Pc
}
// GetPcOk returns a tuple with the Pc field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetPcOk() (*float32, bool) {
if o == nil || o.Pc == nil {
return nil, false
}
return o.Pc, true
}
// HasPc returns a boolean if a field has been set.
func (o *Quote) HasPc() bool {
if o != nil && o.Pc != nil {
return true
}
return false
}
// SetPc gets a reference to the given float32 and assigns it to the Pc field.
func (o *Quote) SetPc(v float32) {
o.Pc = &v
}
// GetD returns the D field value if set, zero value otherwise.
func (o *Quote) GetD() float32 {
if o == nil || o.D == nil {
var ret float32
return ret
}
return *o.D
}
// GetDOk returns a tuple with the D field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetDOk() (*float32, bool) {
if o == nil || o.D == nil {
return nil, false
}
return o.D, true
}
// HasD returns a boolean if a field has been set.
func (o *Quote) HasD() bool {
if o != nil && o.D != nil {
return true
}
return false
}
// SetD gets a reference to the given float32 and assigns it to the D field.
func (o *Quote) SetD(v float32) {
o.D = &v
}
// GetDp returns the Dp field value if set, zero value otherwise.
func (o *Quote) GetDp() float32 {
if o == nil || o.Dp == nil {
var ret float32
return ret
}
return *o.Dp
}
// GetDpOk returns a tuple with the Dp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quote) GetDpOk() (*float32, bool) {
if o == nil || o.Dp == nil {
return nil, false
}
return o.Dp, true
}
// HasDp returns a boolean if a field has been set.
func (o *Quote) HasDp() bool {
if o != nil && o.Dp != nil {
return true
}
return false
}
// SetDp gets a reference to the given float32 and assigns it to the Dp field.
func (o *Quote) SetDp(v float32) {
o.Dp = &v
}
func (o Quote) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.O != nil {
toSerialize["o"] = o.O
}
if o.H != nil {
toSerialize["h"] = o.H
}
if o.L != nil {
toSerialize["l"] = o.L
}
if o.C != nil {
toSerialize["c"] = o.C
}
if o.Pc != nil {
toSerialize["pc"] = o.Pc
}
if o.D != nil {
toSerialize["d"] = o.D
}
if o.Dp != nil {
toSerialize["dp"] = o.Dp
}
return json.Marshal(toSerialize)
}
type NullableQuote struct {
value *Quote
isSet bool
}
func (v NullableQuote) Get() *Quote {
return v.value
}
func (v *NullableQuote) Set(val *Quote) {
v.value = val
v.isSet = true
}
func (v NullableQuote) IsSet() bool {
return v.isSet
}
func (v *NullableQuote) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQuote(val *Quote) *NullableQuote {
return &NullableQuote{value: val, isSet: true}
}
func (v NullableQuote) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQuote) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}