Go · 36540 bytes Raw Blame History
1 // Code generated by sqlc. DO NOT EDIT.
2 // versions:
3 // sqlc v1.31.1
4
5 package policydb
6
7 import (
8 "database/sql/driver"
9 "fmt"
10 "net/netip"
11
12 "github.com/jackc/pgx/v5/pgtype"
13 )
14
15 type CheckConclusion string
16
17 const (
18 CheckConclusionSuccess CheckConclusion = "success"
19 CheckConclusionFailure CheckConclusion = "failure"
20 CheckConclusionNeutral CheckConclusion = "neutral"
21 CheckConclusionCancelled CheckConclusion = "cancelled"
22 CheckConclusionSkipped CheckConclusion = "skipped"
23 CheckConclusionTimedOut CheckConclusion = "timed_out"
24 CheckConclusionActionRequired CheckConclusion = "action_required"
25 CheckConclusionStale CheckConclusion = "stale"
26 )
27
28 func (e *CheckConclusion) Scan(src interface{}) error {
29 switch s := src.(type) {
30 case []byte:
31 *e = CheckConclusion(s)
32 case string:
33 *e = CheckConclusion(s)
34 default:
35 return fmt.Errorf("unsupported scan type for CheckConclusion: %T", src)
36 }
37 return nil
38 }
39
40 type NullCheckConclusion struct {
41 CheckConclusion CheckConclusion
42 Valid bool // Valid is true if CheckConclusion is not NULL
43 }
44
45 // Scan implements the Scanner interface.
46 func (ns *NullCheckConclusion) Scan(value interface{}) error {
47 if value == nil {
48 ns.CheckConclusion, ns.Valid = "", false
49 return nil
50 }
51 ns.Valid = true
52 return ns.CheckConclusion.Scan(value)
53 }
54
55 // Value implements the driver Valuer interface.
56 func (ns NullCheckConclusion) Value() (driver.Value, error) {
57 if !ns.Valid {
58 return nil, nil
59 }
60 return string(ns.CheckConclusion), nil
61 }
62
63 type CheckStatus string
64
65 const (
66 CheckStatusQueued CheckStatus = "queued"
67 CheckStatusInProgress CheckStatus = "in_progress"
68 CheckStatusCompleted CheckStatus = "completed"
69 CheckStatusPending CheckStatus = "pending"
70 )
71
72 func (e *CheckStatus) Scan(src interface{}) error {
73 switch s := src.(type) {
74 case []byte:
75 *e = CheckStatus(s)
76 case string:
77 *e = CheckStatus(s)
78 default:
79 return fmt.Errorf("unsupported scan type for CheckStatus: %T", src)
80 }
81 return nil
82 }
83
84 type NullCheckStatus struct {
85 CheckStatus CheckStatus
86 Valid bool // Valid is true if CheckStatus is not NULL
87 }
88
89 // Scan implements the Scanner interface.
90 func (ns *NullCheckStatus) Scan(value interface{}) error {
91 if value == nil {
92 ns.CheckStatus, ns.Valid = "", false
93 return nil
94 }
95 ns.Valid = true
96 return ns.CheckStatus.Scan(value)
97 }
98
99 // Value implements the driver Valuer interface.
100 func (ns NullCheckStatus) Value() (driver.Value, error) {
101 if !ns.Valid {
102 return nil, nil
103 }
104 return string(ns.CheckStatus), nil
105 }
106
107 type CollabRole string
108
109 const (
110 CollabRoleRead CollabRole = "read"
111 CollabRoleTriage CollabRole = "triage"
112 CollabRoleWrite CollabRole = "write"
113 CollabRoleMaintain CollabRole = "maintain"
114 CollabRoleAdmin CollabRole = "admin"
115 )
116
117 func (e *CollabRole) Scan(src interface{}) error {
118 switch s := src.(type) {
119 case []byte:
120 *e = CollabRole(s)
121 case string:
122 *e = CollabRole(s)
123 default:
124 return fmt.Errorf("unsupported scan type for CollabRole: %T", src)
125 }
126 return nil
127 }
128
129 type NullCollabRole struct {
130 CollabRole CollabRole
131 Valid bool // Valid is true if CollabRole is not NULL
132 }
133
134 // Scan implements the Scanner interface.
135 func (ns *NullCollabRole) Scan(value interface{}) error {
136 if value == nil {
137 ns.CollabRole, ns.Valid = "", false
138 return nil
139 }
140 ns.Valid = true
141 return ns.CollabRole.Scan(value)
142 }
143
144 // Value implements the driver Valuer interface.
145 func (ns NullCollabRole) Value() (driver.Value, error) {
146 if !ns.Valid {
147 return nil, nil
148 }
149 return string(ns.CollabRole), nil
150 }
151
152 type IssueKind string
153
154 const (
155 IssueKindIssue IssueKind = "issue"
156 IssueKindPr IssueKind = "pr"
157 )
158
159 func (e *IssueKind) Scan(src interface{}) error {
160 switch s := src.(type) {
161 case []byte:
162 *e = IssueKind(s)
163 case string:
164 *e = IssueKind(s)
165 default:
166 return fmt.Errorf("unsupported scan type for IssueKind: %T", src)
167 }
168 return nil
169 }
170
171 type NullIssueKind struct {
172 IssueKind IssueKind
173 Valid bool // Valid is true if IssueKind is not NULL
174 }
175
176 // Scan implements the Scanner interface.
177 func (ns *NullIssueKind) Scan(value interface{}) error {
178 if value == nil {
179 ns.IssueKind, ns.Valid = "", false
180 return nil
181 }
182 ns.Valid = true
183 return ns.IssueKind.Scan(value)
184 }
185
186 // Value implements the driver Valuer interface.
187 func (ns NullIssueKind) Value() (driver.Value, error) {
188 if !ns.Valid {
189 return nil, nil
190 }
191 return string(ns.IssueKind), nil
192 }
193
194 type IssueRefSource string
195
196 const (
197 IssueRefSourceCommentBody IssueRefSource = "comment_body"
198 IssueRefSourceIssueBody IssueRefSource = "issue_body"
199 IssueRefSourceCommitMessage IssueRefSource = "commit_message"
200 )
201
202 func (e *IssueRefSource) Scan(src interface{}) error {
203 switch s := src.(type) {
204 case []byte:
205 *e = IssueRefSource(s)
206 case string:
207 *e = IssueRefSource(s)
208 default:
209 return fmt.Errorf("unsupported scan type for IssueRefSource: %T", src)
210 }
211 return nil
212 }
213
214 type NullIssueRefSource struct {
215 IssueRefSource IssueRefSource
216 Valid bool // Valid is true if IssueRefSource is not NULL
217 }
218
219 // Scan implements the Scanner interface.
220 func (ns *NullIssueRefSource) Scan(value interface{}) error {
221 if value == nil {
222 ns.IssueRefSource, ns.Valid = "", false
223 return nil
224 }
225 ns.Valid = true
226 return ns.IssueRefSource.Scan(value)
227 }
228
229 // Value implements the driver Valuer interface.
230 func (ns NullIssueRefSource) Value() (driver.Value, error) {
231 if !ns.Valid {
232 return nil, nil
233 }
234 return string(ns.IssueRefSource), nil
235 }
236
237 type IssueState string
238
239 const (
240 IssueStateOpen IssueState = "open"
241 IssueStateClosed IssueState = "closed"
242 )
243
244 func (e *IssueState) Scan(src interface{}) error {
245 switch s := src.(type) {
246 case []byte:
247 *e = IssueState(s)
248 case string:
249 *e = IssueState(s)
250 default:
251 return fmt.Errorf("unsupported scan type for IssueState: %T", src)
252 }
253 return nil
254 }
255
256 type NullIssueState struct {
257 IssueState IssueState
258 Valid bool // Valid is true if IssueState is not NULL
259 }
260
261 // Scan implements the Scanner interface.
262 func (ns *NullIssueState) Scan(value interface{}) error {
263 if value == nil {
264 ns.IssueState, ns.Valid = "", false
265 return nil
266 }
267 ns.Valid = true
268 return ns.IssueState.Scan(value)
269 }
270
271 // Value implements the driver Valuer interface.
272 func (ns NullIssueState) Value() (driver.Value, error) {
273 if !ns.Valid {
274 return nil, nil
275 }
276 return string(ns.IssueState), nil
277 }
278
279 type IssueStateReason string
280
281 const (
282 IssueStateReasonCompleted IssueStateReason = "completed"
283 IssueStateReasonNotPlanned IssueStateReason = "not_planned"
284 IssueStateReasonReopened IssueStateReason = "reopened"
285 IssueStateReasonDuplicate IssueStateReason = "duplicate"
286 )
287
288 func (e *IssueStateReason) Scan(src interface{}) error {
289 switch s := src.(type) {
290 case []byte:
291 *e = IssueStateReason(s)
292 case string:
293 *e = IssueStateReason(s)
294 default:
295 return fmt.Errorf("unsupported scan type for IssueStateReason: %T", src)
296 }
297 return nil
298 }
299
300 type NullIssueStateReason struct {
301 IssueStateReason IssueStateReason
302 Valid bool // Valid is true if IssueStateReason is not NULL
303 }
304
305 // Scan implements the Scanner interface.
306 func (ns *NullIssueStateReason) Scan(value interface{}) error {
307 if value == nil {
308 ns.IssueStateReason, ns.Valid = "", false
309 return nil
310 }
311 ns.Valid = true
312 return ns.IssueStateReason.Scan(value)
313 }
314
315 // Value implements the driver Valuer interface.
316 func (ns NullIssueStateReason) Value() (driver.Value, error) {
317 if !ns.Valid {
318 return nil, nil
319 }
320 return string(ns.IssueStateReason), nil
321 }
322
323 type MilestoneState string
324
325 const (
326 MilestoneStateOpen MilestoneState = "open"
327 MilestoneStateClosed MilestoneState = "closed"
328 )
329
330 func (e *MilestoneState) Scan(src interface{}) error {
331 switch s := src.(type) {
332 case []byte:
333 *e = MilestoneState(s)
334 case string:
335 *e = MilestoneState(s)
336 default:
337 return fmt.Errorf("unsupported scan type for MilestoneState: %T", src)
338 }
339 return nil
340 }
341
342 type NullMilestoneState struct {
343 MilestoneState MilestoneState
344 Valid bool // Valid is true if MilestoneState is not NULL
345 }
346
347 // Scan implements the Scanner interface.
348 func (ns *NullMilestoneState) Scan(value interface{}) error {
349 if value == nil {
350 ns.MilestoneState, ns.Valid = "", false
351 return nil
352 }
353 ns.Valid = true
354 return ns.MilestoneState.Scan(value)
355 }
356
357 // Value implements the driver Valuer interface.
358 func (ns NullMilestoneState) Value() (driver.Value, error) {
359 if !ns.Valid {
360 return nil, nil
361 }
362 return string(ns.MilestoneState), nil
363 }
364
365 type NotificationThreadKind string
366
367 const (
368 NotificationThreadKindIssue NotificationThreadKind = "issue"
369 NotificationThreadKindPr NotificationThreadKind = "pr"
370 )
371
372 func (e *NotificationThreadKind) Scan(src interface{}) error {
373 switch s := src.(type) {
374 case []byte:
375 *e = NotificationThreadKind(s)
376 case string:
377 *e = NotificationThreadKind(s)
378 default:
379 return fmt.Errorf("unsupported scan type for NotificationThreadKind: %T", src)
380 }
381 return nil
382 }
383
384 type NullNotificationThreadKind struct {
385 NotificationThreadKind NotificationThreadKind
386 Valid bool // Valid is true if NotificationThreadKind is not NULL
387 }
388
389 // Scan implements the Scanner interface.
390 func (ns *NullNotificationThreadKind) Scan(value interface{}) error {
391 if value == nil {
392 ns.NotificationThreadKind, ns.Valid = "", false
393 return nil
394 }
395 ns.Valid = true
396 return ns.NotificationThreadKind.Scan(value)
397 }
398
399 // Value implements the driver Valuer interface.
400 func (ns NullNotificationThreadKind) Value() (driver.Value, error) {
401 if !ns.Valid {
402 return nil, nil
403 }
404 return string(ns.NotificationThreadKind), nil
405 }
406
407 type OrgPlan string
408
409 const (
410 OrgPlanFree OrgPlan = "free"
411 OrgPlanTeam OrgPlan = "team"
412 OrgPlanEnterprise OrgPlan = "enterprise"
413 )
414
415 func (e *OrgPlan) Scan(src interface{}) error {
416 switch s := src.(type) {
417 case []byte:
418 *e = OrgPlan(s)
419 case string:
420 *e = OrgPlan(s)
421 default:
422 return fmt.Errorf("unsupported scan type for OrgPlan: %T", src)
423 }
424 return nil
425 }
426
427 type NullOrgPlan struct {
428 OrgPlan OrgPlan
429 Valid bool // Valid is true if OrgPlan is not NULL
430 }
431
432 // Scan implements the Scanner interface.
433 func (ns *NullOrgPlan) Scan(value interface{}) error {
434 if value == nil {
435 ns.OrgPlan, ns.Valid = "", false
436 return nil
437 }
438 ns.Valid = true
439 return ns.OrgPlan.Scan(value)
440 }
441
442 // Value implements the driver Valuer interface.
443 func (ns NullOrgPlan) Value() (driver.Value, error) {
444 if !ns.Valid {
445 return nil, nil
446 }
447 return string(ns.OrgPlan), nil
448 }
449
450 type OrgRole string
451
452 const (
453 OrgRoleOwner OrgRole = "owner"
454 OrgRoleMember OrgRole = "member"
455 )
456
457 func (e *OrgRole) Scan(src interface{}) error {
458 switch s := src.(type) {
459 case []byte:
460 *e = OrgRole(s)
461 case string:
462 *e = OrgRole(s)
463 default:
464 return fmt.Errorf("unsupported scan type for OrgRole: %T", src)
465 }
466 return nil
467 }
468
469 type NullOrgRole struct {
470 OrgRole OrgRole
471 Valid bool // Valid is true if OrgRole is not NULL
472 }
473
474 // Scan implements the Scanner interface.
475 func (ns *NullOrgRole) Scan(value interface{}) error {
476 if value == nil {
477 ns.OrgRole, ns.Valid = "", false
478 return nil
479 }
480 ns.Valid = true
481 return ns.OrgRole.Scan(value)
482 }
483
484 // Value implements the driver Valuer interface.
485 func (ns NullOrgRole) Value() (driver.Value, error) {
486 if !ns.Valid {
487 return nil, nil
488 }
489 return string(ns.OrgRole), nil
490 }
491
492 type PrFileStatus string
493
494 const (
495 PrFileStatusAdded PrFileStatus = "added"
496 PrFileStatusModified PrFileStatus = "modified"
497 PrFileStatusDeleted PrFileStatus = "deleted"
498 PrFileStatusRenamed PrFileStatus = "renamed"
499 PrFileStatusCopied PrFileStatus = "copied"
500 )
501
502 func (e *PrFileStatus) Scan(src interface{}) error {
503 switch s := src.(type) {
504 case []byte:
505 *e = PrFileStatus(s)
506 case string:
507 *e = PrFileStatus(s)
508 default:
509 return fmt.Errorf("unsupported scan type for PrFileStatus: %T", src)
510 }
511 return nil
512 }
513
514 type NullPrFileStatus struct {
515 PrFileStatus PrFileStatus
516 Valid bool // Valid is true if PrFileStatus is not NULL
517 }
518
519 // Scan implements the Scanner interface.
520 func (ns *NullPrFileStatus) Scan(value interface{}) error {
521 if value == nil {
522 ns.PrFileStatus, ns.Valid = "", false
523 return nil
524 }
525 ns.Valid = true
526 return ns.PrFileStatus.Scan(value)
527 }
528
529 // Value implements the driver Valuer interface.
530 func (ns NullPrFileStatus) Value() (driver.Value, error) {
531 if !ns.Valid {
532 return nil, nil
533 }
534 return string(ns.PrFileStatus), nil
535 }
536
537 type PrMergeMethod string
538
539 const (
540 PrMergeMethodMerge PrMergeMethod = "merge"
541 PrMergeMethodSquash PrMergeMethod = "squash"
542 PrMergeMethodRebase PrMergeMethod = "rebase"
543 )
544
545 func (e *PrMergeMethod) Scan(src interface{}) error {
546 switch s := src.(type) {
547 case []byte:
548 *e = PrMergeMethod(s)
549 case string:
550 *e = PrMergeMethod(s)
551 default:
552 return fmt.Errorf("unsupported scan type for PrMergeMethod: %T", src)
553 }
554 return nil
555 }
556
557 type NullPrMergeMethod struct {
558 PrMergeMethod PrMergeMethod
559 Valid bool // Valid is true if PrMergeMethod is not NULL
560 }
561
562 // Scan implements the Scanner interface.
563 func (ns *NullPrMergeMethod) Scan(value interface{}) error {
564 if value == nil {
565 ns.PrMergeMethod, ns.Valid = "", false
566 return nil
567 }
568 ns.Valid = true
569 return ns.PrMergeMethod.Scan(value)
570 }
571
572 // Value implements the driver Valuer interface.
573 func (ns NullPrMergeMethod) Value() (driver.Value, error) {
574 if !ns.Valid {
575 return nil, nil
576 }
577 return string(ns.PrMergeMethod), nil
578 }
579
580 type PrMergeableState string
581
582 const (
583 PrMergeableStateUnknown PrMergeableState = "unknown"
584 PrMergeableStateClean PrMergeableState = "clean"
585 PrMergeableStateDirty PrMergeableState = "dirty"
586 PrMergeableStateBlocked PrMergeableState = "blocked"
587 PrMergeableStateBehind PrMergeableState = "behind"
588 )
589
590 func (e *PrMergeableState) Scan(src interface{}) error {
591 switch s := src.(type) {
592 case []byte:
593 *e = PrMergeableState(s)
594 case string:
595 *e = PrMergeableState(s)
596 default:
597 return fmt.Errorf("unsupported scan type for PrMergeableState: %T", src)
598 }
599 return nil
600 }
601
602 type NullPrMergeableState struct {
603 PrMergeableState PrMergeableState
604 Valid bool // Valid is true if PrMergeableState is not NULL
605 }
606
607 // Scan implements the Scanner interface.
608 func (ns *NullPrMergeableState) Scan(value interface{}) error {
609 if value == nil {
610 ns.PrMergeableState, ns.Valid = "", false
611 return nil
612 }
613 ns.Valid = true
614 return ns.PrMergeableState.Scan(value)
615 }
616
617 // Value implements the driver Valuer interface.
618 func (ns NullPrMergeableState) Value() (driver.Value, error) {
619 if !ns.Valid {
620 return nil, nil
621 }
622 return string(ns.PrMergeableState), nil
623 }
624
625 type PrReviewSide string
626
627 const (
628 PrReviewSideLeft PrReviewSide = "left"
629 PrReviewSideRight PrReviewSide = "right"
630 )
631
632 func (e *PrReviewSide) Scan(src interface{}) error {
633 switch s := src.(type) {
634 case []byte:
635 *e = PrReviewSide(s)
636 case string:
637 *e = PrReviewSide(s)
638 default:
639 return fmt.Errorf("unsupported scan type for PrReviewSide: %T", src)
640 }
641 return nil
642 }
643
644 type NullPrReviewSide struct {
645 PrReviewSide PrReviewSide
646 Valid bool // Valid is true if PrReviewSide is not NULL
647 }
648
649 // Scan implements the Scanner interface.
650 func (ns *NullPrReviewSide) Scan(value interface{}) error {
651 if value == nil {
652 ns.PrReviewSide, ns.Valid = "", false
653 return nil
654 }
655 ns.Valid = true
656 return ns.PrReviewSide.Scan(value)
657 }
658
659 // Value implements the driver Valuer interface.
660 func (ns NullPrReviewSide) Value() (driver.Value, error) {
661 if !ns.Valid {
662 return nil, nil
663 }
664 return string(ns.PrReviewSide), nil
665 }
666
667 type PrReviewState string
668
669 const (
670 PrReviewStateComment PrReviewState = "comment"
671 PrReviewStateApprove PrReviewState = "approve"
672 PrReviewStateRequestChanges PrReviewState = "request_changes"
673 )
674
675 func (e *PrReviewState) Scan(src interface{}) error {
676 switch s := src.(type) {
677 case []byte:
678 *e = PrReviewState(s)
679 case string:
680 *e = PrReviewState(s)
681 default:
682 return fmt.Errorf("unsupported scan type for PrReviewState: %T", src)
683 }
684 return nil
685 }
686
687 type NullPrReviewState struct {
688 PrReviewState PrReviewState
689 Valid bool // Valid is true if PrReviewState is not NULL
690 }
691
692 // Scan implements the Scanner interface.
693 func (ns *NullPrReviewState) Scan(value interface{}) error {
694 if value == nil {
695 ns.PrReviewState, ns.Valid = "", false
696 return nil
697 }
698 ns.Valid = true
699 return ns.PrReviewState.Scan(value)
700 }
701
702 // Value implements the driver Valuer interface.
703 func (ns NullPrReviewState) Value() (driver.Value, error) {
704 if !ns.Valid {
705 return nil, nil
706 }
707 return string(ns.PrReviewState), nil
708 }
709
710 type PrincipalKind string
711
712 const (
713 PrincipalKindUser PrincipalKind = "user"
714 PrincipalKindOrg PrincipalKind = "org"
715 )
716
717 func (e *PrincipalKind) Scan(src interface{}) error {
718 switch s := src.(type) {
719 case []byte:
720 *e = PrincipalKind(s)
721 case string:
722 *e = PrincipalKind(s)
723 default:
724 return fmt.Errorf("unsupported scan type for PrincipalKind: %T", src)
725 }
726 return nil
727 }
728
729 type NullPrincipalKind struct {
730 PrincipalKind PrincipalKind
731 Valid bool // Valid is true if PrincipalKind is not NULL
732 }
733
734 // Scan implements the Scanner interface.
735 func (ns *NullPrincipalKind) Scan(value interface{}) error {
736 if value == nil {
737 ns.PrincipalKind, ns.Valid = "", false
738 return nil
739 }
740 ns.Valid = true
741 return ns.PrincipalKind.Scan(value)
742 }
743
744 // Value implements the driver Valuer interface.
745 func (ns NullPrincipalKind) Value() (driver.Value, error) {
746 if !ns.Valid {
747 return nil, nil
748 }
749 return string(ns.PrincipalKind), nil
750 }
751
752 type RepoInitStatus string
753
754 const (
755 RepoInitStatusInitialized RepoInitStatus = "initialized"
756 RepoInitStatusInitPending RepoInitStatus = "init_pending"
757 RepoInitStatusInitFailed RepoInitStatus = "init_failed"
758 )
759
760 func (e *RepoInitStatus) Scan(src interface{}) error {
761 switch s := src.(type) {
762 case []byte:
763 *e = RepoInitStatus(s)
764 case string:
765 *e = RepoInitStatus(s)
766 default:
767 return fmt.Errorf("unsupported scan type for RepoInitStatus: %T", src)
768 }
769 return nil
770 }
771
772 type NullRepoInitStatus struct {
773 RepoInitStatus RepoInitStatus
774 Valid bool // Valid is true if RepoInitStatus is not NULL
775 }
776
777 // Scan implements the Scanner interface.
778 func (ns *NullRepoInitStatus) Scan(value interface{}) error {
779 if value == nil {
780 ns.RepoInitStatus, ns.Valid = "", false
781 return nil
782 }
783 ns.Valid = true
784 return ns.RepoInitStatus.Scan(value)
785 }
786
787 // Value implements the driver Valuer interface.
788 func (ns NullRepoInitStatus) Value() (driver.Value, error) {
789 if !ns.Valid {
790 return nil, nil
791 }
792 return string(ns.RepoInitStatus), nil
793 }
794
795 type RepoVisibility string
796
797 const (
798 RepoVisibilityPublic RepoVisibility = "public"
799 RepoVisibilityPrivate RepoVisibility = "private"
800 )
801
802 func (e *RepoVisibility) Scan(src interface{}) error {
803 switch s := src.(type) {
804 case []byte:
805 *e = RepoVisibility(s)
806 case string:
807 *e = RepoVisibility(s)
808 default:
809 return fmt.Errorf("unsupported scan type for RepoVisibility: %T", src)
810 }
811 return nil
812 }
813
814 type NullRepoVisibility struct {
815 RepoVisibility RepoVisibility
816 Valid bool // Valid is true if RepoVisibility is not NULL
817 }
818
819 // Scan implements the Scanner interface.
820 func (ns *NullRepoVisibility) Scan(value interface{}) error {
821 if value == nil {
822 ns.RepoVisibility, ns.Valid = "", false
823 return nil
824 }
825 ns.Valid = true
826 return ns.RepoVisibility.Scan(value)
827 }
828
829 // Value implements the driver Valuer interface.
830 func (ns NullRepoVisibility) Value() (driver.Value, error) {
831 if !ns.Valid {
832 return nil, nil
833 }
834 return string(ns.RepoVisibility), nil
835 }
836
837 type TransferPrincipalKind string
838
839 const (
840 TransferPrincipalKindUser TransferPrincipalKind = "user"
841 TransferPrincipalKindOrg TransferPrincipalKind = "org"
842 )
843
844 func (e *TransferPrincipalKind) Scan(src interface{}) error {
845 switch s := src.(type) {
846 case []byte:
847 *e = TransferPrincipalKind(s)
848 case string:
849 *e = TransferPrincipalKind(s)
850 default:
851 return fmt.Errorf("unsupported scan type for TransferPrincipalKind: %T", src)
852 }
853 return nil
854 }
855
856 type NullTransferPrincipalKind struct {
857 TransferPrincipalKind TransferPrincipalKind
858 Valid bool // Valid is true if TransferPrincipalKind is not NULL
859 }
860
861 // Scan implements the Scanner interface.
862 func (ns *NullTransferPrincipalKind) Scan(value interface{}) error {
863 if value == nil {
864 ns.TransferPrincipalKind, ns.Valid = "", false
865 return nil
866 }
867 ns.Valid = true
868 return ns.TransferPrincipalKind.Scan(value)
869 }
870
871 // Value implements the driver Valuer interface.
872 func (ns NullTransferPrincipalKind) Value() (driver.Value, error) {
873 if !ns.Valid {
874 return nil, nil
875 }
876 return string(ns.TransferPrincipalKind), nil
877 }
878
879 type TransferStatus string
880
881 const (
882 TransferStatusPending TransferStatus = "pending"
883 TransferStatusAccepted TransferStatus = "accepted"
884 TransferStatusDeclined TransferStatus = "declined"
885 TransferStatusCanceled TransferStatus = "canceled"
886 TransferStatusExpired TransferStatus = "expired"
887 )
888
889 func (e *TransferStatus) Scan(src interface{}) error {
890 switch s := src.(type) {
891 case []byte:
892 *e = TransferStatus(s)
893 case string:
894 *e = TransferStatus(s)
895 default:
896 return fmt.Errorf("unsupported scan type for TransferStatus: %T", src)
897 }
898 return nil
899 }
900
901 type NullTransferStatus struct {
902 TransferStatus TransferStatus
903 Valid bool // Valid is true if TransferStatus is not NULL
904 }
905
906 // Scan implements the Scanner interface.
907 func (ns *NullTransferStatus) Scan(value interface{}) error {
908 if value == nil {
909 ns.TransferStatus, ns.Valid = "", false
910 return nil
911 }
912 ns.Valid = true
913 return ns.TransferStatus.Scan(value)
914 }
915
916 // Value implements the driver Valuer interface.
917 func (ns NullTransferStatus) Value() (driver.Value, error) {
918 if !ns.Valid {
919 return nil, nil
920 }
921 return string(ns.TransferStatus), nil
922 }
923
924 type WatchLevel string
925
926 const (
927 WatchLevelAll WatchLevel = "all"
928 WatchLevelParticipating WatchLevel = "participating"
929 WatchLevelIgnore WatchLevel = "ignore"
930 )
931
932 func (e *WatchLevel) Scan(src interface{}) error {
933 switch s := src.(type) {
934 case []byte:
935 *e = WatchLevel(s)
936 case string:
937 *e = WatchLevel(s)
938 default:
939 return fmt.Errorf("unsupported scan type for WatchLevel: %T", src)
940 }
941 return nil
942 }
943
944 type NullWatchLevel struct {
945 WatchLevel WatchLevel
946 Valid bool // Valid is true if WatchLevel is not NULL
947 }
948
949 // Scan implements the Scanner interface.
950 func (ns *NullWatchLevel) Scan(value interface{}) error {
951 if value == nil {
952 ns.WatchLevel, ns.Valid = "", false
953 return nil
954 }
955 ns.Valid = true
956 return ns.WatchLevel.Scan(value)
957 }
958
959 // Value implements the driver Valuer interface.
960 func (ns NullWatchLevel) Value() (driver.Value, error) {
961 if !ns.Valid {
962 return nil, nil
963 }
964 return string(ns.WatchLevel), nil
965 }
966
967 type AuthAuditLog struct {
968 ID int64
969 ActorID pgtype.Int8
970 Action string
971 TargetType string
972 TargetID pgtype.Int8
973 Meta []byte
974 CreatedAt pgtype.Timestamptz
975 }
976
977 type AuthThrottle struct {
978 ID int64
979 Scope string
980 Identifier string
981 Hits int32
982 WindowStartedAt pgtype.Timestamptz
983 }
984
985 type BranchProtectionRule struct {
986 ID int64
987 RepoID int64
988 Pattern string
989 PreventForcePush bool
990 PreventDeletion bool
991 RequirePrForPush bool
992 AllowedPusherUserIds []int64
993 RequireSignedCommits bool
994 StatusChecksRequired []string
995 CreatedAt pgtype.Timestamptz
996 UpdatedAt pgtype.Timestamptz
997 CreatedByUserID pgtype.Int8
998 RequiredReviewCount int32
999 DismissStaleReviewsOnPush bool
1000 RequireCodeOwnerReview bool
1001 DismissStaleStatusChecksOnPush bool
1002 }
1003
1004 type CheckRun struct {
1005 ID int64
1006 SuiteID int64
1007 RepoID int64
1008 HeadSha string
1009 Name string
1010 Status CheckStatus
1011 Conclusion NullCheckConclusion
1012 StartedAt pgtype.Timestamptz
1013 CompletedAt pgtype.Timestamptz
1014 DetailsUrl string
1015 Output []byte
1016 ExternalID pgtype.Text
1017 CreatedAt pgtype.Timestamptz
1018 UpdatedAt pgtype.Timestamptz
1019 }
1020
1021 type CheckSuite struct {
1022 ID int64
1023 RepoID int64
1024 HeadSha string
1025 AppSlug string
1026 Status CheckStatus
1027 Conclusion NullCheckConclusion
1028 CreatedAt pgtype.Timestamptz
1029 UpdatedAt pgtype.Timestamptz
1030 }
1031
1032 type CodeSearchContent struct {
1033 RepoID int64
1034 RefName string
1035 Path string
1036 ContentTsv interface{}
1037 ContentTrgm string
1038 }
1039
1040 type CodeSearchPath struct {
1041 RepoID int64
1042 RefName string
1043 Path string
1044 Tsv interface{}
1045 }
1046
1047 type DomainEvent struct {
1048 ID int64
1049 ActorUserID pgtype.Int8
1050 Kind string
1051 RepoID pgtype.Int8
1052 SourceKind string
1053 SourceID int64
1054 Public bool
1055 Payload []byte
1056 CreatedAt pgtype.Timestamptz
1057 }
1058
1059 type DomainEventsProcessed struct {
1060 Consumer string
1061 LastEventID int64
1062 UpdatedAt pgtype.Timestamptz
1063 }
1064
1065 type EmailVerification struct {
1066 ID int64
1067 UserEmailID int64
1068 TokenHash []byte
1069 ExpiresAt pgtype.Timestamptz
1070 UsedAt pgtype.Timestamptz
1071 CreatedAt pgtype.Timestamptz
1072 }
1073
1074 type Issue struct {
1075 ID int64
1076 RepoID int64
1077 Number int64
1078 Kind IssueKind
1079 Title string
1080 Body string
1081 BodyHtmlCached pgtype.Text
1082 MdPipelineVersion int32
1083 AuthorUserID pgtype.Int8
1084 State IssueState
1085 StateReason NullIssueStateReason
1086 Locked bool
1087 LockReason pgtype.Text
1088 MilestoneID pgtype.Int8
1089 CreatedAt pgtype.Timestamptz
1090 UpdatedAt pgtype.Timestamptz
1091 EditedAt pgtype.Timestamptz
1092 ClosedAt pgtype.Timestamptz
1093 ClosedByUserID pgtype.Int8
1094 }
1095
1096 type IssueAssignee struct {
1097 IssueID int64
1098 UserID int64
1099 AssignedAt pgtype.Timestamptz
1100 AssignedByUserID pgtype.Int8
1101 }
1102
1103 type IssueComment struct {
1104 ID int64
1105 IssueID int64
1106 AuthorUserID pgtype.Int8
1107 Body string
1108 BodyHtmlCached pgtype.Text
1109 MdPipelineVersion int32
1110 CreatedAt pgtype.Timestamptz
1111 UpdatedAt pgtype.Timestamptz
1112 EditedAt pgtype.Timestamptz
1113 }
1114
1115 type IssueEvent struct {
1116 ID int64
1117 IssueID int64
1118 ActorUserID pgtype.Int8
1119 Kind string
1120 Meta []byte
1121 RefTargetID pgtype.Int8
1122 CreatedAt pgtype.Timestamptz
1123 }
1124
1125 type IssueLabel struct {
1126 IssueID int64
1127 LabelID int64
1128 AppliedAt pgtype.Timestamptz
1129 AppliedByUserID pgtype.Int8
1130 }
1131
1132 type IssueReference struct {
1133 ID int64
1134 SourceIssueID pgtype.Int8
1135 TargetIssueID int64
1136 SourceKind IssueRefSource
1137 SourceObjectID pgtype.Int8
1138 CreatedAt pgtype.Timestamptz
1139 }
1140
1141 type IssuesSearch struct {
1142 IssueID int64
1143 RepoID int64
1144 Kind IssueKind
1145 State IssueState
1146 AuthorUserID pgtype.Int8
1147 Tsv interface{}
1148 }
1149
1150 type Job struct {
1151 ID int64
1152 Kind string
1153 Payload []byte
1154 RunAt pgtype.Timestamptz
1155 Attempts int32
1156 MaxAttempts int32
1157 LastError pgtype.Text
1158 LockedBy pgtype.Text
1159 LockedAt pgtype.Timestamptz
1160 CompletedAt pgtype.Timestamptz
1161 FailedAt pgtype.Timestamptz
1162 CreatedAt pgtype.Timestamptz
1163 }
1164
1165 type Label struct {
1166 ID int64
1167 RepoID int64
1168 Name string
1169 Color string
1170 Description string
1171 CreatedAt pgtype.Timestamptz
1172 }
1173
1174 type Meta struct {
1175 Key string
1176 Value []byte
1177 UpdatedAt pgtype.Timestamptz
1178 }
1179
1180 type Milestone struct {
1181 ID int64
1182 RepoID int64
1183 Title string
1184 Description string
1185 State MilestoneState
1186 DueOn pgtype.Timestamptz
1187 CreatedAt pgtype.Timestamptz
1188 ClosedAt pgtype.Timestamptz
1189 }
1190
1191 type Notification struct {
1192 ID int64
1193 RecipientUserID int64
1194 Kind string
1195 Reason string
1196 RepoID pgtype.Int8
1197 ThreadKind NullNotificationThreadKind
1198 ThreadID pgtype.Int8
1199 SourceEventID pgtype.Int8
1200 Unread bool
1201 LastEventAt pgtype.Timestamptz
1202 LastActorUserID pgtype.Int8
1203 Summary []byte
1204 CreatedAt pgtype.Timestamptz
1205 UpdatedAt pgtype.Timestamptz
1206 }
1207
1208 type NotificationEmailLog struct {
1209 ID int64
1210 RecipientUserID int64
1211 NotificationID pgtype.Int8
1212 ThreadKind NullNotificationThreadKind
1213 ThreadID pgtype.Int8
1214 SentAt pgtype.Timestamptz
1215 MessageID pgtype.Text
1216 }
1217
1218 type NotificationThread struct {
1219 RecipientUserID int64
1220 ThreadKind NotificationThreadKind
1221 ThreadID int64
1222 Subscribed bool
1223 Reason string
1224 UpdatedAt pgtype.Timestamptz
1225 }
1226
1227 type Org struct {
1228 ID int64
1229 Slug string
1230 DisplayName string
1231 Description string
1232 AvatarObjectKey pgtype.Text
1233 Location string
1234 Website string
1235 BillingEmail string
1236 Plan OrgPlan
1237 AllowMemberRepoCreate bool
1238 CreatedByUserID pgtype.Int8
1239 SuspendedAt pgtype.Timestamptz
1240 SuspendedReason pgtype.Text
1241 DeletedAt pgtype.Timestamptz
1242 CreatedAt pgtype.Timestamptz
1243 UpdatedAt pgtype.Timestamptz
1244 }
1245
1246 type OrgInvitation struct {
1247 ID int64
1248 OrgID int64
1249 InvitedByUserID pgtype.Int8
1250 TargetUserID pgtype.Int8
1251 TargetEmail pgtype.Text
1252 Role OrgRole
1253 TokenHash []byte
1254 ExpiresAt pgtype.Timestamptz
1255 AcceptedAt pgtype.Timestamptz
1256 DeclinedAt pgtype.Timestamptz
1257 CanceledAt pgtype.Timestamptz
1258 CreatedAt pgtype.Timestamptz
1259 }
1260
1261 type OrgMember struct {
1262 OrgID int64
1263 UserID int64
1264 Role OrgRole
1265 InvitedByUserID pgtype.Int8
1266 JoinedAt pgtype.Timestamptz
1267 }
1268
1269 type PasswordReset struct {
1270 ID int64
1271 UserID int64
1272 TokenHash []byte
1273 ExpiresAt pgtype.Timestamptz
1274 UsedAt pgtype.Timestamptz
1275 CreatedAt pgtype.Timestamptz
1276 }
1277
1278 type PrReview struct {
1279 ID int64
1280 PrIssueID int64
1281 AuthorUserID pgtype.Int8
1282 State PrReviewState
1283 Body string
1284 BodyHtmlCached pgtype.Text
1285 SubmittedAt pgtype.Timestamptz
1286 DismissedAt pgtype.Timestamptz
1287 DismissedByUserID pgtype.Int8
1288 DismissalReason string
1289 }
1290
1291 type PrReviewComment struct {
1292 ID int64
1293 PrIssueID int64
1294 ReviewID pgtype.Int8
1295 AuthorUserID pgtype.Int8
1296 FilePath string
1297 Side PrReviewSide
1298 OriginalCommitSha string
1299 OriginalLine int32
1300 OriginalPosition int32
1301 CurrentPosition pgtype.Int4
1302 Body string
1303 BodyHtmlCached pgtype.Text
1304 InReplyToID pgtype.Int8
1305 Pending bool
1306 ResolvedAt pgtype.Timestamptz
1307 ResolvedByUserID pgtype.Int8
1308 CreatedAt pgtype.Timestamptz
1309 UpdatedAt pgtype.Timestamptz
1310 EditedAt pgtype.Timestamptz
1311 }
1312
1313 type PrReviewRequest struct {
1314 ID int64
1315 PrIssueID int64
1316 RequestedUserID pgtype.Int8
1317 RequestedTeamID pgtype.Int8
1318 RequestedByUserID pgtype.Int8
1319 RequestedAt pgtype.Timestamptz
1320 DismissedAt pgtype.Timestamptz
1321 SatisfiedByReviewID pgtype.Int8
1322 }
1323
1324 type Principal struct {
1325 Slug string
1326 Kind PrincipalKind
1327 ID int64
1328 }
1329
1330 type PullRequest struct {
1331 IssueID int64
1332 BaseRef string
1333 HeadRef string
1334 HeadRepoID int64
1335 BaseOid string
1336 HeadOid string
1337 Draft bool
1338 Mergeable pgtype.Bool
1339 MergeableState PrMergeableState
1340 MergeCommitSha pgtype.Text
1341 MergedAt pgtype.Timestamptz
1342 MergedByUserID pgtype.Int8
1343 MergeMethod NullPrMergeMethod
1344 BaseOidAtMerge pgtype.Text
1345 HeadOidAtMerge pgtype.Text
1346 LastSynchronizedAt pgtype.Timestamptz
1347 }
1348
1349 type PullRequestCommit struct {
1350 PrID int64
1351 Sha string
1352 Position int32
1353 AuthorName string
1354 AuthorEmail string
1355 CommitterName string
1356 CommitterEmail string
1357 Subject string
1358 Body string
1359 AuthoredAt pgtype.Timestamptz
1360 CommittedAt pgtype.Timestamptz
1361 }
1362
1363 type PullRequestFile struct {
1364 PrID int64
1365 Path string
1366 Status PrFileStatus
1367 OldPath pgtype.Text
1368 Additions int32
1369 Deletions int32
1370 Changes int32
1371 }
1372
1373 type PushEvent struct {
1374 ID int64
1375 RepoID int64
1376 PusherUserID pgtype.Int8
1377 BeforeSha string
1378 AfterSha string
1379 Ref string
1380 Protocol string
1381 RequestID string
1382 ProcessedAt pgtype.Timestamptz
1383 CreatedAt pgtype.Timestamptz
1384 }
1385
1386 type Repo struct {
1387 ID int64
1388 OwnerUserID pgtype.Int8
1389 OwnerOrgID pgtype.Int8
1390 Name string
1391 Description string
1392 Visibility RepoVisibility
1393 DefaultBranch string
1394 IsArchived bool
1395 ArchivedAt pgtype.Timestamptz
1396 DeletedAt pgtype.Timestamptz
1397 DiskUsedBytes int64
1398 ForkOfRepoID pgtype.Int8
1399 LicenseKey pgtype.Text
1400 PrimaryLanguage pgtype.Text
1401 HasIssues bool
1402 HasPulls bool
1403 CreatedAt pgtype.Timestamptz
1404 UpdatedAt pgtype.Timestamptz
1405 DefaultBranchOid pgtype.Text
1406 AllowSquashMerge bool
1407 AllowRebaseMerge bool
1408 AllowMergeCommit bool
1409 DefaultMergeMethod PrMergeMethod
1410 StarCount int64
1411 WatcherCount int64
1412 ForkCount int64
1413 InitStatus RepoInitStatus
1414 LastIndexedOid pgtype.Text
1415 }
1416
1417 type RepoCollaborator struct {
1418 RepoID int64
1419 UserID int64
1420 Role CollabRole
1421 AddedAt pgtype.Timestamptz
1422 AddedByUserID pgtype.Int8
1423 }
1424
1425 type RepoIssueCounter struct {
1426 RepoID int64
1427 NextNumber int64
1428 }
1429
1430 type RepoRedirect struct {
1431 OldOwnerUserID pgtype.Int8
1432 OldOwnerOrgID pgtype.Int8
1433 OldName string
1434 RepoID int64
1435 RedirectedAt pgtype.Timestamptz
1436 }
1437
1438 type RepoTransferRequest struct {
1439 ID int64
1440 RepoID int64
1441 FromUserID int64
1442 ToPrincipalKind TransferPrincipalKind
1443 ToPrincipalID int64
1444 CreatedBy int64
1445 CreatedAt pgtype.Timestamptz
1446 ExpiresAt pgtype.Timestamptz
1447 Status TransferStatus
1448 AcceptedAt pgtype.Timestamptz
1449 DeclinedAt pgtype.Timestamptz
1450 CanceledAt pgtype.Timestamptz
1451 }
1452
1453 type ReposSearch struct {
1454 RepoID int64
1455 Tsv interface{}
1456 }
1457
1458 type Star struct {
1459 UserID int64
1460 RepoID int64
1461 StarredAt pgtype.Timestamptz
1462 }
1463
1464 type User struct {
1465 ID int64
1466 Username string
1467 DisplayName string
1468 PrimaryEmailID pgtype.Int8
1469 PasswordHash string
1470 PasswordAlgo string
1471 PasswordUpdatedAt pgtype.Timestamptz
1472 EmailVerified bool
1473 LastLoginAt pgtype.Timestamptz
1474 SuspendedAt pgtype.Timestamptz
1475 SuspendedReason pgtype.Text
1476 DeletedAt pgtype.Timestamptz
1477 CreatedAt pgtype.Timestamptz
1478 UpdatedAt pgtype.Timestamptz
1479 Bio string
1480 Location string
1481 Website string
1482 Company string
1483 Pronouns string
1484 AvatarObjectKey pgtype.Text
1485 Theme string
1486 SessionEpoch int32
1487 }
1488
1489 type UserEmail struct {
1490 ID int64
1491 UserID int64
1492 Email string
1493 IsPrimary bool
1494 Verified bool
1495 VerificationTokenHash []byte
1496 VerificationSentAt pgtype.Timestamptz
1497 VerifiedAt pgtype.Timestamptz
1498 CreatedAt pgtype.Timestamptz
1499 }
1500
1501 type UserNotificationPref struct {
1502 UserID int64
1503 Key string
1504 Value []byte
1505 UpdatedAt pgtype.Timestamptz
1506 }
1507
1508 type UserRecoveryCode struct {
1509 ID int64
1510 UserID int64
1511 CodeHash []byte
1512 UsedAt pgtype.Timestamptz
1513 GeneratedAt pgtype.Timestamptz
1514 CreatedAt pgtype.Timestamptz
1515 }
1516
1517 type UserSshKey struct {
1518 ID int64
1519 UserID int64
1520 Title string
1521 FingerprintSha256 string
1522 KeyType string
1523 KeyBits int32
1524 PublicKey string
1525 LastUsedAt pgtype.Timestamptz
1526 LastUsedIp *netip.Addr
1527 CreatedAt pgtype.Timestamptz
1528 }
1529
1530 type UserToken struct {
1531 ID int64
1532 UserID int64
1533 Name string
1534 TokenHash []byte
1535 TokenPrefix string
1536 Scopes []string
1537 ExpiresAt pgtype.Timestamptz
1538 LastUsedAt pgtype.Timestamptz
1539 LastUsedIp *netip.Addr
1540 RevokedAt pgtype.Timestamptz
1541 CreatedAt pgtype.Timestamptz
1542 }
1543
1544 type UserTotp struct {
1545 ID int64
1546 UserID int64
1547 SecretEncrypted []byte
1548 SecretNonce []byte
1549 ConfirmedAt pgtype.Timestamptz
1550 LastUsedCounter int64
1551 CreatedAt pgtype.Timestamptz
1552 UpdatedAt pgtype.Timestamptz
1553 }
1554
1555 type UsernameRedirect struct {
1556 OldUsername string
1557 UserID int64
1558 ChangedAt pgtype.Timestamptz
1559 }
1560
1561 type UsersSearch struct {
1562 UserID int64
1563 Tsv interface{}
1564 }
1565
1566 type Watch struct {
1567 UserID int64
1568 RepoID int64
1569 Level WatchLevel
1570 UpdatedAt pgtype.Timestamptz
1571 }
1572
1573 type WebhookEventsPending struct {
1574 ID int64
1575 RepoID int64
1576 EventKind string
1577 Payload []byte
1578 CreatedAt pgtype.Timestamptz
1579 }
1580