forked from ent/contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models_gen.go
221 lines (196 loc) · 6.64 KB
/
models_gen.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
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package todopulid
import (
"fmt"
"io"
"strconv"
"time"
"entgo.io/contrib/entgql"
"entgo.io/contrib/entgql/internal/todopulid/ent"
"entgo.io/contrib/entgql/internal/todopulid/ent/schema/pulid"
)
type NamedNode interface {
IsNamedNode()
}
type CategoryTypes struct {
Public *bool `json:"public"`
}
type CategoryTypesInput struct {
Public *bool `json:"public"`
}
type OneToMany struct {
ID pulid.ID `json:"id"`
Name string `json:"name"`
Field2 *string `json:"field2"`
Parent *OneToMany `json:"parent"`
Children []*OneToMany `json:"children"`
}
func (OneToMany) IsNode() {}
// A connection to a list of items.
type OneToManyConnection struct {
// A list of edges.
Edges []*OneToManyEdge `json:"edges"`
// Information to aid in pagination.
PageInfo *entgql.PageInfo[pulid.ID] `json:"pageInfo"`
// Identifies the total count of items in the connection.
TotalCount int `json:"totalCount"`
}
// An edge in a connection.
type OneToManyEdge struct {
// The item at the end of the edge.
Node *OneToMany `json:"node"`
// A cursor for use in pagination.
Cursor entgql.Cursor[pulid.ID] `json:"cursor"`
}
// Ordering options for OneToMany connections
type OneToManyOrder struct {
// The ordering direction.
Direction entgql.OrderDirection `json:"direction"`
// The field by which to order OneToManies.
Field OneToManyOrderField `json:"field"`
}
// OneToManyWhereInput is used for filtering OneToMany objects.
// Input was generated by ent.
type OneToManyWhereInput struct {
Not *OneToManyWhereInput `json:"not"`
And []*OneToManyWhereInput `json:"and"`
Or []*OneToManyWhereInput `json:"or"`
// id field predicates
ID *pulid.ID `json:"id"`
IDNeq *pulid.ID `json:"idNEQ"`
IDIn []pulid.ID `json:"idIn"`
IDNotIn []pulid.ID `json:"idNotIn"`
IDGt *pulid.ID `json:"idGT"`
IDGte *pulid.ID `json:"idGTE"`
IDLt *pulid.ID `json:"idLT"`
IDLte *pulid.ID `json:"idLTE"`
// name field predicates
Name *string `json:"name"`
NameNeq *string `json:"nameNEQ"`
NameIn []string `json:"nameIn"`
NameNotIn []string `json:"nameNotIn"`
NameGt *string `json:"nameGT"`
NameGte *string `json:"nameGTE"`
NameLt *string `json:"nameLT"`
NameLte *string `json:"nameLTE"`
NameContains *string `json:"nameContains"`
NameHasPrefix *string `json:"nameHasPrefix"`
NameHasSuffix *string `json:"nameHasSuffix"`
NameEqualFold *string `json:"nameEqualFold"`
NameContainsFold *string `json:"nameContainsFold"`
// field2 field predicates
Field2 *string `json:"field2"`
Field2neq *string `json:"field2NEQ"`
Field2In []string `json:"field2In"`
Field2NotIn []string `json:"field2NotIn"`
Field2gt *string `json:"field2GT"`
Field2gte *string `json:"field2GTE"`
Field2lt *string `json:"field2LT"`
Field2lte *string `json:"field2LTE"`
Field2Contains *string `json:"field2Contains"`
Field2HasPrefix *string `json:"field2HasPrefix"`
Field2HasSuffix *string `json:"field2HasSuffix"`
Field2IsNil *bool `json:"field2IsNil"`
Field2NotNil *bool `json:"field2NotNil"`
Field2EqualFold *string `json:"field2EqualFold"`
Field2ContainsFold *string `json:"field2ContainsFold"`
// parent edge predicates
HasParent *bool `json:"hasParent"`
HasParentWith []*OneToManyWhereInput `json:"hasParentWith"`
// children edge predicates
HasChildren *bool `json:"hasChildren"`
HasChildrenWith []*OneToManyWhereInput `json:"hasChildrenWith"`
}
// OrganizationWhereInput is used for filtering Workspace objects.
// Input was generated by ent.
type OrganizationWhereInput struct {
Not *OrganizationWhereInput `json:"not"`
And []*OrganizationWhereInput `json:"and"`
Or []*OrganizationWhereInput `json:"or"`
// id field predicates
ID *pulid.ID `json:"id"`
IDNeq *pulid.ID `json:"idNEQ"`
IDIn []pulid.ID `json:"idIn"`
IDNotIn []pulid.ID `json:"idNotIn"`
IDGt *pulid.ID `json:"idGT"`
IDGte *pulid.ID `json:"idGTE"`
IDLt *pulid.ID `json:"idLT"`
IDLte *pulid.ID `json:"idLTE"`
// name field predicates
Name *string `json:"name"`
NameNeq *string `json:"nameNEQ"`
NameIn []string `json:"nameIn"`
NameNotIn []string `json:"nameNotIn"`
NameGt *string `json:"nameGT"`
NameGte *string `json:"nameGTE"`
NameLt *string `json:"nameLT"`
NameLte *string `json:"nameLTE"`
NameContains *string `json:"nameContains"`
NameHasPrefix *string `json:"nameHasPrefix"`
NameHasSuffix *string `json:"nameHasSuffix"`
NameEqualFold *string `json:"nameEqualFold"`
NameContainsFold *string `json:"nameContainsFold"`
}
type Project struct {
ID pulid.ID `json:"id"`
Todos *ent.TodoConnection `json:"todos"`
}
func (Project) IsNode() {}
// ProjectWhereInput is used for filtering Project objects.
// Input was generated by ent.
type ProjectWhereInput struct {
Not *ProjectWhereInput `json:"not"`
And []*ProjectWhereInput `json:"and"`
Or []*ProjectWhereInput `json:"or"`
// id field predicates
ID *pulid.ID `json:"id"`
IDNeq *pulid.ID `json:"idNEQ"`
IDIn []pulid.ID `json:"idIn"`
IDNotIn []pulid.ID `json:"idNotIn"`
IDGt *pulid.ID `json:"idGT"`
IDGte *pulid.ID `json:"idGTE"`
IDLt *pulid.ID `json:"idLT"`
IDLte *pulid.ID `json:"idLTE"`
// todos edge predicates
HasTodos *bool `json:"hasTodos"`
HasTodosWith []*ent.TodoWhereInput `json:"hasTodosWith"`
}
// UpdateFriendshipInput is used for update Friendship object.
// Input was generated by ent.
type UpdateFriendshipInput struct {
CreatedAt *time.Time `json:"createdAt"`
UserID *pulid.ID `json:"userID"`
FriendID *pulid.ID `json:"friendID"`
}
// Properties by which OneToMany connections can be ordered.
type OneToManyOrderField string
const (
OneToManyOrderFieldName OneToManyOrderField = "NAME"
)
var AllOneToManyOrderField = []OneToManyOrderField{
OneToManyOrderFieldName,
}
func (e OneToManyOrderField) IsValid() bool {
switch e {
case OneToManyOrderFieldName:
return true
}
return false
}
func (e OneToManyOrderField) String() string {
return string(e)
}
func (e *OneToManyOrderField) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = OneToManyOrderField(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid OneToManyOrderField", str)
}
return nil
}
func (e OneToManyOrderField) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}