-
Notifications
You must be signed in to change notification settings - Fork 1
/
organization.pb.query.go
301 lines (243 loc) · 6.48 KB
/
organization.pb.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
// Code generated by protoc-gen-goten-resource
// Resource: Organization
// DO NOT EDIT!!!
package organization
import (
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/cloudwan/goten-sdk/runtime/goten"
gotenobject "github.com/cloudwan/goten-sdk/runtime/object"
gotenresource "github.com/cloudwan/goten-sdk/runtime/resource"
"github.com/cloudwan/goten-sdk/types/watch_type"
)
// ensure the imports are used
var (
_ = ×tamppb.Timestamp{}
_ = watch_type.WatchType_STATELESS
_ = new(goten.GotenMessage)
_ = new(gotenobject.FieldMask)
_ = new(gotenresource.ListQuery)
)
type GetQuery struct {
Reference *Reference
Mask *Organization_FieldMask
}
func (q *GetQuery) GotenQuery() {}
func (q *GetQuery) String() string {
return gotenresource.MakeSQLGetString(q)
}
func (q *GetQuery) GetResourceDescriptor() gotenresource.Descriptor {
return descriptor
}
func (q *GetQuery) GetReference() gotenresource.Reference {
return q.Reference
}
func (q *GetQuery) GetFieldMask() gotenobject.FieldMask {
return q.Mask
}
func (q *GetQuery) SetReference(ref gotenresource.Reference) {
if ref != nil {
q.Reference = ref.(*Reference)
} else {
q.Reference = nil
}
}
func (q *GetQuery) SetFieldMask(mask gotenobject.FieldMask) {
if mask != nil {
q.Mask = mask.(*Organization_FieldMask)
} else {
q.Mask = nil
}
}
type ListQuery struct {
Filter *Filter
Pager *PagerQuery
Mask *Organization_FieldMask
WithPagingInfo bool
}
func (q *ListQuery) GotenQuery() {}
func (q *ListQuery) String() string {
return gotenresource.MakeSQLListString(q)
}
func (q *ListQuery) GetResourceDescriptor() gotenresource.Descriptor {
return descriptor
}
func (q *ListQuery) GetFilter() gotenresource.Filter {
return q.Filter
}
func (q *ListQuery) GetPager() gotenresource.PagerQuery {
return q.Pager
}
func (q *ListQuery) GetFieldMask() gotenobject.FieldMask {
return q.Mask
}
func (q *ListQuery) GetWithPagingInfo() bool {
return q.WithPagingInfo
}
func (q *ListQuery) SetFilter(filter gotenresource.Filter) {
if filter != nil {
q.Filter = filter.(*Filter)
} else {
q.Filter = nil
}
}
func (q *ListQuery) SetPager(pager gotenresource.PagerQuery) {
if pager != nil {
q.Pager = pager.(*PagerQuery)
} else {
q.Pager = nil
}
}
func (q *ListQuery) SetFieldMask(mask gotenobject.FieldMask) {
if mask != nil {
q.Mask = mask.(*Organization_FieldMask)
} else {
q.Mask = nil
}
}
func (q *ListQuery) SetWithPagingInfo(with bool) {
q.WithPagingInfo = with
}
type WatchQuery struct {
ListQuery
WatchType watch_type.WatchType
ChunkSize int
ResumeToken string
StartingTime *timestamppb.Timestamp
}
func (q *WatchQuery) String() string {
return gotenresource.MakeSQLWatchString(q)
}
func (q *WatchQuery) GetWatchType() watch_type.WatchType {
return q.WatchType
}
func (q *WatchQuery) GetMaximumChunkSize() int {
return q.ChunkSize
}
func (q *WatchQuery) GetResumeToken() string {
return q.ResumeToken
}
func (q *WatchQuery) GetStartingTime() *timestamppb.Timestamp {
return q.StartingTime
}
func (q *WatchQuery) SetWatchType(watchType watch_type.WatchType) {
q.WatchType = watchType
}
func (q *WatchQuery) SetMaximumChunkSize(chunkSize int) {
q.ChunkSize = chunkSize
}
func (q *WatchQuery) SetResumeToken(token string) {
q.ResumeToken = token
}
func (q *WatchQuery) SetStartingTime(startingTime *timestamppb.Timestamp) {
q.StartingTime = startingTime
}
type QueryResultSnapshot struct {
Organizations []*Organization
PrevPageCursor *PagerCursor
NextPageCursor *PagerCursor
TotalResultsCount int32
CurrentOffset int32
}
func (qr *QueryResultSnapshot) GetResults() gotenresource.ResourceList {
return OrganizationList(qr.Organizations)
}
func (qr *QueryResultSnapshot) GetNextPageCursor() gotenresource.Cursor {
return qr.NextPageCursor
}
func (qr *QueryResultSnapshot) GetPrevPageCursor() gotenresource.Cursor {
return qr.PrevPageCursor
}
func (qr *QueryResultSnapshot) GetPagingInfo() (totalCount, offset int32) {
return qr.TotalResultsCount, qr.CurrentOffset
}
func (qr *QueryResultSnapshot) SetResults(results gotenresource.ResourceList) {
if results != nil {
qr.Organizations = results.(OrganizationList)
} else {
qr.Organizations = nil
}
}
func (qr *QueryResultSnapshot) SetCursors(nextPageCursor, prevPageCursor gotenresource.Cursor) {
if nextPageCursor != nil {
qr.NextPageCursor = nextPageCursor.(*PagerCursor)
} else {
qr.NextPageCursor = nil
}
if prevPageCursor != nil {
qr.PrevPageCursor = prevPageCursor.(*PagerCursor)
} else {
qr.PrevPageCursor = nil
}
}
func (qr *QueryResultSnapshot) SetPagingInfo(totalCount, offset int32) {
qr.TotalResultsCount = totalCount
qr.CurrentOffset = offset
}
type QueryResultChange struct {
Changes []*OrganizationChange
PrevPageCursor *PagerCursor
NextPageCursor *PagerCursor
ResumeToken string
IsCurrent bool
IsHardReset bool
IsSoftReset bool
SnapshotSize int64
}
func (qr *QueryResultChange) GetResults() gotenresource.ResourceChangeList {
return OrganizationChangeList(qr.Changes)
}
func (qr *QueryResultChange) GetNextPageCursor() gotenresource.Cursor {
return qr.NextPageCursor
}
func (qr *QueryResultChange) GetPrevPageCursor() gotenresource.Cursor {
return qr.PrevPageCursor
}
func (qr *QueryResultChange) GetIsCurrent() bool {
return qr.IsCurrent
}
func (qr *QueryResultChange) GetIsHardReset() bool {
return qr.IsHardReset
}
func (qr *QueryResultChange) GetIsSoftReset() bool {
return qr.IsSoftReset
}
func (qr *QueryResultChange) GetSnapshotSize() int64 {
return qr.SnapshotSize
}
func (qr *QueryResultChange) GetResumeToken() string {
return qr.ResumeToken
}
func (qr *QueryResultChange) SetResults(results gotenresource.ResourceChangeList) {
if results != nil {
qr.Changes = results.(OrganizationChangeList)
} else {
qr.Changes = nil
}
}
func (qr *QueryResultChange) SetCursors(nextPageCursor, prevPageCursor gotenresource.Cursor) {
if nextPageCursor != nil {
qr.NextPageCursor = nextPageCursor.(*PagerCursor)
} else {
qr.NextPageCursor = nil
}
if prevPageCursor != nil {
qr.PrevPageCursor = prevPageCursor.(*PagerCursor)
} else {
qr.PrevPageCursor = nil
}
}
func (qr *QueryResultChange) SetIsCurrent() {
qr.IsCurrent = true
}
func (qr *QueryResultChange) SetIsSoftReset() {
qr.IsSoftReset = true
}
func (qr *QueryResultChange) SetIsHardReset() {
qr.IsHardReset = true
}
func (qr *QueryResultChange) SetSnapshotSize(size int64) {
qr.SnapshotSize = size
}
func (qr *QueryResultChange) SetResumeToken(token string) {
qr.ResumeToken = token
}