-
Notifications
You must be signed in to change notification settings - Fork 2
/
models.go
455 lines (408 loc) · 10.4 KB
/
models.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
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
package gensql
import (
"database/sql"
"database/sql/driver"
"fmt"
"time"
"github.com/google/uuid"
"github.com/sqlc-dev/pqtype"
)
type AccessRequestStatusType string
const (
AccessRequestStatusTypePending AccessRequestStatusType = "pending"
AccessRequestStatusTypeApproved AccessRequestStatusType = "approved"
AccessRequestStatusTypeDenied AccessRequestStatusType = "denied"
)
func (e *AccessRequestStatusType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = AccessRequestStatusType(s)
case string:
*e = AccessRequestStatusType(s)
default:
return fmt.Errorf("unsupported scan type for AccessRequestStatusType: %T", src)
}
return nil
}
type NullAccessRequestStatusType struct {
AccessRequestStatusType AccessRequestStatusType
Valid bool // Valid is true if AccessRequestStatusType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullAccessRequestStatusType) Scan(value interface{}) error {
if value == nil {
ns.AccessRequestStatusType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.AccessRequestStatusType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullAccessRequestStatusType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.AccessRequestStatusType), nil
}
type DatasourceType string
const (
DatasourceTypeBigquery DatasourceType = "bigquery"
)
func (e *DatasourceType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = DatasourceType(s)
case string:
*e = DatasourceType(s)
default:
return fmt.Errorf("unsupported scan type for DatasourceType: %T", src)
}
return nil
}
type NullDatasourceType struct {
DatasourceType DatasourceType
Valid bool // Valid is true if DatasourceType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullDatasourceType) Scan(value interface{}) error {
if value == nil {
ns.DatasourceType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.DatasourceType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullDatasourceType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.DatasourceType), nil
}
type PiiLevel string
const (
PiiLevelSensitive PiiLevel = "sensitive"
PiiLevelAnonymised PiiLevel = "anonymised"
PiiLevelNone PiiLevel = "none"
)
func (e *PiiLevel) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PiiLevel(s)
case string:
*e = PiiLevel(s)
default:
return fmt.Errorf("unsupported scan type for PiiLevel: %T", src)
}
return nil
}
type NullPiiLevel struct {
PiiLevel PiiLevel
Valid bool // Valid is true if PiiLevel is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPiiLevel) Scan(value interface{}) error {
if value == nil {
ns.PiiLevel, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PiiLevel.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPiiLevel) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PiiLevel), nil
}
type Dashboard struct {
ID string
Url string
}
type Dataproduct struct {
ID uuid.UUID
Name string
Description sql.NullString
Group string
Created time.Time
LastModified time.Time
TsvDocument interface{}
Slug string
TeamkatalogenUrl sql.NullString
TeamContact sql.NullString
TeamID sql.NullString
}
type DataproductView struct {
DpID uuid.UUID
DpName string
DpDescription sql.NullString
DpGroup string
DpCreated time.Time
DpLastModified time.Time
DpSlug string
TeamkatalogenUrl sql.NullString
TeamContact sql.NullString
TeamID sql.NullString
TeamName sql.NullString
PaName sql.NullString
PaID uuid.NullUUID
DsDpID uuid.NullUUID
DsID uuid.NullUUID
DsName sql.NullString
DsDescription sql.NullString
DsCreated sql.NullTime
DsLastModified sql.NullTime
DsSlug sql.NullString
DsKeywords []string
}
type DataproductWithTeamkatalogenView struct {
ID uuid.UUID
Name string
Description sql.NullString
Group string
Created time.Time
LastModified time.Time
TsvDocument interface{}
Slug string
TeamkatalogenUrl sql.NullString
TeamContact sql.NullString
TeamID sql.NullString
TeamName sql.NullString
PaName sql.NullString
PaID uuid.NullUUID
}
type Dataset struct {
ID uuid.UUID
Name string
Description sql.NullString
Pii PiiLevel
Created time.Time
LastModified time.Time
Type DatasourceType
TsvDocument interface{}
Slug string
Repo sql.NullString
Keywords []string
DataproductID uuid.UUID
AnonymisationDescription sql.NullString
TargetUser sql.NullString
}
type DatasetAccess struct {
ID uuid.UUID
DatasetID uuid.UUID
Subject string
Granter string
Expires sql.NullTime
Created time.Time
Revoked sql.NullTime
AccessRequestID uuid.NullUUID
}
type DatasetAccessRequest struct {
ID uuid.UUID
DatasetID uuid.UUID
Subject string
Owner string
PollyDocumentationID uuid.NullUUID
LastModified time.Time
Created time.Time
Expires sql.NullTime
Status AccessRequestStatusType
Closed sql.NullTime
Granter sql.NullString
Reason sql.NullString
}
type DatasetView struct {
DsID uuid.UUID
DsName string
DsDescription sql.NullString
DsCreated time.Time
DsLastModified time.Time
DsSlug string
Pii PiiLevel
DsKeywords []string
BqID uuid.UUID
BqCreated time.Time
BqLastModified time.Time
BqExpires sql.NullTime
BqDescription sql.NullString
BqMissingSince sql.NullTime
PiiTags pqtype.NullRawMessage
BqProject string
BqDataset string
BqTableName string
BqTableType string
PseudoColumns []string
BqSchema pqtype.NullRawMessage
DsDpID uuid.UUID
MappingServices []string
AccessID uuid.NullUUID
AccessSubject sql.NullString
AccessGranter sql.NullString
AccessExpires sql.NullTime
AccessCreated sql.NullTime
AccessRevoked sql.NullTime
AccessRequestID uuid.NullUUID
MbDatabaseID sql.NullInt32
MbDeletedAt sql.NullTime
}
type DatasourceBigquery struct {
DatasetID uuid.UUID
ProjectID string
Dataset string
TableName string
Schema pqtype.NullRawMessage
LastModified time.Time
Created time.Time
Expires sql.NullTime
TableType string
Description sql.NullString
PiiTags pqtype.NullRawMessage
MissingSince sql.NullTime
ID uuid.UUID
IsReference bool
PseudoColumns []string
Deleted sql.NullTime
}
type HttpCache struct {
ID int32
Endpoint string
ResponseBody []byte
CreatedAt time.Time
LastTriedUpdateAt time.Time
}
type InsightProduct struct {
ID uuid.UUID
Name string
Description sql.NullString
Creator string
Created time.Time
LastModified time.Time
Type string
TsvDocument interface{}
Link string
Keywords []string
Group string
TeamkatalogenUrl sql.NullString
TeamID sql.NullString
}
type InsightProductWithTeamkatalogenView struct {
ID uuid.UUID
Name string
Description sql.NullString
Creator string
Created time.Time
LastModified time.Time
Type string
TsvDocument interface{}
Link string
Keywords []string
Group string
TeamkatalogenUrl sql.NullString
TeamID sql.NullString
TeamName sql.NullString
PaName sql.NullString
}
type JoinableView struct {
ID uuid.UUID
Owner string
Name string
Created time.Time
Expires sql.NullTime
Deleted sql.NullTime
}
type JoinableViewsDatasource struct {
ID uuid.UUID
JoinableViewID uuid.UUID
DatasourceID uuid.UUID
Deleted sql.NullTime
}
type MetabaseMetadatum struct {
DatabaseID int32
PermissionGroupID sql.NullInt32
SaEmail string
CollectionID sql.NullInt32
DeletedAt sql.NullTime
DatasetID uuid.UUID
}
type NadaToken struct {
Team string
Token uuid.UUID
}
type PollyDocumentation struct {
ID uuid.UUID
ExternalID string
Name string
Url string
}
type Search struct {
ElementID uuid.UUID
ElementType string
Description string
Keywords interface{}
Group string
TeamID sql.NullString
Created time.Time
LastModified time.Time
TsvDocument interface{}
Services string
}
type Session struct {
Token string
AccessToken string
Email string
Name string
Created time.Time
Expires time.Time
}
type Story struct {
ID uuid.UUID
Name string
Creator string
Created time.Time
LastModified time.Time
Description string
Keywords []string
TeamkatalogenUrl sql.NullString
TeamID sql.NullString
Group string
}
type StoryWithTeamkatalogenView struct {
ID uuid.UUID
Name string
Creator string
Created time.Time
LastModified time.Time
Description string
Keywords []string
TeamkatalogenUrl sql.NullString
TeamID sql.NullString
Group string
TeamName sql.NullString
PaName sql.NullString
}
type Tag struct {
ID uuid.UUID
Phrase string
}
type TeamProject struct {
Team string
Project string
}
type ThirdPartyMapping struct {
Services []string
DatasetID uuid.UUID
}
type TkProductArea struct {
ID uuid.UUID
Name sql.NullString
AreaType sql.NullString
}
type TkTeam struct {
ID uuid.UUID
ProductAreaID uuid.NullUUID
Name sql.NullString
}