-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_v1_aggregation_params.go
332 lines (278 loc) · 8.87 KB
/
model_v1_aggregation_params.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
/*
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"
)
// V1AggregationParams struct for V1AggregationParams
type V1AggregationParams struct {
AggType *string `json:"agg_type,omitempty"`
Aggs *map[string]V1AggregationParams `json:"aggs,omitempty"`
DateRanges []V1AggregationDateRange `json:"date_ranges,omitempty"`
Field *string `json:"field,omitempty"`
Ranges []V1AggregationNumberRange `json:"ranges,omitempty"`
Size *int32 `json:"size,omitempty"`
// Field name to be used for setting weight for primary field for weighted average aggregation
WeightField *string `json:"weight_field,omitempty"`
}
// NewV1AggregationParams instantiates a new V1AggregationParams 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 NewV1AggregationParams() *V1AggregationParams {
this := V1AggregationParams{}
return &this
}
// NewV1AggregationParamsWithDefaults instantiates a new V1AggregationParams 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 NewV1AggregationParamsWithDefaults() *V1AggregationParams {
this := V1AggregationParams{}
return &this
}
// GetAggType returns the AggType field value if set, zero value otherwise.
func (o *V1AggregationParams) GetAggType() string {
if o == nil || o.AggType == nil {
var ret string
return ret
}
return *o.AggType
}
// GetAggTypeOk returns a tuple with the AggType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetAggTypeOk() (*string, bool) {
if o == nil || o.AggType == nil {
return nil, false
}
return o.AggType, true
}
// HasAggType returns a boolean if a field has been set.
func (o *V1AggregationParams) HasAggType() bool {
if o != nil && o.AggType != nil {
return true
}
return false
}
// SetAggType gets a reference to the given string and assigns it to the AggType field.
func (o *V1AggregationParams) SetAggType(v string) {
o.AggType = &v
}
// GetAggs returns the Aggs field value if set, zero value otherwise.
func (o *V1AggregationParams) GetAggs() map[string]V1AggregationParams {
if o == nil || o.Aggs == nil {
var ret map[string]V1AggregationParams
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 *V1AggregationParams) GetAggsOk() (*map[string]V1AggregationParams, 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 *V1AggregationParams) HasAggs() bool {
if o != nil && o.Aggs != nil {
return true
}
return false
}
// SetAggs gets a reference to the given map[string]V1AggregationParams and assigns it to the Aggs field.
func (o *V1AggregationParams) SetAggs(v map[string]V1AggregationParams) {
o.Aggs = &v
}
// GetDateRanges returns the DateRanges field value if set, zero value otherwise.
func (o *V1AggregationParams) GetDateRanges() []V1AggregationDateRange {
if o == nil || o.DateRanges == nil {
var ret []V1AggregationDateRange
return ret
}
return o.DateRanges
}
// GetDateRangesOk returns a tuple with the DateRanges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetDateRangesOk() ([]V1AggregationDateRange, bool) {
if o == nil || o.DateRanges == nil {
return nil, false
}
return o.DateRanges, true
}
// HasDateRanges returns a boolean if a field has been set.
func (o *V1AggregationParams) HasDateRanges() bool {
if o != nil && o.DateRanges != nil {
return true
}
return false
}
// SetDateRanges gets a reference to the given []V1AggregationDateRange and assigns it to the DateRanges field.
func (o *V1AggregationParams) SetDateRanges(v []V1AggregationDateRange) {
o.DateRanges = v
}
// GetField returns the Field field value if set, zero value otherwise.
func (o *V1AggregationParams) GetField() string {
if o == nil || o.Field == nil {
var ret string
return ret
}
return *o.Field
}
// GetFieldOk returns a tuple with the Field field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetFieldOk() (*string, bool) {
if o == nil || o.Field == nil {
return nil, false
}
return o.Field, true
}
// HasField returns a boolean if a field has been set.
func (o *V1AggregationParams) HasField() bool {
if o != nil && o.Field != nil {
return true
}
return false
}
// SetField gets a reference to the given string and assigns it to the Field field.
func (o *V1AggregationParams) SetField(v string) {
o.Field = &v
}
// GetRanges returns the Ranges field value if set, zero value otherwise.
func (o *V1AggregationParams) GetRanges() []V1AggregationNumberRange {
if o == nil || o.Ranges == nil {
var ret []V1AggregationNumberRange
return ret
}
return o.Ranges
}
// GetRangesOk returns a tuple with the Ranges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetRangesOk() ([]V1AggregationNumberRange, bool) {
if o == nil || o.Ranges == nil {
return nil, false
}
return o.Ranges, true
}
// HasRanges returns a boolean if a field has been set.
func (o *V1AggregationParams) HasRanges() bool {
if o != nil && o.Ranges != nil {
return true
}
return false
}
// SetRanges gets a reference to the given []V1AggregationNumberRange and assigns it to the Ranges field.
func (o *V1AggregationParams) SetRanges(v []V1AggregationNumberRange) {
o.Ranges = v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *V1AggregationParams) GetSize() int32 {
if o == nil || o.Size == nil {
var ret int32
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetSizeOk() (*int32, bool) {
if o == nil || o.Size == nil {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *V1AggregationParams) HasSize() bool {
if o != nil && o.Size != nil {
return true
}
return false
}
// SetSize gets a reference to the given int32 and assigns it to the Size field.
func (o *V1AggregationParams) SetSize(v int32) {
o.Size = &v
}
// GetWeightField returns the WeightField field value if set, zero value otherwise.
func (o *V1AggregationParams) GetWeightField() string {
if o == nil || o.WeightField == nil {
var ret string
return ret
}
return *o.WeightField
}
// GetWeightFieldOk returns a tuple with the WeightField field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V1AggregationParams) GetWeightFieldOk() (*string, bool) {
if o == nil || o.WeightField == nil {
return nil, false
}
return o.WeightField, true
}
// HasWeightField returns a boolean if a field has been set.
func (o *V1AggregationParams) HasWeightField() bool {
if o != nil && o.WeightField != nil {
return true
}
return false
}
// SetWeightField gets a reference to the given string and assigns it to the WeightField field.
func (o *V1AggregationParams) SetWeightField(v string) {
o.WeightField = &v
}
func (o V1AggregationParams) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.AggType != nil {
toSerialize["agg_type"] = o.AggType
}
if o.Aggs != nil {
toSerialize["aggs"] = o.Aggs
}
if o.DateRanges != nil {
toSerialize["date_ranges"] = o.DateRanges
}
if o.Field != nil {
toSerialize["field"] = o.Field
}
if o.Ranges != nil {
toSerialize["ranges"] = o.Ranges
}
if o.Size != nil {
toSerialize["size"] = o.Size
}
if o.WeightField != nil {
toSerialize["weight_field"] = o.WeightField
}
return json.Marshal(toSerialize)
}
type NullableV1AggregationParams struct {
value *V1AggregationParams
isSet bool
}
func (v NullableV1AggregationParams) Get() *V1AggregationParams {
return v.value
}
func (v *NullableV1AggregationParams) Set(val *V1AggregationParams) {
v.value = val
v.isSet = true
}
func (v NullableV1AggregationParams) IsSet() bool {
return v.isSet
}
func (v *NullableV1AggregationParams) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV1AggregationParams(val *V1AggregationParams) *NullableV1AggregationParams {
return &NullableV1AggregationParams{value: val, isSet: true}
}
func (v NullableV1AggregationParams) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV1AggregationParams) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}