-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.pb.go
2741 lines (2446 loc) · 96.2 KB
/
schema.pb.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
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.29.1
// protoc v3.21.12
// source: proto/schema.proto
package proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Describes where and by which party the implementation for an action is provided.
type ActionImplementation int32
const (
ActionImplementation_ACTION_IMPLEMENTATION_UNKNOWN ActionImplementation = 0
// Auto means the implementation of the action is generated by Keel based on the
// specified action type (get, create, update, list, delete)
ActionImplementation_ACTION_IMPLEMENTATION_AUTO ActionImplementation = 1
// Custom means the implementation of the action is provided via custom functions code.
// The code itself is not represented in this proto schema.
ActionImplementation_ACTION_IMPLEMENTATION_CUSTOM ActionImplementation = 2
// Runtime means the implementation of the action is provided in the runtime code.
ActionImplementation_ACTION_IMPLEMENTATION_RUNTIME ActionImplementation = 3
)
// Enum value maps for ActionImplementation.
var (
ActionImplementation_name = map[int32]string{
0: "ACTION_IMPLEMENTATION_UNKNOWN",
1: "ACTION_IMPLEMENTATION_AUTO",
2: "ACTION_IMPLEMENTATION_CUSTOM",
3: "ACTION_IMPLEMENTATION_RUNTIME",
}
ActionImplementation_value = map[string]int32{
"ACTION_IMPLEMENTATION_UNKNOWN": 0,
"ACTION_IMPLEMENTATION_AUTO": 1,
"ACTION_IMPLEMENTATION_CUSTOM": 2,
"ACTION_IMPLEMENTATION_RUNTIME": 3,
}
)
func (x ActionImplementation) Enum() *ActionImplementation {
p := new(ActionImplementation)
*p = x
return p
}
func (x ActionImplementation) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ActionImplementation) Descriptor() protoreflect.EnumDescriptor {
return file_proto_schema_proto_enumTypes[0].Descriptor()
}
func (ActionImplementation) Type() protoreflect.EnumType {
return &file_proto_schema_proto_enumTypes[0]
}
func (x ActionImplementation) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ActionImplementation.Descriptor instead.
func (ActionImplementation) EnumDescriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{0}
}
// Describes the behaviour of an action and a preordained input and output specification.
type ActionType int32
const (
ActionType_ACTION_TYPE_UNKNOWN ActionType = 0
// Creates a new record and returns it.
ActionType_ACTION_TYPE_CREATE ActionType = 1
// Returns a single record by looking up on a unique field.
ActionType_ACTION_TYPE_GET ActionType = 2
// Lists records optionally filtering on certain fields. The response would be a
// an object that supports pagination functionality and contains a "page" of results.
ActionType_ACTION_TYPE_LIST ActionType = 3
// Update a single record by providing a unique lookup and some fields to update.
// The resulting record is returned.
ActionType_ACTION_TYPE_UPDATE ActionType = 4
// Delete a record and returns it's ID.
ActionType_ACTION_TYPE_DELETE ActionType = 5
// A generic read action.
ActionType_ACTION_TYPE_READ ActionType = 6
// A generic write action.
ActionType_ACTION_TYPE_WRITE ActionType = 7
)
// Enum value maps for ActionType.
var (
ActionType_name = map[int32]string{
0: "ACTION_TYPE_UNKNOWN",
1: "ACTION_TYPE_CREATE",
2: "ACTION_TYPE_GET",
3: "ACTION_TYPE_LIST",
4: "ACTION_TYPE_UPDATE",
5: "ACTION_TYPE_DELETE",
6: "ACTION_TYPE_READ",
7: "ACTION_TYPE_WRITE",
}
ActionType_value = map[string]int32{
"ACTION_TYPE_UNKNOWN": 0,
"ACTION_TYPE_CREATE": 1,
"ACTION_TYPE_GET": 2,
"ACTION_TYPE_LIST": 3,
"ACTION_TYPE_UPDATE": 4,
"ACTION_TYPE_DELETE": 5,
"ACTION_TYPE_READ": 6,
"ACTION_TYPE_WRITE": 7,
}
)
func (x ActionType) Enum() *ActionType {
p := new(ActionType)
*p = x
return p
}
func (x ActionType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ActionType) Descriptor() protoreflect.EnumDescriptor {
return file_proto_schema_proto_enumTypes[1].Descriptor()
}
func (ActionType) Type() protoreflect.EnumType {
return &file_proto_schema_proto_enumTypes[1]
}
func (x ActionType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ActionType.Descriptor instead.
func (ActionType) EnumDescriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{1}
}
type Type int32
const (
Type_TYPE_UNKNOWN Type = 0
Type_TYPE_STRING Type = 1
Type_TYPE_BOOL Type = 2
Type_TYPE_INT Type = 3
Type_TYPE_TIMESTAMP Type = 4
Type_TYPE_DATE Type = 5
Type_TYPE_ID Type = 6
Type_TYPE_MODEL Type = 7
Type_TYPE_CURRENCY Type = 8
Type_TYPE_DATETIME Type = 9
Type_TYPE_ENUM Type = 10
Type_TYPE_IMAGE Type = 12
Type_TYPE_OBJECT Type = 13
// Used for sensitive data. Encrypted at rest, decrypted on read.
Type_TYPE_SECRET Type = 14
// Used for hashing passwords and passcodes with the intention to verify admission.
Type_TYPE_PASSWORD Type = 15
Type_TYPE_MESSAGE Type = 16
// Any is used in Message types to denote a field with any type.
Type_TYPE_ANY Type = 17
// Used to specify a sort direction argument.
Type_TYPE_SORT_DIRECTION Type = 18
// A union type describes a value that can be one of several types.
// These types are listed in TypeInfo's Union_Names property.
Type_TYPE_UNION Type = 19
// A string literal type which can be used to discriminate on in our Typescript types.
// TYPE_INFO string_literal_type must also be set.
Type_TYPE_STRING_LITERAL Type = 20
)
// Enum value maps for Type.
var (
Type_name = map[int32]string{
0: "TYPE_UNKNOWN",
1: "TYPE_STRING",
2: "TYPE_BOOL",
3: "TYPE_INT",
4: "TYPE_TIMESTAMP",
5: "TYPE_DATE",
6: "TYPE_ID",
7: "TYPE_MODEL",
8: "TYPE_CURRENCY",
9: "TYPE_DATETIME",
10: "TYPE_ENUM",
12: "TYPE_IMAGE",
13: "TYPE_OBJECT",
14: "TYPE_SECRET",
15: "TYPE_PASSWORD",
16: "TYPE_MESSAGE",
17: "TYPE_ANY",
18: "TYPE_SORT_DIRECTION",
19: "TYPE_UNION",
20: "TYPE_STRING_LITERAL",
}
Type_value = map[string]int32{
"TYPE_UNKNOWN": 0,
"TYPE_STRING": 1,
"TYPE_BOOL": 2,
"TYPE_INT": 3,
"TYPE_TIMESTAMP": 4,
"TYPE_DATE": 5,
"TYPE_ID": 6,
"TYPE_MODEL": 7,
"TYPE_CURRENCY": 8,
"TYPE_DATETIME": 9,
"TYPE_ENUM": 10,
"TYPE_IMAGE": 12,
"TYPE_OBJECT": 13,
"TYPE_SECRET": 14,
"TYPE_PASSWORD": 15,
"TYPE_MESSAGE": 16,
"TYPE_ANY": 17,
"TYPE_SORT_DIRECTION": 18,
"TYPE_UNION": 19,
"TYPE_STRING_LITERAL": 20,
}
)
func (x Type) Enum() *Type {
p := new(Type)
*p = x
return p
}
func (x Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Type) Descriptor() protoreflect.EnumDescriptor {
return file_proto_schema_proto_enumTypes[2].Descriptor()
}
func (Type) Type() protoreflect.EnumType {
return &file_proto_schema_proto_enumTypes[2]
}
func (x Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Type.Descriptor instead.
func (Type) EnumDescriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{2}
}
type OrderDirection int32
const (
OrderDirection_ORDER_DIRECTION_UNKNOWN OrderDirection = 0
OrderDirection_ORDER_DIRECTION_ASCENDING OrderDirection = 1
OrderDirection_ORDER_DIRECTION_DECENDING OrderDirection = 2
)
// Enum value maps for OrderDirection.
var (
OrderDirection_name = map[int32]string{
0: "ORDER_DIRECTION_UNKNOWN",
1: "ORDER_DIRECTION_ASCENDING",
2: "ORDER_DIRECTION_DECENDING",
}
OrderDirection_value = map[string]int32{
"ORDER_DIRECTION_UNKNOWN": 0,
"ORDER_DIRECTION_ASCENDING": 1,
"ORDER_DIRECTION_DECENDING": 2,
}
)
func (x OrderDirection) Enum() *OrderDirection {
p := new(OrderDirection)
*p = x
return p
}
func (x OrderDirection) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (OrderDirection) Descriptor() protoreflect.EnumDescriptor {
return file_proto_schema_proto_enumTypes[3].Descriptor()
}
func (OrderDirection) Type() protoreflect.EnumType {
return &file_proto_schema_proto_enumTypes[3]
}
func (x OrderDirection) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use OrderDirection.Descriptor instead.
func (OrderDirection) EnumDescriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{3}
}
type Schema struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Models []*Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"`
Roles []*Role `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
Apis []*Api `protobuf:"bytes,3,rep,name=apis,proto3" json:"apis,omitempty"`
Enums []*Enum `protobuf:"bytes,4,rep,name=enums,proto3" json:"enums,omitempty"`
EnvironmentVariables []*EnvironmentVariable `protobuf:"bytes,5,rep,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty"`
Messages []*Message `protobuf:"bytes,6,rep,name=messages,proto3" json:"messages,omitempty"`
Secrets []*Secret `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty"`
Jobs []*Job `protobuf:"bytes,8,rep,name=jobs,proto3" json:"jobs,omitempty"`
Subscribers []*Subscriber `protobuf:"bytes,9,rep,name=subscribers,proto3" json:"subscribers,omitempty"`
Events []*Event `protobuf:"bytes,10,rep,name=events,proto3" json:"events,omitempty"`
}
func (x *Schema) Reset() {
*x = Schema{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Schema) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Schema) ProtoMessage() {}
func (x *Schema) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Schema.ProtoReflect.Descriptor instead.
func (*Schema) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{0}
}
func (x *Schema) GetModels() []*Model {
if x != nil {
return x.Models
}
return nil
}
func (x *Schema) GetRoles() []*Role {
if x != nil {
return x.Roles
}
return nil
}
func (x *Schema) GetApis() []*Api {
if x != nil {
return x.Apis
}
return nil
}
func (x *Schema) GetEnums() []*Enum {
if x != nil {
return x.Enums
}
return nil
}
func (x *Schema) GetEnvironmentVariables() []*EnvironmentVariable {
if x != nil {
return x.EnvironmentVariables
}
return nil
}
func (x *Schema) GetMessages() []*Message {
if x != nil {
return x.Messages
}
return nil
}
func (x *Schema) GetSecrets() []*Secret {
if x != nil {
return x.Secrets
}
return nil
}
func (x *Schema) GetJobs() []*Job {
if x != nil {
return x.Jobs
}
return nil
}
func (x *Schema) GetSubscribers() []*Subscriber {
if x != nil {
return x.Subscribers
}
return nil
}
func (x *Schema) GetEvents() []*Event {
if x != nil {
return x.Events
}
return nil
}
type Model struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the model. Must be in PascalCase and be unique within the schema.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The fields this model contains
Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
// The actions this model defines. Contains both actions that will be auto
// generated and also functions
Actions []*Action `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty"`
Permissions []*PermissionRule `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"`
}
func (x *Model) Reset() {
*x = Model{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Model) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Model) ProtoMessage() {}
func (x *Model) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Model.ProtoReflect.Descriptor instead.
func (*Model) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{1}
}
func (x *Model) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Model) GetFields() []*Field {
if x != nil {
return x.Fields
}
return nil
}
func (x *Model) GetActions() []*Action {
if x != nil {
return x.Actions
}
return nil
}
func (x *Model) GetPermissions() []*PermissionRule {
if x != nil {
return x.Permissions
}
return nil
}
type Field struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the model this field belongs to.
ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
// The name of the field. Must be in lowerCamelCase and be unique within the model.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// Info regarding the type of this field
Type *TypeInfo `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
// If true then this field is allowed to be null
Optional bool `protobuf:"varint,4,opt,name=optional,proto3" json:"optional,omitempty"`
// If true then this field will have a unique constraint added to it meaning
// a given value can only exist in a single row.
// Cannot be true if `type.repeated` is true
Unique bool `protobuf:"varint,5,opt,name=unique,proto3" json:"unique,omitempty"`
// If set then this field is part of a compount unique constraint with the
// fields listed. The fields must be part of the same model and they must
// list this field in their unique_with value.
UniqueWith []string `protobuf:"bytes,8,rep,name=unique_with,json=uniqueWith,proto3" json:"unique_with,omitempty"`
// If true then this field will be set as the primary key for the parent model
PrimaryKey bool `protobuf:"varint,7,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"`
// If this field is of type TYPE_MODEL then this field indicates which field on _this_
// model is the foriegn key. This field should always be populated on the many side of a
// one-to-many relationship and on the unique side of a one-to-one.
ForeignKeyFieldName *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=foreign_key_field_name,json=foreignKeyFieldName,proto3" json:"foreign_key_field_name,omitempty"`
// This describes how the default value of this field should be created
DefaultValue *DefaultValue `protobuf:"bytes,9,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
// This only applies to the foreign key fields that we auto inject.
// If it is non null it *defines* this field as being a foreign key field,
// and carries corresponding metadata.
ForeignKeyInfo *ForeignKeyInfo `protobuf:"bytes,11,opt,name=foreign_key_info,json=foreignKeyInfo,proto3" json:"foreign_key_info,omitempty"`
// If this field is of type MODEL and the related model has an inverse field
// to this one, then this field is set to that field name.
// For example if a Post model has a field called author which is of type Author,
// and then Author has posts which is of type Post, on the Post.author field this
// value will be "posts" and on the Author.posts field this value will be "author".
InverseFieldName *wrapperspb.StringValue `protobuf:"bytes,12,opt,name=inverse_field_name,json=inverseFieldName,proto3" json:"inverse_field_name,omitempty"`
}
func (x *Field) Reset() {
*x = Field{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Field) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Field) ProtoMessage() {}
func (x *Field) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Field.ProtoReflect.Descriptor instead.
func (*Field) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{2}
}
func (x *Field) GetModelName() string {
if x != nil {
return x.ModelName
}
return ""
}
func (x *Field) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Field) GetType() *TypeInfo {
if x != nil {
return x.Type
}
return nil
}
func (x *Field) GetOptional() bool {
if x != nil {
return x.Optional
}
return false
}
func (x *Field) GetUnique() bool {
if x != nil {
return x.Unique
}
return false
}
func (x *Field) GetUniqueWith() []string {
if x != nil {
return x.UniqueWith
}
return nil
}
func (x *Field) GetPrimaryKey() bool {
if x != nil {
return x.PrimaryKey
}
return false
}
func (x *Field) GetForeignKeyFieldName() *wrapperspb.StringValue {
if x != nil {
return x.ForeignKeyFieldName
}
return nil
}
func (x *Field) GetDefaultValue() *DefaultValue {
if x != nil {
return x.DefaultValue
}
return nil
}
func (x *Field) GetForeignKeyInfo() *ForeignKeyInfo {
if x != nil {
return x.ForeignKeyInfo
}
return nil
}
func (x *Field) GetInverseFieldName() *wrapperspb.StringValue {
if x != nil {
return x.InverseFieldName
}
return nil
}
type ForeignKeyInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RelatedModelName string `protobuf:"bytes,1,opt,name=related_model_name,json=relatedModelName,proto3" json:"related_model_name,omitempty"`
RelatedModelField string `protobuf:"bytes,2,opt,name=related_model_field,json=relatedModelField,proto3" json:"related_model_field,omitempty"`
}
func (x *ForeignKeyInfo) Reset() {
*x = ForeignKeyInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ForeignKeyInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ForeignKeyInfo) ProtoMessage() {}
func (x *ForeignKeyInfo) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ForeignKeyInfo.ProtoReflect.Descriptor instead.
func (*ForeignKeyInfo) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{3}
}
func (x *ForeignKeyInfo) GetRelatedModelName() string {
if x != nil {
return x.RelatedModelName
}
return ""
}
func (x *ForeignKeyInfo) GetRelatedModelField() string {
if x != nil {
return x.RelatedModelField
}
return ""
}
type DefaultValue struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// If true then a "zero" value is used for the field, for example
// a string has a zero value of "" and a date has a zero value of
// today
UseZeroValue bool `protobuf:"varint,1,opt,name=use_zero_value,json=useZeroValue,proto3" json:"use_zero_value,omitempty"`
// This can be used to explicitly set the default value
Expression *Expression `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"`
}
func (x *DefaultValue) Reset() {
*x = DefaultValue{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DefaultValue) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DefaultValue) ProtoMessage() {}
func (x *DefaultValue) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DefaultValue.ProtoReflect.Descriptor instead.
func (*DefaultValue) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{4}
}
func (x *DefaultValue) GetUseZeroValue() bool {
if x != nil {
return x.UseZeroValue
}
return false
}
func (x *DefaultValue) GetExpression() *Expression {
if x != nil {
return x.Expression
}
return nil
}
type Action struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the model this action belongs to.
ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
// The name of the action. Must be in lowerCamelCase and be unique across all actions
// across all models within the schema. This is because in both RPC and GraphQL actions
// are top-level and so two different models can't both define an actions with the same name.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// The type of this action.
Type ActionType `protobuf:"varint,3,opt,name=type,proto3,enum=proto.ActionType" json:"type,omitempty"`
// Whether this action will be auto-generated by Keel or implemented with a function.
Implementation ActionImplementation `protobuf:"varint,4,opt,name=implementation,proto3,enum=proto.ActionImplementation" json:"implementation,omitempty"`
// A list of permission rules to apply to this action
Permissions []*PermissionRule `protobuf:"bytes,6,rep,name=permissions,proto3" json:"permissions,omitempty"`
// A list of assignment expression to be executed as part of this action.
// Only valid in `type` is ACTION_TYPE_CREATE or ACTION_TYPE_UPDATE
SetExpressions []*Expression `protobuf:"bytes,7,rep,name=set_expressions,json=setExpressions,proto3" json:"set_expressions,omitempty"`
// A list of logical expressions to be applied to the database query being
// executed as part of the action.
// Not valid if `type` is ACTION_TYPE_CREATE
// If there are multiple entries in this field they are AND'd.
WhereExpressions []*Expression `protobuf:"bytes,8,rep,name=where_expressions,json=whereExpressions,proto3" json:"where_expressions,omitempty"`
// A list of expressions that perform some kind of validation (likely on the inputs).
ValidationExpressions []*Expression `protobuf:"bytes,9,rep,name=validation_expressions,json=validationExpressions,proto3" json:"validation_expressions,omitempty"`
// A ordered list of order by statements.
OrderBy []*OrderByStatement `protobuf:"bytes,10,rep,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
// The name of the input message type for this action.
InputMessageName string `protobuf:"bytes,11,opt,name=input_message_name,json=inputMessageName,proto3" json:"input_message_name,omitempty"`
// The name of the response message type for this action when not a built-in action. This is because
// built-in action responses are determined by the action type (get, list, create, update, delete).
ResponseMessageName string `protobuf:"bytes,12,opt,name=response_message_name,json=responseMessageName,proto3" json:"response_message_name,omitempty"`
}
func (x *Action) Reset() {
*x = Action{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Action) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Action) ProtoMessage() {}
func (x *Action) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Action.ProtoReflect.Descriptor instead.
func (*Action) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{5}
}
func (x *Action) GetModelName() string {
if x != nil {
return x.ModelName
}
return ""
}
func (x *Action) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Action) GetType() ActionType {
if x != nil {
return x.Type
}
return ActionType_ACTION_TYPE_UNKNOWN
}
func (x *Action) GetImplementation() ActionImplementation {
if x != nil {
return x.Implementation
}
return ActionImplementation_ACTION_IMPLEMENTATION_UNKNOWN
}
func (x *Action) GetPermissions() []*PermissionRule {
if x != nil {
return x.Permissions
}
return nil
}
func (x *Action) GetSetExpressions() []*Expression {
if x != nil {
return x.SetExpressions
}
return nil
}
func (x *Action) GetWhereExpressions() []*Expression {
if x != nil {
return x.WhereExpressions
}
return nil
}
func (x *Action) GetValidationExpressions() []*Expression {
if x != nil {
return x.ValidationExpressions
}
return nil
}
func (x *Action) GetOrderBy() []*OrderByStatement {
if x != nil {
return x.OrderBy
}
return nil
}
func (x *Action) GetInputMessageName() string {
if x != nil {
return x.InputMessageName
}
return ""
}
func (x *Action) GetResponseMessageName() string {
if x != nil {
return x.ResponseMessageName
}
return ""
}
type Role struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the role
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// A list of domains to match for this role e.g. myorg.com
Domains []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"`
// A list of specific email addresses to match for this role eg. sarah@myorg.com
Emails []string `protobuf:"bytes,3,rep,name=emails,proto3" json:"emails,omitempty"`
}
func (x *Role) Reset() {
*x = Role{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_schema_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Role) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Role) ProtoMessage() {}
func (x *Role) ProtoReflect() protoreflect.Message {
mi := &file_proto_schema_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Role.ProtoReflect.Descriptor instead.
func (*Role) Descriptor() ([]byte, []int) {
return file_proto_schema_proto_rawDescGZIP(), []int{6}
}
func (x *Role) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Role) GetDomains() []string {
if x != nil {
return x.Domains
}
return nil
}
func (x *Role) GetEmails() []string {
if x != nil {
return x.Emails
}
return nil
}
type PermissionRule struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Name of the model this permission rule applies to
ModelName string `protobuf:"bytes,1,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
// Name of the specific action this permission rule applies to.
// If this field is populated then `action_types` is ignored.
ActionName *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=action_name,json=actionName,proto3" json:"action_name,omitempty"`
// A name of a Role that has been defined in the schema.
// Cannot be provided if `expression` is provided.
RoleNames []string `protobuf:"bytes,3,rep,name=role_names,json=roleNames,proto3" json:"role_names,omitempty"`
// An expression to evaluate at runtime.
// Cannot be provided if `role_name` is provided.
Expression *Expression `protobuf:"bytes,4,opt,name=expression,proto3" json:"expression,omitempty"`
// A list of action types that this permission rule applies to
// Should not be set if `action_name` is provided.
ActionTypes []ActionType `protobuf:"varint,5,rep,packed,name=action_types,json=actionTypes,proto3,enum=proto.ActionType" json:"action_types,omitempty"`