/
model_query_response.go
531 lines (450 loc) · 15.1 KB
/
model_query_response.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
/*
REST API
Rockset's REST API allows for creating and managing all resources in Rockset. Each supported endpoint is documented below. All requests must be authorized with a Rockset API key, which can be created in the [Rockset console](https://console.rockset.com). The API key must be provided as `ApiKey <api_key>` in the `Authorization` request header. For example: ``` Authorization: ApiKey aB35kDjg93J5nsf4GjwMeErAVd832F7ad4vhsW1S02kfZiab42sTsfW5Sxt25asT ``` All endpoints are only accessible via https. Build something awesome!
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the QueryResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &QueryResponse{}
// QueryResponse struct for QueryResponse
type QueryResponse struct {
// List of collections referenced in the query.
Collections []string `json:"collections,omitempty"`
// Meta information about each column in the result set. Not populated in `SELECT *` queries.
ColumnFields []QueryFieldType `json:"column_fields,omitempty"`
// If this was a write query, this is the log offset the query was written to.
LastOffset *string `json:"last_offset,omitempty"`
Pagination *PaginationInfo `json:"pagination,omitempty"`
// Errors encountered while executing the query.
QueryErrors []QueryError `json:"query_errors,omitempty"`
// Unique ID for this query.
QueryId *string `json:"query_id,omitempty"`
// The full path of the executed query lambda. Includes version information.
QueryLambdaPath *string `json:"query_lambda_path,omitempty"`
// Results from the query.
Results []map[string]interface{} `json:"results,omitempty"`
// Number of results generated by the query.
ResultsTotalDocCount *int64 `json:"results_total_doc_count,omitempty"`
Stats *QueryResponseStats `json:"stats,omitempty"`
// Status of query execution. Possible values: `QUEUED`, `RUNNING`, `COMPLETED`, `ERROR`.
Status *string `json:"status,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
// NewQueryResponse instantiates a new QueryResponse 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 NewQueryResponse() *QueryResponse {
this := QueryResponse{}
return &this
}
// NewQueryResponseWithDefaults instantiates a new QueryResponse 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 NewQueryResponseWithDefaults() *QueryResponse {
this := QueryResponse{}
return &this
}
// GetCollections returns the Collections field value if set, zero value otherwise.
func (o *QueryResponse) GetCollections() []string {
if o == nil || IsNil(o.Collections) {
var ret []string
return ret
}
return o.Collections
}
// GetCollectionsOk returns a tuple with the Collections field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetCollectionsOk() ([]string, bool) {
if o == nil || IsNil(o.Collections) {
return nil, false
}
return o.Collections, true
}
// HasCollections returns a boolean if a field has been set.
func (o *QueryResponse) HasCollections() bool {
if o != nil && !IsNil(o.Collections) {
return true
}
return false
}
// SetCollections gets a reference to the given []string and assigns it to the Collections field.
func (o *QueryResponse) SetCollections(v []string) {
o.Collections = v
}
// GetColumnFields returns the ColumnFields field value if set, zero value otherwise.
func (o *QueryResponse) GetColumnFields() []QueryFieldType {
if o == nil || IsNil(o.ColumnFields) {
var ret []QueryFieldType
return ret
}
return o.ColumnFields
}
// GetColumnFieldsOk returns a tuple with the ColumnFields field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetColumnFieldsOk() ([]QueryFieldType, bool) {
if o == nil || IsNil(o.ColumnFields) {
return nil, false
}
return o.ColumnFields, true
}
// HasColumnFields returns a boolean if a field has been set.
func (o *QueryResponse) HasColumnFields() bool {
if o != nil && !IsNil(o.ColumnFields) {
return true
}
return false
}
// SetColumnFields gets a reference to the given []QueryFieldType and assigns it to the ColumnFields field.
func (o *QueryResponse) SetColumnFields(v []QueryFieldType) {
o.ColumnFields = v
}
// GetLastOffset returns the LastOffset field value if set, zero value otherwise.
func (o *QueryResponse) GetLastOffset() string {
if o == nil || IsNil(o.LastOffset) {
var ret string
return ret
}
return *o.LastOffset
}
// GetLastOffsetOk returns a tuple with the LastOffset field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetLastOffsetOk() (*string, bool) {
if o == nil || IsNil(o.LastOffset) {
return nil, false
}
return o.LastOffset, true
}
// HasLastOffset returns a boolean if a field has been set.
func (o *QueryResponse) HasLastOffset() bool {
if o != nil && !IsNil(o.LastOffset) {
return true
}
return false
}
// SetLastOffset gets a reference to the given string and assigns it to the LastOffset field.
func (o *QueryResponse) SetLastOffset(v string) {
o.LastOffset = &v
}
// GetPagination returns the Pagination field value if set, zero value otherwise.
func (o *QueryResponse) GetPagination() PaginationInfo {
if o == nil || IsNil(o.Pagination) {
var ret PaginationInfo
return ret
}
return *o.Pagination
}
// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetPaginationOk() (*PaginationInfo, bool) {
if o == nil || IsNil(o.Pagination) {
return nil, false
}
return o.Pagination, true
}
// HasPagination returns a boolean if a field has been set.
func (o *QueryResponse) HasPagination() bool {
if o != nil && !IsNil(o.Pagination) {
return true
}
return false
}
// SetPagination gets a reference to the given PaginationInfo and assigns it to the Pagination field.
func (o *QueryResponse) SetPagination(v PaginationInfo) {
o.Pagination = &v
}
// GetQueryErrors returns the QueryErrors field value if set, zero value otherwise.
func (o *QueryResponse) GetQueryErrors() []QueryError {
if o == nil || IsNil(o.QueryErrors) {
var ret []QueryError
return ret
}
return o.QueryErrors
}
// GetQueryErrorsOk returns a tuple with the QueryErrors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetQueryErrorsOk() ([]QueryError, bool) {
if o == nil || IsNil(o.QueryErrors) {
return nil, false
}
return o.QueryErrors, true
}
// HasQueryErrors returns a boolean if a field has been set.
func (o *QueryResponse) HasQueryErrors() bool {
if o != nil && !IsNil(o.QueryErrors) {
return true
}
return false
}
// SetQueryErrors gets a reference to the given []QueryError and assigns it to the QueryErrors field.
func (o *QueryResponse) SetQueryErrors(v []QueryError) {
o.QueryErrors = v
}
// GetQueryId returns the QueryId field value if set, zero value otherwise.
func (o *QueryResponse) GetQueryId() string {
if o == nil || IsNil(o.QueryId) {
var ret string
return ret
}
return *o.QueryId
}
// GetQueryIdOk returns a tuple with the QueryId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetQueryIdOk() (*string, bool) {
if o == nil || IsNil(o.QueryId) {
return nil, false
}
return o.QueryId, true
}
// HasQueryId returns a boolean if a field has been set.
func (o *QueryResponse) HasQueryId() bool {
if o != nil && !IsNil(o.QueryId) {
return true
}
return false
}
// SetQueryId gets a reference to the given string and assigns it to the QueryId field.
func (o *QueryResponse) SetQueryId(v string) {
o.QueryId = &v
}
// GetQueryLambdaPath returns the QueryLambdaPath field value if set, zero value otherwise.
func (o *QueryResponse) GetQueryLambdaPath() string {
if o == nil || IsNil(o.QueryLambdaPath) {
var ret string
return ret
}
return *o.QueryLambdaPath
}
// GetQueryLambdaPathOk returns a tuple with the QueryLambdaPath field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetQueryLambdaPathOk() (*string, bool) {
if o == nil || IsNil(o.QueryLambdaPath) {
return nil, false
}
return o.QueryLambdaPath, true
}
// HasQueryLambdaPath returns a boolean if a field has been set.
func (o *QueryResponse) HasQueryLambdaPath() bool {
if o != nil && !IsNil(o.QueryLambdaPath) {
return true
}
return false
}
// SetQueryLambdaPath gets a reference to the given string and assigns it to the QueryLambdaPath field.
func (o *QueryResponse) SetQueryLambdaPath(v string) {
o.QueryLambdaPath = &v
}
// GetResults returns the Results field value if set, zero value otherwise.
func (o *QueryResponse) GetResults() []map[string]interface{} {
if o == nil || IsNil(o.Results) {
var ret []map[string]interface{}
return ret
}
return o.Results
}
// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetResultsOk() ([]map[string]interface{}, bool) {
if o == nil || IsNil(o.Results) {
return nil, false
}
return o.Results, true
}
// HasResults returns a boolean if a field has been set.
func (o *QueryResponse) HasResults() bool {
if o != nil && !IsNil(o.Results) {
return true
}
return false
}
// SetResults gets a reference to the given []map[string]interface{} and assigns it to the Results field.
func (o *QueryResponse) SetResults(v []map[string]interface{}) {
o.Results = v
}
// GetResultsTotalDocCount returns the ResultsTotalDocCount field value if set, zero value otherwise.
func (o *QueryResponse) GetResultsTotalDocCount() int64 {
if o == nil || IsNil(o.ResultsTotalDocCount) {
var ret int64
return ret
}
return *o.ResultsTotalDocCount
}
// GetResultsTotalDocCountOk returns a tuple with the ResultsTotalDocCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetResultsTotalDocCountOk() (*int64, bool) {
if o == nil || IsNil(o.ResultsTotalDocCount) {
return nil, false
}
return o.ResultsTotalDocCount, true
}
// HasResultsTotalDocCount returns a boolean if a field has been set.
func (o *QueryResponse) HasResultsTotalDocCount() bool {
if o != nil && !IsNil(o.ResultsTotalDocCount) {
return true
}
return false
}
// SetResultsTotalDocCount gets a reference to the given int64 and assigns it to the ResultsTotalDocCount field.
func (o *QueryResponse) SetResultsTotalDocCount(v int64) {
o.ResultsTotalDocCount = &v
}
// GetStats returns the Stats field value if set, zero value otherwise.
func (o *QueryResponse) GetStats() QueryResponseStats {
if o == nil || IsNil(o.Stats) {
var ret QueryResponseStats
return ret
}
return *o.Stats
}
// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetStatsOk() (*QueryResponseStats, bool) {
if o == nil || IsNil(o.Stats) {
return nil, false
}
return o.Stats, true
}
// HasStats returns a boolean if a field has been set.
func (o *QueryResponse) HasStats() bool {
if o != nil && !IsNil(o.Stats) {
return true
}
return false
}
// SetStats gets a reference to the given QueryResponseStats and assigns it to the Stats field.
func (o *QueryResponse) SetStats(v QueryResponseStats) {
o.Stats = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *QueryResponse) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *QueryResponse) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *QueryResponse) SetStatus(v string) {
o.Status = &v
}
// GetWarnings returns the Warnings field value if set, zero value otherwise.
func (o *QueryResponse) GetWarnings() []string {
if o == nil || IsNil(o.Warnings) {
var ret []string
return ret
}
return o.Warnings
}
// GetWarningsOk returns a tuple with the Warnings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *QueryResponse) GetWarningsOk() ([]string, bool) {
if o == nil || IsNil(o.Warnings) {
return nil, false
}
return o.Warnings, true
}
// HasWarnings returns a boolean if a field has been set.
func (o *QueryResponse) HasWarnings() bool {
if o != nil && !IsNil(o.Warnings) {
return true
}
return false
}
// SetWarnings gets a reference to the given []string and assigns it to the Warnings field.
func (o *QueryResponse) SetWarnings(v []string) {
o.Warnings = v
}
func (o QueryResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o QueryResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Collections) {
toSerialize["collections"] = o.Collections
}
if !IsNil(o.ColumnFields) {
toSerialize["column_fields"] = o.ColumnFields
}
if !IsNil(o.LastOffset) {
toSerialize["last_offset"] = o.LastOffset
}
if !IsNil(o.Pagination) {
toSerialize["pagination"] = o.Pagination
}
if !IsNil(o.QueryErrors) {
toSerialize["query_errors"] = o.QueryErrors
}
if !IsNil(o.QueryId) {
toSerialize["query_id"] = o.QueryId
}
if !IsNil(o.QueryLambdaPath) {
toSerialize["query_lambda_path"] = o.QueryLambdaPath
}
if !IsNil(o.Results) {
toSerialize["results"] = o.Results
}
if !IsNil(o.ResultsTotalDocCount) {
toSerialize["results_total_doc_count"] = o.ResultsTotalDocCount
}
if !IsNil(o.Stats) {
toSerialize["stats"] = o.Stats
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Warnings) {
toSerialize["warnings"] = o.Warnings
}
return toSerialize, nil
}
type NullableQueryResponse struct {
value *QueryResponse
isSet bool
}
func (v NullableQueryResponse) Get() *QueryResponse {
return v.value
}
func (v *NullableQueryResponse) Set(val *QueryResponse) {
v.value = val
v.isSet = true
}
func (v NullableQueryResponse) IsSet() bool {
return v.isSet
}
func (v *NullableQueryResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQueryResponse(val *QueryResponse) *NullableQueryResponse {
return &NullableQueryResponse{value: val, isSet: true}
}
func (v NullableQueryResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQueryResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}