-
Notifications
You must be signed in to change notification settings - Fork 2
/
model_search_query.go
464 lines (393 loc) · 12.1 KB
/
model_search_query.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
/*
Manticore Search Client
Сlient for Manticore Search.
API version: 5.0.0
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the SearchQuery type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SearchQuery{}
// SearchQuery Defines a query structure for performing search operations
type SearchQuery struct {
// Filter object defining a query string
QueryString interface{}
// Filter object defining a match keyword passed as a string or in a Match object
Match interface{}
// Filter object defining a match phrase
MatchPhrase interface{}
// Filter object to select all documents
MatchAll interface{}
Bool *BoolFilter
Equals interface{}
// Filter to match a given set of attribute values.
In interface{}
// Filter to match a given range of attribute values passed in Range objects
Range interface{}
GeoDistance *GeoDistance
Highlight *Highlight
}
// NewSearchQuery instantiates a new SearchQuery 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 NewSearchQuery() *SearchQuery {
this := SearchQuery{}
return &this
}
// NewSearchQueryWithDefaults instantiates a new SearchQuery 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 NewSearchQueryWithDefaults() *SearchQuery {
this := SearchQuery{}
return &this
}
// GetQueryString returns the QueryString field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetQueryString() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.QueryString
}
// GetQueryStringOk returns a tuple with the QueryString field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetQueryStringOk() (*interface{}, bool) {
if o == nil || IsNil(o.QueryString) {
return nil, false
}
return &o.QueryString, true
}
// HasQueryString returns a boolean if a field has been set.
func (o *SearchQuery) HasQueryString() bool {
if o != nil && !IsNil(o.QueryString) {
return true
}
return false
}
// SetQueryString gets a reference to the given interface{} and assigns it to the QueryString field.
func (o *SearchQuery) SetQueryString(v interface{}) {
o.QueryString = v
}
// GetMatch returns the Match field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetMatch() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Match
}
// GetMatchOk returns a tuple with the Match field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetMatchOk() (*interface{}, bool) {
if o == nil || IsNil(o.Match) {
return nil, false
}
return &o.Match, true
}
// HasMatch returns a boolean if a field has been set.
func (o *SearchQuery) HasMatch() bool {
if o != nil && !IsNil(o.Match) {
return true
}
return false
}
// SetMatch gets a reference to the given interface{} and assigns it to the Match field.
func (o *SearchQuery) SetMatch(v interface{}) {
o.Match = v
}
// GetMatchPhrase returns the MatchPhrase field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetMatchPhrase() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.MatchPhrase
}
// GetMatchPhraseOk returns a tuple with the MatchPhrase field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetMatchPhraseOk() (*interface{}, bool) {
if o == nil || IsNil(o.MatchPhrase) {
return nil, false
}
return &o.MatchPhrase, true
}
// HasMatchPhrase returns a boolean if a field has been set.
func (o *SearchQuery) HasMatchPhrase() bool {
if o != nil && !IsNil(o.MatchPhrase) {
return true
}
return false
}
// SetMatchPhrase gets a reference to the given interface{} and assigns it to the MatchPhrase field.
func (o *SearchQuery) SetMatchPhrase(v interface{}) {
o.MatchPhrase = v
}
// GetMatchAll returns the MatchAll field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetMatchAll() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.MatchAll
}
// GetMatchAllOk returns a tuple with the MatchAll field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetMatchAllOk() (*interface{}, bool) {
if o == nil || IsNil(o.MatchAll) {
return nil, false
}
return &o.MatchAll, true
}
// HasMatchAll returns a boolean if a field has been set.
func (o *SearchQuery) HasMatchAll() bool {
if o != nil && !IsNil(o.MatchAll) {
return true
}
return false
}
// SetMatchAll gets a reference to the given interface{} and assigns it to the MatchAll field.
func (o *SearchQuery) SetMatchAll(v interface{}) {
o.MatchAll = v
}
// GetBool returns the Bool field value if set, zero value otherwise.
func (o *SearchQuery) GetBool() BoolFilter {
if o == nil || IsNil(o.Bool) {
var ret BoolFilter
return ret
}
return *o.Bool
}
// GetBoolOk returns a tuple with the Bool field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchQuery) GetBoolOk() (*BoolFilter, bool) {
if o == nil || IsNil(o.Bool) {
return nil, false
}
return o.Bool, true
}
// HasBool returns a boolean if a field has been set.
func (o *SearchQuery) HasBool() bool {
if o != nil && !IsNil(o.Bool) {
return true
}
return false
}
// SetBool gets a reference to the given BoolFilter and assigns it to the Bool field.
func (o *SearchQuery) SetBool(v BoolFilter) {
o.Bool = &v
}
// GetEquals returns the Equals field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetEquals() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Equals
}
// GetEqualsOk returns a tuple with the Equals field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetEqualsOk() (*interface{}, bool) {
if o == nil || IsNil(o.Equals) {
return nil, false
}
return &o.Equals, true
}
// HasEquals returns a boolean if a field has been set.
func (o *SearchQuery) HasEquals() bool {
if o != nil && !IsNil(o.Equals) {
return true
}
return false
}
// SetEquals gets a reference to the given interface{} and assigns it to the Equals field.
func (o *SearchQuery) SetEquals(v interface{}) {
o.Equals = v
}
// GetIn returns the In field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetIn() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.In
}
// GetInOk returns a tuple with the In field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetInOk() (*interface{}, bool) {
if o == nil || IsNil(o.In) {
return nil, false
}
return &o.In, true
}
// HasIn returns a boolean if a field has been set.
func (o *SearchQuery) HasIn() bool {
if o != nil && !IsNil(o.In) {
return true
}
return false
}
// SetIn gets a reference to the given interface{} and assigns it to the In field.
func (o *SearchQuery) SetIn(v interface{}) {
o.In = v
}
// GetRange returns the Range field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SearchQuery) GetRange() interface{} {
if o == nil {
var ret interface{}
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.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SearchQuery) GetRangeOk() (*interface{}, bool) {
if o == nil || IsNil(o.Range) {
return nil, false
}
return &o.Range, true
}
// HasRange returns a boolean if a field has been set.
func (o *SearchQuery) HasRange() bool {
if o != nil && !IsNil(o.Range) {
return true
}
return false
}
// SetRange gets a reference to the given interface{} and assigns it to the Range field.
func (o *SearchQuery) SetRange(v interface{}) {
o.Range = v
}
// GetGeoDistance returns the GeoDistance field value if set, zero value otherwise.
func (o *SearchQuery) GetGeoDistance() GeoDistance {
if o == nil || IsNil(o.GeoDistance) {
var ret GeoDistance
return ret
}
return *o.GeoDistance
}
// GetGeoDistanceOk returns a tuple with the GeoDistance field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchQuery) GetGeoDistanceOk() (*GeoDistance, bool) {
if o == nil || IsNil(o.GeoDistance) {
return nil, false
}
return o.GeoDistance, true
}
// HasGeoDistance returns a boolean if a field has been set.
func (o *SearchQuery) HasGeoDistance() bool {
if o != nil && !IsNil(o.GeoDistance) {
return true
}
return false
}
// SetGeoDistance gets a reference to the given GeoDistance and assigns it to the GeoDistance field.
func (o *SearchQuery) SetGeoDistance(v GeoDistance) {
o.GeoDistance = &v
}
// GetHighlight returns the Highlight field value if set, zero value otherwise.
func (o *SearchQuery) GetHighlight() Highlight {
if o == nil || IsNil(o.Highlight) {
var ret Highlight
return ret
}
return *o.Highlight
}
// GetHighlightOk returns a tuple with the Highlight field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchQuery) GetHighlightOk() (*Highlight, bool) {
if o == nil || IsNil(o.Highlight) {
return nil, false
}
return o.Highlight, true
}
// HasHighlight returns a boolean if a field has been set.
func (o *SearchQuery) HasHighlight() bool {
if o != nil && !IsNil(o.Highlight) {
return true
}
return false
}
// SetHighlight gets a reference to the given Highlight and assigns it to the Highlight field.
func (o *SearchQuery) SetHighlight(v Highlight) {
o.Highlight = &v
}
func (o SearchQuery) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SearchQuery) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.QueryString != nil {
toSerialize["query_string"] = o.QueryString
}
if o.Match != nil {
toSerialize["match"] = o.Match
}
if o.MatchPhrase != nil {
toSerialize["match_phrase"] = o.MatchPhrase
}
if o.MatchAll != nil {
toSerialize["match_all"] = o.MatchAll
}
if !IsNil(o.Bool) {
toSerialize["bool"] = o.Bool
}
if o.Equals != nil {
toSerialize["equals"] = o.Equals
}
if o.In != nil {
toSerialize["in"] = o.In
}
if o.Range != nil {
toSerialize["range"] = o.Range
}
if !IsNil(o.GeoDistance) {
toSerialize["geo_distance"] = o.GeoDistance
}
if !IsNil(o.Highlight) {
toSerialize["highlight"] = o.Highlight
}
return toSerialize, nil
}
type NullableSearchQuery struct {
value *SearchQuery
isSet bool
}
func (v NullableSearchQuery) Get() *SearchQuery {
return v.value
}
func (v *NullableSearchQuery) Set(val *SearchQuery) {
v.value = val
v.isSet = true
}
func (v NullableSearchQuery) IsSet() bool {
return v.isSet
}
func (v *NullableSearchQuery) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSearchQuery(val *SearchQuery) *NullableSearchQuery {
return &NullableSearchQuery{value: val, isSet: true}
}
func (v NullableSearchQuery) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSearchQuery) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}