-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels_gen.go
More file actions
253 lines (211 loc) · 6.94 KB
/
Copy pathmodels_gen.go
File metadata and controls
253 lines (211 loc) · 6.94 KB
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
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
import (
"fmt"
"io"
"strconv"
"github.com/cble-platform/cble/backend/engine/models"
"github.com/cble-platform/cble/backend/ent"
"github.com/cble-platform/cble/backend/ent/groupmembership"
"github.com/cble-platform/cble/backend/ent/membership"
"github.com/google/uuid"
)
type BlueprintInput struct {
Name string `json:"name"`
Description string `json:"description"`
BlueprintTemplate string `json:"blueprintTemplate"`
VariableTypes map[string]models.BlueprintVariableType `json:"variableTypes"`
ProviderID uuid.UUID `json:"providerId"`
ProjectID uuid.UUID `json:"projectId"`
}
type BlueprintPage struct {
Blueprints []*ent.Blueprint `json:"blueprints"`
Total int `json:"total"`
}
type DeploymentInput struct {
Name string `json:"name"`
}
type DeploymentPage struct {
Deployments []*ent.Deployment `json:"deployments"`
Total int `json:"total"`
}
type GrantedPermissionPage struct {
Permissions []*ent.GrantedPermission `json:"permissions"`
Total int `json:"total"`
}
type GroupInput struct {
Name string `json:"name"`
}
type GroupMembershipInput struct {
GroupID uuid.UUID `json:"groupID"`
Role groupmembership.Role `json:"role"`
}
type GroupPage struct {
Groups []*ent.Group `json:"groups"`
Total int `json:"total"`
}
type MembershipInput struct {
UserID uuid.UUID `json:"userID"`
Role membership.Role `json:"role"`
}
type ProjectInput struct {
Name string `json:"name"`
// Maximum number of CPU cores in the project (set to -1 for unlimited)
QuotaCPU *int `json:"quotaCpu,omitempty"`
// Maximum MiB of RAM in the project (set to -1 for unlimited)
QuotaRAM *int `json:"quotaRam,omitempty"`
// Maximum MiB of Disk in the project (set to -1 for unlimited)
QuotaDisk *int `json:"quotaDisk,omitempty"`
// Maximum number of networks in the project (set to -1 for unlimited)
QuotaNetwork *int `json:"quotaNetwork,omitempty"`
// Maximum number of routers in the project (set to -1 for unlimited)
QuotaRouter *int `json:"quotaRouter,omitempty"`
}
type ProjectPage struct {
Projects []*ent.Project `json:"projects"`
Total int `json:"total"`
}
type ProviderInput struct {
DisplayName string `json:"displayName"`
ProviderGitURL string `json:"providerGitUrl"`
ProviderVersion string `json:"providerVersion"`
ConfigBytes string `json:"configBytes"`
}
type ProviderPage struct {
Providers []*ent.Provider `json:"providers"`
Total int `json:"total"`
}
type UserInput struct {
Username string `json:"username"`
Password *string `json:"password,omitempty"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
}
type UserPage struct {
Users []*ent.User `json:"users"`
Total int `json:"total"`
}
type DeploymentNodeState string
const (
DeploymentNodeStateToDeploy DeploymentNodeState = "to_deploy"
DeploymentNodeStateToDestroy DeploymentNodeState = "to_destroy"
DeploymentNodeStateToRebuild DeploymentNodeState = "to_rebuild"
DeploymentNodeStateParentAwaiting DeploymentNodeState = "parent_awaiting"
DeploymentNodeStateChildAwaiting DeploymentNodeState = "child_awaiting"
DeploymentNodeStateInProgress DeploymentNodeState = "in_progress"
DeploymentNodeStateComplete DeploymentNodeState = "complete"
DeploymentNodeStateTainted DeploymentNodeState = "tainted"
DeploymentNodeStateFailed DeploymentNodeState = "failed"
DeploymentNodeStateDestroyed DeploymentNodeState = "destroyed"
)
var AllDeploymentNodeState = []DeploymentNodeState{
DeploymentNodeStateToDeploy,
DeploymentNodeStateToDestroy,
DeploymentNodeStateToRebuild,
DeploymentNodeStateParentAwaiting,
DeploymentNodeStateChildAwaiting,
DeploymentNodeStateInProgress,
DeploymentNodeStateComplete,
DeploymentNodeStateTainted,
DeploymentNodeStateFailed,
DeploymentNodeStateDestroyed,
}
func (e DeploymentNodeState) IsValid() bool {
switch e {
case DeploymentNodeStateToDeploy, DeploymentNodeStateToDestroy, DeploymentNodeStateToRebuild, DeploymentNodeStateParentAwaiting, DeploymentNodeStateChildAwaiting, DeploymentNodeStateInProgress, DeploymentNodeStateComplete, DeploymentNodeStateTainted, DeploymentNodeStateFailed, DeploymentNodeStateDestroyed:
return true
}
return false
}
func (e DeploymentNodeState) String() string {
return string(e)
}
func (e *DeploymentNodeState) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = DeploymentNodeState(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid DeploymentNodeState", str)
}
return nil
}
func (e DeploymentNodeState) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type DeploymentState string
const (
DeploymentStateAwaiting DeploymentState = "awaiting"
DeploymentStateInProgress DeploymentState = "in_progress"
DeploymentStateComplete DeploymentState = "complete"
DeploymentStateFailed DeploymentState = "failed"
DeploymentStateDestroyed DeploymentState = "destroyed"
DeploymentStateSuspended DeploymentState = "suspended"
)
var AllDeploymentState = []DeploymentState{
DeploymentStateAwaiting,
DeploymentStateInProgress,
DeploymentStateComplete,
DeploymentStateFailed,
DeploymentStateDestroyed,
DeploymentStateSuspended,
}
func (e DeploymentState) IsValid() bool {
switch e {
case DeploymentStateAwaiting, DeploymentStateInProgress, DeploymentStateComplete, DeploymentStateFailed, DeploymentStateDestroyed, DeploymentStateSuspended:
return true
}
return false
}
func (e DeploymentState) String() string {
return string(e)
}
func (e *DeploymentState) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = DeploymentState(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid DeploymentState", str)
}
return nil
}
func (e DeploymentState) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type ResourceType string
const (
ResourceTypeResource ResourceType = "RESOURCE"
ResourceTypeData ResourceType = "DATA"
)
var AllResourceType = []ResourceType{
ResourceTypeResource,
ResourceTypeData,
}
func (e ResourceType) IsValid() bool {
switch e {
case ResourceTypeResource, ResourceTypeData:
return true
}
return false
}
func (e ResourceType) String() string {
return string(e)
}
func (e *ResourceType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = ResourceType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid ResourceType", str)
}
return nil
}
func (e ResourceType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}