-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquery_runner.go
149 lines (129 loc) · 4.11 KB
/
query_runner.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
// This file was auto-generated by Fern from our API Definition.
package polytomic
import (
json "encoding/json"
fmt "fmt"
core "github.com/polytomic/polytomic-go/core"
)
type QueryRunnerGetQueryRequest struct {
Page *string `json:"-" url:"page,omitempty"`
}
type V4RunQueryRequest struct {
// The query to execute against the connection.
Query *string `json:"-" url:"query,omitempty"`
}
type Pagination struct {
// URL to the next page of results, if available. This may be returned as a host relative path.
Next *string `json:"next,omitempty" url:"next,omitempty"`
// URL to the previous page of results, if available. This may be returned as a host relative path.
Previous *string `json:"previous,omitempty" url:"previous,omitempty"`
_rawJSON json.RawMessage
}
func (p *Pagination) UnmarshalJSON(data []byte) error {
type unmarshaler Pagination
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = Pagination(value)
p._rawJSON = json.RawMessage(data)
return nil
}
func (p *Pagination) String() string {
if len(p._rawJSON) > 0 {
if value, err := core.StringifyJSON(p._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type V4QueryResultsEnvelope struct {
Data *V4RunQueryResult `json:"data,omitempty" url:"data,omitempty"`
Links *Pagination `json:"links,omitempty" url:"links,omitempty"`
_rawJSON json.RawMessage
}
func (v *V4QueryResultsEnvelope) UnmarshalJSON(data []byte) error {
type unmarshaler V4QueryResultsEnvelope
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*v = V4QueryResultsEnvelope(value)
v._rawJSON = json.RawMessage(data)
return nil
}
func (v *V4QueryResultsEnvelope) String() string {
if len(v._rawJSON) > 0 {
if value, err := core.StringifyJSON(v._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(v); err == nil {
return value
}
return fmt.Sprintf("%#v", v)
}
type V4RunQueryEnvelope struct {
Data *V4RunQueryResult `json:"data,omitempty" url:"data,omitempty"`
_rawJSON json.RawMessage
}
func (v *V4RunQueryEnvelope) UnmarshalJSON(data []byte) error {
type unmarshaler V4RunQueryEnvelope
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*v = V4RunQueryEnvelope(value)
v._rawJSON = json.RawMessage(data)
return nil
}
func (v *V4RunQueryEnvelope) String() string {
if len(v._rawJSON) > 0 {
if value, err := core.StringifyJSON(v._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(v); err == nil {
return value
}
return fmt.Sprintf("%#v", v)
}
type V4RunQueryResult struct {
// The number of rows returned by the query. This will not be returned until the query completes.
Count *int `json:"count,omitempty" url:"count,omitempty"`
Error *string `json:"error,omitempty" url:"error,omitempty"`
// The time at which the query will expire and be deleted. This will not be returned until the query completes.
Expires *string `json:"expires,omitempty" url:"expires,omitempty"`
// The names of the fields returned by the query. This will not be returned until the query completes.
Fields []string `json:"fields,omitempty" url:"fields,omitempty"`
// The ID of the query task.
Id *string `json:"id,omitempty" url:"id,omitempty"`
// The query results, returned as an array of objects.
Results []map[string]interface{} `json:"results,omitempty" url:"results,omitempty"`
Status *WorkTaskStatus `json:"status,omitempty" url:"status,omitempty"`
_rawJSON json.RawMessage
}
func (v *V4RunQueryResult) UnmarshalJSON(data []byte) error {
type unmarshaler V4RunQueryResult
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*v = V4RunQueryResult(value)
v._rawJSON = json.RawMessage(data)
return nil
}
func (v *V4RunQueryResult) String() string {
if len(v._rawJSON) > 0 {
if value, err := core.StringifyJSON(v._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(v); err == nil {
return value
}
return fmt.Sprintf("%#v", v)
}