-
Notifications
You must be signed in to change notification settings - Fork 26
/
runtime.go
221 lines (217 loc) · 14.5 KB
/
runtime.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 ent, DO NOT EDIT.
package ent
import (
"time"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/apitoken"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/casbackend"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/casmapping"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/integration"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/integrationattachment"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/membership"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/organization"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/orginvitation"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/referrer"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/robotaccount"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/schema"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/user"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/workflow"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/workflowcontract"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/workflowcontractversion"
"github.com/chainloop-dev/chainloop/app/controlplane/internal/data/ent/workflowrun"
"github.com/google/uuid"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
apitokenFields := schema.APIToken{}.Fields()
_ = apitokenFields
// apitokenDescCreatedAt is the schema descriptor for created_at field.
apitokenDescCreatedAt := apitokenFields[3].Descriptor()
// apitoken.DefaultCreatedAt holds the default value on creation for the created_at field.
apitoken.DefaultCreatedAt = apitokenDescCreatedAt.Default.(func() time.Time)
// apitokenDescID is the schema descriptor for id field.
apitokenDescID := apitokenFields[0].Descriptor()
// apitoken.DefaultID holds the default value on creation for the id field.
apitoken.DefaultID = apitokenDescID.Default.(func() uuid.UUID)
casbackendFields := schema.CASBackend{}.Fields()
_ = casbackendFields
// casbackendDescCreatedAt is the schema descriptor for created_at field.
casbackendDescCreatedAt := casbackendFields[6].Descriptor()
// casbackend.DefaultCreatedAt holds the default value on creation for the created_at field.
casbackend.DefaultCreatedAt = casbackendDescCreatedAt.Default.(func() time.Time)
// casbackendDescValidatedAt is the schema descriptor for validated_at field.
casbackendDescValidatedAt := casbackendFields[8].Descriptor()
// casbackend.DefaultValidatedAt holds the default value on creation for the validated_at field.
casbackend.DefaultValidatedAt = casbackendDescValidatedAt.Default.(func() time.Time)
// casbackendDescDefault is the schema descriptor for default field.
casbackendDescDefault := casbackendFields[9].Descriptor()
// casbackend.DefaultDefault holds the default value on creation for the default field.
casbackend.DefaultDefault = casbackendDescDefault.Default.(bool)
// casbackendDescFallback is the schema descriptor for fallback field.
casbackendDescFallback := casbackendFields[11].Descriptor()
// casbackend.DefaultFallback holds the default value on creation for the fallback field.
casbackend.DefaultFallback = casbackendDescFallback.Default.(bool)
// casbackendDescID is the schema descriptor for id field.
casbackendDescID := casbackendFields[0].Descriptor()
// casbackend.DefaultID holds the default value on creation for the id field.
casbackend.DefaultID = casbackendDescID.Default.(func() uuid.UUID)
casmappingFields := schema.CASMapping{}.Fields()
_ = casmappingFields
// casmappingDescCreatedAt is the schema descriptor for created_at field.
casmappingDescCreatedAt := casmappingFields[2].Descriptor()
// casmapping.DefaultCreatedAt holds the default value on creation for the created_at field.
casmapping.DefaultCreatedAt = casmappingDescCreatedAt.Default.(func() time.Time)
// casmappingDescID is the schema descriptor for id field.
casmappingDescID := casmappingFields[0].Descriptor()
// casmapping.DefaultID holds the default value on creation for the id field.
casmapping.DefaultID = casmappingDescID.Default.(func() uuid.UUID)
integrationFields := schema.Integration{}.Fields()
_ = integrationFields
// integrationDescCreatedAt is the schema descriptor for created_at field.
integrationDescCreatedAt := integrationFields[5].Descriptor()
// integration.DefaultCreatedAt holds the default value on creation for the created_at field.
integration.DefaultCreatedAt = integrationDescCreatedAt.Default.(func() time.Time)
// integrationDescID is the schema descriptor for id field.
integrationDescID := integrationFields[0].Descriptor()
// integration.DefaultID holds the default value on creation for the id field.
integration.DefaultID = integrationDescID.Default.(func() uuid.UUID)
integrationattachmentFields := schema.IntegrationAttachment{}.Fields()
_ = integrationattachmentFields
// integrationattachmentDescCreatedAt is the schema descriptor for created_at field.
integrationattachmentDescCreatedAt := integrationattachmentFields[1].Descriptor()
// integrationattachment.DefaultCreatedAt holds the default value on creation for the created_at field.
integrationattachment.DefaultCreatedAt = integrationattachmentDescCreatedAt.Default.(func() time.Time)
// integrationattachmentDescID is the schema descriptor for id field.
integrationattachmentDescID := integrationattachmentFields[0].Descriptor()
// integrationattachment.DefaultID holds the default value on creation for the id field.
integrationattachment.DefaultID = integrationattachmentDescID.Default.(func() uuid.UUID)
membershipFields := schema.Membership{}.Fields()
_ = membershipFields
// membershipDescCurrent is the schema descriptor for current field.
membershipDescCurrent := membershipFields[1].Descriptor()
// membership.DefaultCurrent holds the default value on creation for the current field.
membership.DefaultCurrent = membershipDescCurrent.Default.(bool)
// membershipDescCreatedAt is the schema descriptor for created_at field.
membershipDescCreatedAt := membershipFields[2].Descriptor()
// membership.DefaultCreatedAt holds the default value on creation for the created_at field.
membership.DefaultCreatedAt = membershipDescCreatedAt.Default.(func() time.Time)
// membershipDescUpdatedAt is the schema descriptor for updated_at field.
membershipDescUpdatedAt := membershipFields[3].Descriptor()
// membership.DefaultUpdatedAt holds the default value on creation for the updated_at field.
membership.DefaultUpdatedAt = membershipDescUpdatedAt.Default.(func() time.Time)
// membershipDescID is the schema descriptor for id field.
membershipDescID := membershipFields[0].Descriptor()
// membership.DefaultID holds the default value on creation for the id field.
membership.DefaultID = membershipDescID.Default.(func() uuid.UUID)
orginvitationFields := schema.OrgInvitation{}.Fields()
_ = orginvitationFields
// orginvitationDescCreatedAt is the schema descriptor for created_at field.
orginvitationDescCreatedAt := orginvitationFields[3].Descriptor()
// orginvitation.DefaultCreatedAt holds the default value on creation for the created_at field.
orginvitation.DefaultCreatedAt = orginvitationDescCreatedAt.Default.(func() time.Time)
// orginvitationDescID is the schema descriptor for id field.
orginvitationDescID := orginvitationFields[0].Descriptor()
// orginvitation.DefaultID holds the default value on creation for the id field.
orginvitation.DefaultID = orginvitationDescID.Default.(func() uuid.UUID)
organizationFields := schema.Organization{}.Fields()
_ = organizationFields
// organizationDescCreatedAt is the schema descriptor for created_at field.
organizationDescCreatedAt := organizationFields[2].Descriptor()
// organization.DefaultCreatedAt holds the default value on creation for the created_at field.
organization.DefaultCreatedAt = organizationDescCreatedAt.Default.(func() time.Time)
// organizationDescID is the schema descriptor for id field.
organizationDescID := organizationFields[0].Descriptor()
// organization.DefaultID holds the default value on creation for the id field.
organization.DefaultID = organizationDescID.Default.(func() uuid.UUID)
referrerFields := schema.Referrer{}.Fields()
_ = referrerFields
// referrerDescCreatedAt is the schema descriptor for created_at field.
referrerDescCreatedAt := referrerFields[4].Descriptor()
// referrer.DefaultCreatedAt holds the default value on creation for the created_at field.
referrer.DefaultCreatedAt = referrerDescCreatedAt.Default.(func() time.Time)
// referrerDescID is the schema descriptor for id field.
referrerDescID := referrerFields[0].Descriptor()
// referrer.DefaultID holds the default value on creation for the id field.
referrer.DefaultID = referrerDescID.Default.(func() uuid.UUID)
robotaccountFields := schema.RobotAccount{}.Fields()
_ = robotaccountFields
// robotaccountDescCreatedAt is the schema descriptor for created_at field.
robotaccountDescCreatedAt := robotaccountFields[2].Descriptor()
// robotaccount.DefaultCreatedAt holds the default value on creation for the created_at field.
robotaccount.DefaultCreatedAt = robotaccountDescCreatedAt.Default.(func() time.Time)
// robotaccountDescID is the schema descriptor for id field.
robotaccountDescID := robotaccountFields[0].Descriptor()
// robotaccount.DefaultID holds the default value on creation for the id field.
robotaccount.DefaultID = robotaccountDescID.Default.(func() uuid.UUID)
userFields := schema.User{}.Fields()
_ = userFields
// userDescEmail is the schema descriptor for email field.
userDescEmail := userFields[0].Descriptor()
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
// userDescCreatedAt is the schema descriptor for created_at field.
userDescCreatedAt := userFields[2].Descriptor()
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
// userDescID is the schema descriptor for id field.
userDescID := userFields[1].Descriptor()
// user.DefaultID holds the default value on creation for the id field.
user.DefaultID = userDescID.Default.(func() uuid.UUID)
workflowFields := schema.Workflow{}.Fields()
_ = workflowFields
// workflowDescRunsCount is the schema descriptor for runs_count field.
workflowDescRunsCount := workflowFields[3].Descriptor()
// workflow.DefaultRunsCount holds the default value on creation for the runs_count field.
workflow.DefaultRunsCount = workflowDescRunsCount.Default.(int)
// workflowDescCreatedAt is the schema descriptor for created_at field.
workflowDescCreatedAt := workflowFields[5].Descriptor()
// workflow.DefaultCreatedAt holds the default value on creation for the created_at field.
workflow.DefaultCreatedAt = workflowDescCreatedAt.Default.(func() time.Time)
// workflowDescPublic is the schema descriptor for public field.
workflowDescPublic := workflowFields[7].Descriptor()
// workflow.DefaultPublic holds the default value on creation for the public field.
workflow.DefaultPublic = workflowDescPublic.Default.(bool)
// workflowDescID is the schema descriptor for id field.
workflowDescID := workflowFields[4].Descriptor()
// workflow.DefaultID holds the default value on creation for the id field.
workflow.DefaultID = workflowDescID.Default.(func() uuid.UUID)
workflowcontractFields := schema.WorkflowContract{}.Fields()
_ = workflowcontractFields
// workflowcontractDescCreatedAt is the schema descriptor for created_at field.
workflowcontractDescCreatedAt := workflowcontractFields[2].Descriptor()
// workflowcontract.DefaultCreatedAt holds the default value on creation for the created_at field.
workflowcontract.DefaultCreatedAt = workflowcontractDescCreatedAt.Default.(func() time.Time)
// workflowcontractDescID is the schema descriptor for id field.
workflowcontractDescID := workflowcontractFields[0].Descriptor()
// workflowcontract.DefaultID holds the default value on creation for the id field.
workflowcontract.DefaultID = workflowcontractDescID.Default.(func() uuid.UUID)
workflowcontractversionFields := schema.WorkflowContractVersion{}.Fields()
_ = workflowcontractversionFields
// workflowcontractversionDescBody is the schema descriptor for body field.
workflowcontractversionDescBody := workflowcontractversionFields[1].Descriptor()
// workflowcontractversion.BodyValidator is a validator for the "body" field. It is called by the builders before save.
workflowcontractversion.BodyValidator = workflowcontractversionDescBody.Validators[0].(func([]byte) error)
// workflowcontractversionDescRevision is the schema descriptor for revision field.
workflowcontractversionDescRevision := workflowcontractversionFields[2].Descriptor()
// workflowcontractversion.DefaultRevision holds the default value on creation for the revision field.
workflowcontractversion.DefaultRevision = workflowcontractversionDescRevision.Default.(int)
// workflowcontractversionDescCreatedAt is the schema descriptor for created_at field.
workflowcontractversionDescCreatedAt := workflowcontractversionFields[3].Descriptor()
// workflowcontractversion.DefaultCreatedAt holds the default value on creation for the created_at field.
workflowcontractversion.DefaultCreatedAt = workflowcontractversionDescCreatedAt.Default.(func() time.Time)
// workflowcontractversionDescID is the schema descriptor for id field.
workflowcontractversionDescID := workflowcontractversionFields[0].Descriptor()
// workflowcontractversion.DefaultID holds the default value on creation for the id field.
workflowcontractversion.DefaultID = workflowcontractversionDescID.Default.(func() uuid.UUID)
workflowrunFields := schema.WorkflowRun{}.Fields()
_ = workflowrunFields
// workflowrunDescCreatedAt is the schema descriptor for created_at field.
workflowrunDescCreatedAt := workflowrunFields[1].Descriptor()
// workflowrun.DefaultCreatedAt holds the default value on creation for the created_at field.
workflowrun.DefaultCreatedAt = workflowrunDescCreatedAt.Default.(func() time.Time)
// workflowrunDescID is the schema descriptor for id field.
workflowrunDescID := workflowrunFields[0].Descriptor()
// workflowrun.DefaultID holds the default value on creation for the id field.
workflowrun.DefaultID = workflowrunDescID.Default.(func() uuid.UUID)
}