/
model_search_stats.go
618 lines (526 loc) · 17.5 KB
/
model_search_stats.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
/*
Cortex XSOAR API
This is the public REST API to integrate with the Cortex XSOAR server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Cortex XSOAR web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Cortex XSOAR REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Cortex XSOAR server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Cortex XSOAR has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Cortex XSOAR will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: <API Key goes here>' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ```
API version: 2.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"time"
)
// SearchStats struct for SearchStats
type SearchStats struct {
Committed *time.Time `json:"committed,omitempty"`
Duration *int64 `json:"duration,omitempty"`
FromDate *time.Time `json:"fromDate,omitempty"`
Highlight *map[string][]string `json:"highlight,omitempty"`
Id *string `json:"id,omitempty"`
Modified *time.Time `json:"modified,omitempty"`
NumericId *int64 `json:"numericId,omitempty"`
PrimaryTerm *int64 `json:"primaryTerm,omitempty"`
Query *string `json:"query,omitempty"`
SearchSource *string `json:"searchSource,omitempty"`
SequenceNumber *int64 `json:"sequenceNumber,omitempty"`
SortValues *[]string `json:"sortValues,omitempty"`
ToDate *time.Time `json:"toDate,omitempty"`
Username *string `json:"username,omitempty"`
Version *int64 `json:"version,omitempty"`
}
// NewSearchStats instantiates a new SearchStats 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 NewSearchStats() *SearchStats {
this := SearchStats{}
return &this
}
// NewSearchStatsWithDefaults instantiates a new SearchStats 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 NewSearchStatsWithDefaults() *SearchStats {
this := SearchStats{}
return &this
}
// GetCommitted returns the Committed field value if set, zero value otherwise.
func (o *SearchStats) GetCommitted() time.Time {
if o == nil || o.Committed == nil {
var ret time.Time
return ret
}
return *o.Committed
}
// GetCommittedOk returns a tuple with the Committed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetCommittedOk() (*time.Time, bool) {
if o == nil || o.Committed == nil {
return nil, false
}
return o.Committed, true
}
// HasCommitted returns a boolean if a field has been set.
func (o *SearchStats) HasCommitted() bool {
if o != nil && o.Committed != nil {
return true
}
return false
}
// SetCommitted gets a reference to the given time.Time and assigns it to the Committed field.
func (o *SearchStats) SetCommitted(v time.Time) {
o.Committed = &v
}
// GetDuration returns the Duration field value if set, zero value otherwise.
func (o *SearchStats) GetDuration() int64 {
if o == nil || o.Duration == nil {
var ret int64
return ret
}
return *o.Duration
}
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetDurationOk() (*int64, bool) {
if o == nil || o.Duration == nil {
return nil, false
}
return o.Duration, true
}
// HasDuration returns a boolean if a field has been set.
func (o *SearchStats) HasDuration() bool {
if o != nil && o.Duration != nil {
return true
}
return false
}
// SetDuration gets a reference to the given int64 and assigns it to the Duration field.
func (o *SearchStats) SetDuration(v int64) {
o.Duration = &v
}
// GetFromDate returns the FromDate field value if set, zero value otherwise.
func (o *SearchStats) GetFromDate() time.Time {
if o == nil || o.FromDate == nil {
var ret time.Time
return ret
}
return *o.FromDate
}
// GetFromDateOk returns a tuple with the FromDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetFromDateOk() (*time.Time, bool) {
if o == nil || o.FromDate == nil {
return nil, false
}
return o.FromDate, true
}
// HasFromDate returns a boolean if a field has been set.
func (o *SearchStats) HasFromDate() bool {
if o != nil && o.FromDate != nil {
return true
}
return false
}
// SetFromDate gets a reference to the given time.Time and assigns it to the FromDate field.
func (o *SearchStats) SetFromDate(v time.Time) {
o.FromDate = &v
}
// GetHighlight returns the Highlight field value if set, zero value otherwise.
func (o *SearchStats) GetHighlight() map[string][]string {
if o == nil || o.Highlight == nil {
var ret map[string][]string
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 *SearchStats) GetHighlightOk() (*map[string][]string, bool) {
if o == nil || o.Highlight == nil {
return nil, false
}
return o.Highlight, true
}
// HasHighlight returns a boolean if a field has been set.
func (o *SearchStats) HasHighlight() bool {
if o != nil && o.Highlight != nil {
return true
}
return false
}
// SetHighlight gets a reference to the given map[string][]string and assigns it to the Highlight field.
func (o *SearchStats) SetHighlight(v map[string][]string) {
o.Highlight = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SearchStats) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *SearchStats) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *SearchStats) SetId(v string) {
o.Id = &v
}
// GetModified returns the Modified field value if set, zero value otherwise.
func (o *SearchStats) GetModified() time.Time {
if o == nil || o.Modified == nil {
var ret time.Time
return ret
}
return *o.Modified
}
// GetModifiedOk returns a tuple with the Modified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetModifiedOk() (*time.Time, bool) {
if o == nil || o.Modified == nil {
return nil, false
}
return o.Modified, true
}
// HasModified returns a boolean if a field has been set.
func (o *SearchStats) HasModified() bool {
if o != nil && o.Modified != nil {
return true
}
return false
}
// SetModified gets a reference to the given time.Time and assigns it to the Modified field.
func (o *SearchStats) SetModified(v time.Time) {
o.Modified = &v
}
// GetNumericId returns the NumericId field value if set, zero value otherwise.
func (o *SearchStats) GetNumericId() int64 {
if o == nil || o.NumericId == nil {
var ret int64
return ret
}
return *o.NumericId
}
// GetNumericIdOk returns a tuple with the NumericId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetNumericIdOk() (*int64, bool) {
if o == nil || o.NumericId == nil {
return nil, false
}
return o.NumericId, true
}
// HasNumericId returns a boolean if a field has been set.
func (o *SearchStats) HasNumericId() bool {
if o != nil && o.NumericId != nil {
return true
}
return false
}
// SetNumericId gets a reference to the given int64 and assigns it to the NumericId field.
func (o *SearchStats) SetNumericId(v int64) {
o.NumericId = &v
}
// GetPrimaryTerm returns the PrimaryTerm field value if set, zero value otherwise.
func (o *SearchStats) GetPrimaryTerm() int64 {
if o == nil || o.PrimaryTerm == nil {
var ret int64
return ret
}
return *o.PrimaryTerm
}
// GetPrimaryTermOk returns a tuple with the PrimaryTerm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetPrimaryTermOk() (*int64, bool) {
if o == nil || o.PrimaryTerm == nil {
return nil, false
}
return o.PrimaryTerm, true
}
// HasPrimaryTerm returns a boolean if a field has been set.
func (o *SearchStats) HasPrimaryTerm() bool {
if o != nil && o.PrimaryTerm != nil {
return true
}
return false
}
// SetPrimaryTerm gets a reference to the given int64 and assigns it to the PrimaryTerm field.
func (o *SearchStats) SetPrimaryTerm(v int64) {
o.PrimaryTerm = &v
}
// GetQuery returns the Query field value if set, zero value otherwise.
func (o *SearchStats) GetQuery() string {
if o == nil || o.Query == nil {
var ret string
return ret
}
return *o.Query
}
// GetQueryOk returns a tuple with the Query field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetQueryOk() (*string, bool) {
if o == nil || o.Query == nil {
return nil, false
}
return o.Query, true
}
// HasQuery returns a boolean if a field has been set.
func (o *SearchStats) HasQuery() bool {
if o != nil && o.Query != nil {
return true
}
return false
}
// SetQuery gets a reference to the given string and assigns it to the Query field.
func (o *SearchStats) SetQuery(v string) {
o.Query = &v
}
// GetSearchSource returns the SearchSource field value if set, zero value otherwise.
func (o *SearchStats) GetSearchSource() string {
if o == nil || o.SearchSource == nil {
var ret string
return ret
}
return *o.SearchSource
}
// GetSearchSourceOk returns a tuple with the SearchSource field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetSearchSourceOk() (*string, bool) {
if o == nil || o.SearchSource == nil {
return nil, false
}
return o.SearchSource, true
}
// HasSearchSource returns a boolean if a field has been set.
func (o *SearchStats) HasSearchSource() bool {
if o != nil && o.SearchSource != nil {
return true
}
return false
}
// SetSearchSource gets a reference to the given string and assigns it to the SearchSource field.
func (o *SearchStats) SetSearchSource(v string) {
o.SearchSource = &v
}
// GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise.
func (o *SearchStats) GetSequenceNumber() int64 {
if o == nil || o.SequenceNumber == nil {
var ret int64
return ret
}
return *o.SequenceNumber
}
// GetSequenceNumberOk returns a tuple with the SequenceNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetSequenceNumberOk() (*int64, bool) {
if o == nil || o.SequenceNumber == nil {
return nil, false
}
return o.SequenceNumber, true
}
// HasSequenceNumber returns a boolean if a field has been set.
func (o *SearchStats) HasSequenceNumber() bool {
if o != nil && o.SequenceNumber != nil {
return true
}
return false
}
// SetSequenceNumber gets a reference to the given int64 and assigns it to the SequenceNumber field.
func (o *SearchStats) SetSequenceNumber(v int64) {
o.SequenceNumber = &v
}
// GetSortValues returns the SortValues field value if set, zero value otherwise.
func (o *SearchStats) GetSortValues() []string {
if o == nil || o.SortValues == nil {
var ret []string
return ret
}
return *o.SortValues
}
// GetSortValuesOk returns a tuple with the SortValues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetSortValuesOk() (*[]string, bool) {
if o == nil || o.SortValues == nil {
return nil, false
}
return o.SortValues, true
}
// HasSortValues returns a boolean if a field has been set.
func (o *SearchStats) HasSortValues() bool {
if o != nil && o.SortValues != nil {
return true
}
return false
}
// SetSortValues gets a reference to the given []string and assigns it to the SortValues field.
func (o *SearchStats) SetSortValues(v []string) {
o.SortValues = &v
}
// GetToDate returns the ToDate field value if set, zero value otherwise.
func (o *SearchStats) GetToDate() time.Time {
if o == nil || o.ToDate == nil {
var ret time.Time
return ret
}
return *o.ToDate
}
// GetToDateOk returns a tuple with the ToDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetToDateOk() (*time.Time, bool) {
if o == nil || o.ToDate == nil {
return nil, false
}
return o.ToDate, true
}
// HasToDate returns a boolean if a field has been set.
func (o *SearchStats) HasToDate() bool {
if o != nil && o.ToDate != nil {
return true
}
return false
}
// SetToDate gets a reference to the given time.Time and assigns it to the ToDate field.
func (o *SearchStats) SetToDate(v time.Time) {
o.ToDate = &v
}
// GetUsername returns the Username field value if set, zero value otherwise.
func (o *SearchStats) GetUsername() string {
if o == nil || o.Username == nil {
var ret string
return ret
}
return *o.Username
}
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetUsernameOk() (*string, bool) {
if o == nil || o.Username == nil {
return nil, false
}
return o.Username, true
}
// HasUsername returns a boolean if a field has been set.
func (o *SearchStats) HasUsername() bool {
if o != nil && o.Username != nil {
return true
}
return false
}
// SetUsername gets a reference to the given string and assigns it to the Username field.
func (o *SearchStats) SetUsername(v string) {
o.Username = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *SearchStats) GetVersion() int64 {
if o == nil || o.Version == nil {
var ret int64
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchStats) GetVersionOk() (*int64, bool) {
if o == nil || o.Version == nil {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *SearchStats) HasVersion() bool {
if o != nil && o.Version != nil {
return true
}
return false
}
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
func (o *SearchStats) SetVersion(v int64) {
o.Version = &v
}
func (o SearchStats) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Committed != nil {
toSerialize["committed"] = o.Committed
}
if o.Duration != nil {
toSerialize["duration"] = o.Duration
}
if o.FromDate != nil {
toSerialize["fromDate"] = o.FromDate
}
if o.Highlight != nil {
toSerialize["highlight"] = o.Highlight
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Modified != nil {
toSerialize["modified"] = o.Modified
}
if o.NumericId != nil {
toSerialize["numericId"] = o.NumericId
}
if o.PrimaryTerm != nil {
toSerialize["primaryTerm"] = o.PrimaryTerm
}
if o.Query != nil {
toSerialize["query"] = o.Query
}
if o.SearchSource != nil {
toSerialize["searchSource"] = o.SearchSource
}
if o.SequenceNumber != nil {
toSerialize["sequenceNumber"] = o.SequenceNumber
}
if o.SortValues != nil {
toSerialize["sortValues"] = o.SortValues
}
if o.ToDate != nil {
toSerialize["toDate"] = o.ToDate
}
if o.Username != nil {
toSerialize["username"] = o.Username
}
if o.Version != nil {
toSerialize["version"] = o.Version
}
return json.Marshal(toSerialize)
}
type NullableSearchStats struct {
value *SearchStats
isSet bool
}
func (v NullableSearchStats) Get() *SearchStats {
return v.value
}
func (v *NullableSearchStats) Set(val *SearchStats) {
v.value = val
v.isSet = true
}
func (v NullableSearchStats) IsSet() bool {
return v.isSet
}
func (v *NullableSearchStats) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSearchStats(val *SearchStats) *NullableSearchStats {
return &NullableSearchStats{value: val, isSet: true}
}
func (v NullableSearchStats) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSearchStats) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}