-
Notifications
You must be signed in to change notification settings - Fork 5
/
workitemrole.xo.go
78 lines (66 loc) · 1.84 KB
/
workitemrole.xo.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
package db
// Code generated by xo. DO NOT EDIT.
import (
"database/sql/driver"
"fmt"
)
// WorkItemRole is the 'work_item_role' enum type from schema 'public'.
type WorkItemRole string
// WorkItemRole values.
const (
// WorkItemRolePreparer is the 'preparer' work_item_role.
WorkItemRolePreparer WorkItemRole = "preparer"
// WorkItemRoleReviewer is the 'reviewer' work_item_role.
WorkItemRoleReviewer WorkItemRole = "reviewer"
)
// Value satisfies the driver.Valuer interface.
func (wir WorkItemRole) Value() (driver.Value, error) {
return string(wir), nil
}
// Scan satisfies the sql.Scanner interface.
func (wir *WorkItemRole) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*wir = WorkItemRole(s)
case string:
*wir = WorkItemRole(s)
default:
return fmt.Errorf("unsupported scan type for WorkItemRole: %T", src)
}
return nil
}
// NullWorkItemRole represents a null 'work_item_role' enum for schema 'public'.
type NullWorkItemRole struct {
WorkItemRole WorkItemRole
// Valid is true if WorkItemRole is not null.
Valid bool
}
// Value satisfies the driver.Valuer interface.
func (nwir NullWorkItemRole) Value() (driver.Value, error) {
if !nwir.Valid {
return nil, nil
}
return nwir.WorkItemRole.Value()
}
// Scan satisfies the sql.Scanner interface.
func (nwir *NullWorkItemRole) Scan(v interface{}) error {
if v == nil {
nwir.WorkItemRole, nwir.Valid = "", false
return nil
}
err := nwir.WorkItemRole.Scan(v)
nwir.Valid = err == nil
return err
}
// ErrInvalidWorkItemRole is the invalid WorkItemRole error.
type ErrInvalidWorkItemRole string
// Error satisfies the error interface.
func (err ErrInvalidWorkItemRole) Error() string {
return fmt.Sprintf("invalid WorkItemRole(%s)", string(err))
}
func AllWorkItemRoleValues() []WorkItemRole {
return []WorkItemRole{
WorkItemRolePreparer,
WorkItemRoleReviewer,
}
}