-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmodel_meta_aggregations.go
620 lines (526 loc) · 17.2 KB
/
model_meta_aggregations.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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
/*
Zinc Search engine API
Zinc Search engine API documents https://docs.zincsearch.com
API version: 0.3.3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
)
// MetaAggregations struct for MetaAggregations
type MetaAggregations struct {
// nested aggregations
Aggs *map[string]MetaAggregations `json:"aggs,omitempty"`
AutoDateHistogram *MetaAggregationAutoDateHistogram `json:"auto_date_histogram,omitempty"`
Avg *MetaAggregationMetric `json:"avg,omitempty"`
Cardinality *MetaAggregationMetric `json:"cardinality,omitempty"`
Count *MetaAggregationMetric `json:"count,omitempty"`
DateHistogram *MetaAggregationDateHistogram `json:"date_histogram,omitempty"`
DateRange *MetaAggregationDateRange `json:"date_range,omitempty"`
Histogram *MetaAggregationHistogram `json:"histogram,omitempty"`
IpRange *MetaAggregationIPRange `json:"ip_range,omitempty"`
Max *MetaAggregationMetric `json:"max,omitempty"`
Min *MetaAggregationMetric `json:"min,omitempty"`
Range *MetaAggregationRange `json:"range,omitempty"`
Sum *MetaAggregationMetric `json:"sum,omitempty"`
Terms *MetaAggregationsTerms `json:"terms,omitempty"`
WeightedAvg *MetaAggregationMetric `json:"weighted_avg,omitempty"`
}
// NewMetaAggregations instantiates a new MetaAggregations 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 NewMetaAggregations() *MetaAggregations {
this := MetaAggregations{}
return &this
}
// NewMetaAggregationsWithDefaults instantiates a new MetaAggregations 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 NewMetaAggregationsWithDefaults() *MetaAggregations {
this := MetaAggregations{}
return &this
}
// GetAggs returns the Aggs field value if set, zero value otherwise.
func (o *MetaAggregations) GetAggs() map[string]MetaAggregations {
if o == nil || o.Aggs == nil {
var ret map[string]MetaAggregations
return ret
}
return *o.Aggs
}
// GetAggsOk returns a tuple with the Aggs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetAggsOk() (*map[string]MetaAggregations, bool) {
if o == nil || o.Aggs == nil {
return nil, false
}
return o.Aggs, true
}
// HasAggs returns a boolean if a field has been set.
func (o *MetaAggregations) HasAggs() bool {
if o != nil && o.Aggs != nil {
return true
}
return false
}
// SetAggs gets a reference to the given map[string]MetaAggregations and assigns it to the Aggs field.
func (o *MetaAggregations) SetAggs(v map[string]MetaAggregations) {
o.Aggs = &v
}
// GetAutoDateHistogram returns the AutoDateHistogram field value if set, zero value otherwise.
func (o *MetaAggregations) GetAutoDateHistogram() MetaAggregationAutoDateHistogram {
if o == nil || o.AutoDateHistogram == nil {
var ret MetaAggregationAutoDateHistogram
return ret
}
return *o.AutoDateHistogram
}
// GetAutoDateHistogramOk returns a tuple with the AutoDateHistogram field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetAutoDateHistogramOk() (*MetaAggregationAutoDateHistogram, bool) {
if o == nil || o.AutoDateHistogram == nil {
return nil, false
}
return o.AutoDateHistogram, true
}
// HasAutoDateHistogram returns a boolean if a field has been set.
func (o *MetaAggregations) HasAutoDateHistogram() bool {
if o != nil && o.AutoDateHistogram != nil {
return true
}
return false
}
// SetAutoDateHistogram gets a reference to the given MetaAggregationAutoDateHistogram and assigns it to the AutoDateHistogram field.
func (o *MetaAggregations) SetAutoDateHistogram(v MetaAggregationAutoDateHistogram) {
o.AutoDateHistogram = &v
}
// GetAvg returns the Avg field value if set, zero value otherwise.
func (o *MetaAggregations) GetAvg() MetaAggregationMetric {
if o == nil || o.Avg == nil {
var ret MetaAggregationMetric
return ret
}
return *o.Avg
}
// GetAvgOk returns a tuple with the Avg field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetAvgOk() (*MetaAggregationMetric, bool) {
if o == nil || o.Avg == nil {
return nil, false
}
return o.Avg, true
}
// HasAvg returns a boolean if a field has been set.
func (o *MetaAggregations) HasAvg() bool {
if o != nil && o.Avg != nil {
return true
}
return false
}
// SetAvg gets a reference to the given MetaAggregationMetric and assigns it to the Avg field.
func (o *MetaAggregations) SetAvg(v MetaAggregationMetric) {
o.Avg = &v
}
// GetCardinality returns the Cardinality field value if set, zero value otherwise.
func (o *MetaAggregations) GetCardinality() MetaAggregationMetric {
if o == nil || o.Cardinality == nil {
var ret MetaAggregationMetric
return ret
}
return *o.Cardinality
}
// GetCardinalityOk returns a tuple with the Cardinality field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetCardinalityOk() (*MetaAggregationMetric, bool) {
if o == nil || o.Cardinality == nil {
return nil, false
}
return o.Cardinality, true
}
// HasCardinality returns a boolean if a field has been set.
func (o *MetaAggregations) HasCardinality() bool {
if o != nil && o.Cardinality != nil {
return true
}
return false
}
// SetCardinality gets a reference to the given MetaAggregationMetric and assigns it to the Cardinality field.
func (o *MetaAggregations) SetCardinality(v MetaAggregationMetric) {
o.Cardinality = &v
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *MetaAggregations) GetCount() MetaAggregationMetric {
if o == nil || o.Count == nil {
var ret MetaAggregationMetric
return ret
}
return *o.Count
}
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetCountOk() (*MetaAggregationMetric, bool) {
if o == nil || o.Count == nil {
return nil, false
}
return o.Count, true
}
// HasCount returns a boolean if a field has been set.
func (o *MetaAggregations) HasCount() bool {
if o != nil && o.Count != nil {
return true
}
return false
}
// SetCount gets a reference to the given MetaAggregationMetric and assigns it to the Count field.
func (o *MetaAggregations) SetCount(v MetaAggregationMetric) {
o.Count = &v
}
// GetDateHistogram returns the DateHistogram field value if set, zero value otherwise.
func (o *MetaAggregations) GetDateHistogram() MetaAggregationDateHistogram {
if o == nil || o.DateHistogram == nil {
var ret MetaAggregationDateHistogram
return ret
}
return *o.DateHistogram
}
// GetDateHistogramOk returns a tuple with the DateHistogram field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetDateHistogramOk() (*MetaAggregationDateHistogram, bool) {
if o == nil || o.DateHistogram == nil {
return nil, false
}
return o.DateHistogram, true
}
// HasDateHistogram returns a boolean if a field has been set.
func (o *MetaAggregations) HasDateHistogram() bool {
if o != nil && o.DateHistogram != nil {
return true
}
return false
}
// SetDateHistogram gets a reference to the given MetaAggregationDateHistogram and assigns it to the DateHistogram field.
func (o *MetaAggregations) SetDateHistogram(v MetaAggregationDateHistogram) {
o.DateHistogram = &v
}
// GetDateRange returns the DateRange field value if set, zero value otherwise.
func (o *MetaAggregations) GetDateRange() MetaAggregationDateRange {
if o == nil || o.DateRange == nil {
var ret MetaAggregationDateRange
return ret
}
return *o.DateRange
}
// GetDateRangeOk returns a tuple with the DateRange field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetDateRangeOk() (*MetaAggregationDateRange, bool) {
if o == nil || o.DateRange == nil {
return nil, false
}
return o.DateRange, true
}
// HasDateRange returns a boolean if a field has been set.
func (o *MetaAggregations) HasDateRange() bool {
if o != nil && o.DateRange != nil {
return true
}
return false
}
// SetDateRange gets a reference to the given MetaAggregationDateRange and assigns it to the DateRange field.
func (o *MetaAggregations) SetDateRange(v MetaAggregationDateRange) {
o.DateRange = &v
}
// GetHistogram returns the Histogram field value if set, zero value otherwise.
func (o *MetaAggregations) GetHistogram() MetaAggregationHistogram {
if o == nil || o.Histogram == nil {
var ret MetaAggregationHistogram
return ret
}
return *o.Histogram
}
// GetHistogramOk returns a tuple with the Histogram field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetHistogramOk() (*MetaAggregationHistogram, bool) {
if o == nil || o.Histogram == nil {
return nil, false
}
return o.Histogram, true
}
// HasHistogram returns a boolean if a field has been set.
func (o *MetaAggregations) HasHistogram() bool {
if o != nil && o.Histogram != nil {
return true
}
return false
}
// SetHistogram gets a reference to the given MetaAggregationHistogram and assigns it to the Histogram field.
func (o *MetaAggregations) SetHistogram(v MetaAggregationHistogram) {
o.Histogram = &v
}
// GetIpRange returns the IpRange field value if set, zero value otherwise.
func (o *MetaAggregations) GetIpRange() MetaAggregationIPRange {
if o == nil || o.IpRange == nil {
var ret MetaAggregationIPRange
return ret
}
return *o.IpRange
}
// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetIpRangeOk() (*MetaAggregationIPRange, bool) {
if o == nil || o.IpRange == nil {
return nil, false
}
return o.IpRange, true
}
// HasIpRange returns a boolean if a field has been set.
func (o *MetaAggregations) HasIpRange() bool {
if o != nil && o.IpRange != nil {
return true
}
return false
}
// SetIpRange gets a reference to the given MetaAggregationIPRange and assigns it to the IpRange field.
func (o *MetaAggregations) SetIpRange(v MetaAggregationIPRange) {
o.IpRange = &v
}
// GetMax returns the Max field value if set, zero value otherwise.
func (o *MetaAggregations) GetMax() MetaAggregationMetric {
if o == nil || o.Max == nil {
var ret MetaAggregationMetric
return ret
}
return *o.Max
}
// GetMaxOk returns a tuple with the Max field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetMaxOk() (*MetaAggregationMetric, bool) {
if o == nil || o.Max == nil {
return nil, false
}
return o.Max, true
}
// HasMax returns a boolean if a field has been set.
func (o *MetaAggregations) HasMax() bool {
if o != nil && o.Max != nil {
return true
}
return false
}
// SetMax gets a reference to the given MetaAggregationMetric and assigns it to the Max field.
func (o *MetaAggregations) SetMax(v MetaAggregationMetric) {
o.Max = &v
}
// GetMin returns the Min field value if set, zero value otherwise.
func (o *MetaAggregations) GetMin() MetaAggregationMetric {
if o == nil || o.Min == nil {
var ret MetaAggregationMetric
return ret
}
return *o.Min
}
// GetMinOk returns a tuple with the Min field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetMinOk() (*MetaAggregationMetric, bool) {
if o == nil || o.Min == nil {
return nil, false
}
return o.Min, true
}
// HasMin returns a boolean if a field has been set.
func (o *MetaAggregations) HasMin() bool {
if o != nil && o.Min != nil {
return true
}
return false
}
// SetMin gets a reference to the given MetaAggregationMetric and assigns it to the Min field.
func (o *MetaAggregations) SetMin(v MetaAggregationMetric) {
o.Min = &v
}
// GetRange returns the Range field value if set, zero value otherwise.
func (o *MetaAggregations) GetRange() MetaAggregationRange {
if o == nil || o.Range == nil {
var ret MetaAggregationRange
return ret
}
return *o.Range
}
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetRangeOk() (*MetaAggregationRange, bool) {
if o == nil || o.Range == nil {
return nil, false
}
return o.Range, true
}
// HasRange returns a boolean if a field has been set.
func (o *MetaAggregations) HasRange() bool {
if o != nil && o.Range != nil {
return true
}
return false
}
// SetRange gets a reference to the given MetaAggregationRange and assigns it to the Range field.
func (o *MetaAggregations) SetRange(v MetaAggregationRange) {
o.Range = &v
}
// GetSum returns the Sum field value if set, zero value otherwise.
func (o *MetaAggregations) GetSum() MetaAggregationMetric {
if o == nil || o.Sum == nil {
var ret MetaAggregationMetric
return ret
}
return *o.Sum
}
// GetSumOk returns a tuple with the Sum field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetSumOk() (*MetaAggregationMetric, bool) {
if o == nil || o.Sum == nil {
return nil, false
}
return o.Sum, true
}
// HasSum returns a boolean if a field has been set.
func (o *MetaAggregations) HasSum() bool {
if o != nil && o.Sum != nil {
return true
}
return false
}
// SetSum gets a reference to the given MetaAggregationMetric and assigns it to the Sum field.
func (o *MetaAggregations) SetSum(v MetaAggregationMetric) {
o.Sum = &v
}
// GetTerms returns the Terms field value if set, zero value otherwise.
func (o *MetaAggregations) GetTerms() MetaAggregationsTerms {
if o == nil || o.Terms == nil {
var ret MetaAggregationsTerms
return ret
}
return *o.Terms
}
// GetTermsOk returns a tuple with the Terms field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetTermsOk() (*MetaAggregationsTerms, bool) {
if o == nil || o.Terms == nil {
return nil, false
}
return o.Terms, true
}
// HasTerms returns a boolean if a field has been set.
func (o *MetaAggregations) HasTerms() bool {
if o != nil && o.Terms != nil {
return true
}
return false
}
// SetTerms gets a reference to the given MetaAggregationsTerms and assigns it to the Terms field.
func (o *MetaAggregations) SetTerms(v MetaAggregationsTerms) {
o.Terms = &v
}
// GetWeightedAvg returns the WeightedAvg field value if set, zero value otherwise.
func (o *MetaAggregations) GetWeightedAvg() MetaAggregationMetric {
if o == nil || o.WeightedAvg == nil {
var ret MetaAggregationMetric
return ret
}
return *o.WeightedAvg
}
// GetWeightedAvgOk returns a tuple with the WeightedAvg field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetaAggregations) GetWeightedAvgOk() (*MetaAggregationMetric, bool) {
if o == nil || o.WeightedAvg == nil {
return nil, false
}
return o.WeightedAvg, true
}
// HasWeightedAvg returns a boolean if a field has been set.
func (o *MetaAggregations) HasWeightedAvg() bool {
if o != nil && o.WeightedAvg != nil {
return true
}
return false
}
// SetWeightedAvg gets a reference to the given MetaAggregationMetric and assigns it to the WeightedAvg field.
func (o *MetaAggregations) SetWeightedAvg(v MetaAggregationMetric) {
o.WeightedAvg = &v
}
func (o MetaAggregations) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Aggs != nil {
toSerialize["aggs"] = o.Aggs
}
if o.AutoDateHistogram != nil {
toSerialize["auto_date_histogram"] = o.AutoDateHistogram
}
if o.Avg != nil {
toSerialize["avg"] = o.Avg
}
if o.Cardinality != nil {
toSerialize["cardinality"] = o.Cardinality
}
if o.Count != nil {
toSerialize["count"] = o.Count
}
if o.DateHistogram != nil {
toSerialize["date_histogram"] = o.DateHistogram
}
if o.DateRange != nil {
toSerialize["date_range"] = o.DateRange
}
if o.Histogram != nil {
toSerialize["histogram"] = o.Histogram
}
if o.IpRange != nil {
toSerialize["ip_range"] = o.IpRange
}
if o.Max != nil {
toSerialize["max"] = o.Max
}
if o.Min != nil {
toSerialize["min"] = o.Min
}
if o.Range != nil {
toSerialize["range"] = o.Range
}
if o.Sum != nil {
toSerialize["sum"] = o.Sum
}
if o.Terms != nil {
toSerialize["terms"] = o.Terms
}
if o.WeightedAvg != nil {
toSerialize["weighted_avg"] = o.WeightedAvg
}
return json.Marshal(toSerialize)
}
type NullableMetaAggregations struct {
value *MetaAggregations
isSet bool
}
func (v NullableMetaAggregations) Get() *MetaAggregations {
return v.value
}
func (v *NullableMetaAggregations) Set(val *MetaAggregations) {
v.value = val
v.isSet = true
}
func (v NullableMetaAggregations) IsSet() bool {
return v.isSet
}
func (v *NullableMetaAggregations) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetaAggregations(val *MetaAggregations) *NullableMetaAggregations {
return &NullableMetaAggregations{value: val, isSet: true}
}
func (v NullableMetaAggregations) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetaAggregations) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}