-
Notifications
You must be signed in to change notification settings - Fork 7
/
resource.pb.go
1326 lines (1184 loc) · 52.8 KB
/
resource.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.30.0
// protoc (unknown)
// source: model/resource.proto
package model
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/descriptorpb"
structpb "google.golang.org/protobuf/types/known/structpb"
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)
)
type Order int32
const (
Order_ORDER_UNKNOWN Order = 0
Order_ORDER_ASC Order = 1
Order_ORDER_DESC Order = 2
)
// Enum value maps for Order.
var (
Order_name = map[int32]string{
0: "ORDER_UNKNOWN",
1: "ORDER_ASC",
2: "ORDER_DESC",
}
Order_value = map[string]int32{
"ORDER_UNKNOWN": 0,
"ORDER_ASC": 1,
"ORDER_DESC": 2,
}
)
func (x Order) Enum() *Order {
p := new(Order)
*p = x
return p
}
func (x Order) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Order) Descriptor() protoreflect.EnumDescriptor {
return file_model_resource_proto_enumTypes[0].Descriptor()
}
func (Order) Type() protoreflect.EnumType {
return &file_model_resource_proto_enumTypes[0]
}
func (x Order) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Order.Descriptor instead.
func (Order) EnumDescriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{0}
}
type ResourceIndexType int32
const (
ResourceIndexType_BTREE ResourceIndexType = 0
ResourceIndexType_HASH ResourceIndexType = 1
)
// Enum value maps for ResourceIndexType.
var (
ResourceIndexType_name = map[int32]string{
0: "BTREE",
1: "HASH",
}
ResourceIndexType_value = map[string]int32{
"BTREE": 0,
"HASH": 1,
}
)
func (x ResourceIndexType) Enum() *ResourceIndexType {
p := new(ResourceIndexType)
*p = x
return p
}
func (x ResourceIndexType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ResourceIndexType) Descriptor() protoreflect.EnumDescriptor {
return file_model_resource_proto_enumTypes[1].Descriptor()
}
func (ResourceIndexType) Type() protoreflect.EnumType {
return &file_model_resource_proto_enumTypes[1]
}
func (x ResourceIndexType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ResourceIndexType.Descriptor instead.
func (ResourceIndexType) EnumDescriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{1}
}
type ResourceProperty_Type int32
const (
ResourceProperty_BOOL ResourceProperty_Type = 0
ResourceProperty_STRING ResourceProperty_Type = 1
ResourceProperty_FLOAT32 ResourceProperty_Type = 2
ResourceProperty_FLOAT64 ResourceProperty_Type = 3
ResourceProperty_INT32 ResourceProperty_Type = 4
ResourceProperty_INT64 ResourceProperty_Type = 5
ResourceProperty_BYTES ResourceProperty_Type = 6
ResourceProperty_UUID ResourceProperty_Type = 8
ResourceProperty_DATE ResourceProperty_Type = 9
ResourceProperty_TIME ResourceProperty_Type = 10
ResourceProperty_TIMESTAMP ResourceProperty_Type = 11
ResourceProperty_OBJECT ResourceProperty_Type = 12
ResourceProperty_MAP ResourceProperty_Type = 13
ResourceProperty_LIST ResourceProperty_Type = 14
ResourceProperty_REFERENCE ResourceProperty_Type = 15
ResourceProperty_ENUM ResourceProperty_Type = 16
ResourceProperty_STRUCT ResourceProperty_Type = 17
)
// Enum value maps for ResourceProperty_Type.
var (
ResourceProperty_Type_name = map[int32]string{
0: "BOOL",
1: "STRING",
2: "FLOAT32",
3: "FLOAT64",
4: "INT32",
5: "INT64",
6: "BYTES",
8: "UUID",
9: "DATE",
10: "TIME",
11: "TIMESTAMP",
12: "OBJECT",
13: "MAP",
14: "LIST",
15: "REFERENCE",
16: "ENUM",
17: "STRUCT",
}
ResourceProperty_Type_value = map[string]int32{
"BOOL": 0,
"STRING": 1,
"FLOAT32": 2,
"FLOAT64": 3,
"INT32": 4,
"INT64": 5,
"BYTES": 6,
"UUID": 8,
"DATE": 9,
"TIME": 10,
"TIMESTAMP": 11,
"OBJECT": 12,
"MAP": 13,
"LIST": 14,
"REFERENCE": 15,
"ENUM": 16,
"STRUCT": 17,
}
)
func (x ResourceProperty_Type) Enum() *ResourceProperty_Type {
p := new(ResourceProperty_Type)
*p = x
return p
}
func (x ResourceProperty_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ResourceProperty_Type) Descriptor() protoreflect.EnumDescriptor {
return file_model_resource_proto_enumTypes[2].Descriptor()
}
func (ResourceProperty_Type) Type() protoreflect.EnumType {
return &file_model_resource_proto_enumTypes[2]
}
func (x ResourceProperty_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ResourceProperty_Type.Descriptor instead.
func (ResourceProperty_Type) EnumDescriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{0, 0}
}
// Resource properties is used to describe its schema. Each resource property is corresponding to a field in a record
// API Brew is responsible to validate data according to property types. For example, when you call create record and
// if you send 123.45 for int64
type ResourceProperty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// property name
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// type of property
Type ResourceProperty_Type `protobuf:"varint,3,opt,name=type,proto3,enum=model.ResourceProperty_Type" json:"type,omitempty"`
// type ref
TypeRef *string `protobuf:"bytes,17,opt,name=typeRef,proto3,oneof" json:"typeRef,omitempty"` // type ref, is only applicable to Struct
// this is to mark property as required
Required bool `protobuf:"varint,5,opt,name=required,proto3" json:"required,omitempty"`
Length uint32 `protobuf:"varint,7,opt,name=length,proto3" json:"length,omitempty"` // length property is only valid and required for String typed properties
Unique bool `protobuf:"varint,8,opt,name=unique,proto3" json:"unique,omitempty"`
Immutable bool `protobuf:"varint,9,opt,name=immutable,proto3" json:"immutable,omitempty"` // immutable is to mark property as immutable. If marked, updates on this field on records will be discarded
DefaultValue *structpb.Value `protobuf:"bytes,11,opt,name=defaultValue,proto3,oneof" json:"defaultValue,omitempty"` // defaultValue is default value.
ExampleValue *structpb.Value `protobuf:"bytes,12,opt,name=exampleValue,proto3,oneof" json:"exampleValue,omitempty"` // exampleValue is example value. It is an informative column
EnumValues []string `protobuf:"bytes,13,rep,name=enumValues,proto3" json:"enumValues,omitempty"` // enumValues is used if property type is an enum
Reference *Reference `protobuf:"bytes,14,opt,name=reference,proto3,oneof" json:"reference,omitempty"` // reference property is only valid and required for Reference types.
BackReference *BackReference `protobuf:"bytes,15,opt,name=backReference,proto3,oneof" json:"backReference,omitempty"` // reference property is only valid and required for Reference types.
Item *ResourceProperty `protobuf:"bytes,18,opt,name=item,proto3,oneof" json:"item,omitempty"` // item is used for complex types(list, map). For list, subType is element type. For map, it is value type(key type is always string)
Title *string `protobuf:"bytes,19,opt,name=title,proto3,oneof" json:"title,omitempty"` // It is an informative column
Description *string `protobuf:"bytes,20,opt,name=description,proto3,oneof" json:"description,omitempty"` // It is an informative column
Annotations map[string]string `protobuf:"bytes,103,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *ResourceProperty) Reset() {
*x = ResourceProperty{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResourceProperty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResourceProperty) ProtoMessage() {}
func (x *ResourceProperty) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 ResourceProperty.ProtoReflect.Descriptor instead.
func (*ResourceProperty) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{0}
}
func (x *ResourceProperty) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ResourceProperty) GetType() ResourceProperty_Type {
if x != nil {
return x.Type
}
return ResourceProperty_BOOL
}
func (x *ResourceProperty) GetTypeRef() string {
if x != nil && x.TypeRef != nil {
return *x.TypeRef
}
return ""
}
func (x *ResourceProperty) GetRequired() bool {
if x != nil {
return x.Required
}
return false
}
func (x *ResourceProperty) GetLength() uint32 {
if x != nil {
return x.Length
}
return 0
}
func (x *ResourceProperty) GetUnique() bool {
if x != nil {
return x.Unique
}
return false
}
func (x *ResourceProperty) GetImmutable() bool {
if x != nil {
return x.Immutable
}
return false
}
func (x *ResourceProperty) GetDefaultValue() *structpb.Value {
if x != nil {
return x.DefaultValue
}
return nil
}
func (x *ResourceProperty) GetExampleValue() *structpb.Value {
if x != nil {
return x.ExampleValue
}
return nil
}
func (x *ResourceProperty) GetEnumValues() []string {
if x != nil {
return x.EnumValues
}
return nil
}
func (x *ResourceProperty) GetReference() *Reference {
if x != nil {
return x.Reference
}
return nil
}
func (x *ResourceProperty) GetBackReference() *BackReference {
if x != nil {
return x.BackReference
}
return nil
}
func (x *ResourceProperty) GetItem() *ResourceProperty {
if x != nil {
return x.Item
}
return nil
}
func (x *ResourceProperty) GetTitle() string {
if x != nil && x.Title != nil {
return *x.Title
}
return ""
}
func (x *ResourceProperty) GetDescription() string {
if x != nil && x.Description != nil {
return *x.Description
}
return ""
}
func (x *ResourceProperty) GetAnnotations() map[string]string {
if x != nil {
return x.Annotations
}
return nil
}
type Reference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // referenced resource namespace
Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` // referenced resource name
Cascade bool `protobuf:"varint,3,opt,name=cascade,proto3" json:"cascade,omitempty"` // if cascade is true, delete/update operations will be cascaded to back referenced resources
}
func (x *Reference) Reset() {
*x = Reference{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Reference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Reference) ProtoMessage() {}
func (x *Reference) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 Reference.ProtoReflect.Descriptor instead.
func (*Reference) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{1}
}
func (x *Reference) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *Reference) GetResource() string {
if x != nil {
return x.Resource
}
return ""
}
func (x *Reference) GetCascade() bool {
if x != nil {
return x.Cascade
}
return false
}
type BackReference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"`
}
func (x *BackReference) Reset() {
*x = BackReference{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BackReference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BackReference) ProtoMessage() {}
func (x *BackReference) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 BackReference.ProtoReflect.Descriptor instead.
func (*BackReference) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{2}
}
func (x *BackReference) GetProperty() string {
if x != nil {
return x.Property
}
return ""
}
// source config is to configure resource and bind it to data-source and an entity inside data source.
// An entity is like a table on sql databases or collection on mongodb etc.
type ResourceSourceConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DataSource string `protobuf:"bytes,1,opt,name=dataSource,proto3" json:"dataSource,omitempty"` // data source name: where resource structure and its data will be physically exists. Data source name is required if resource is not virtual
Catalog string `protobuf:"bytes,2,opt,name=catalog,proto3" json:"catalog,omitempty"` // catalog is like a folder/schema/database. It is changing from backend to backend. Basically it is for grouping entities
Entity string `protobuf:"bytes,3,opt,name=entity,proto3" json:"entity,omitempty"` // entity name an item on datasource backend where resource will be bound. For sql databases it is table name, for mongo it is collection name, etc.
}
func (x *ResourceSourceConfig) Reset() {
*x = ResourceSourceConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResourceSourceConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResourceSourceConfig) ProtoMessage() {}
func (x *ResourceSourceConfig) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 ResourceSourceConfig.ProtoReflect.Descriptor instead.
func (*ResourceSourceConfig) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{3}
}
func (x *ResourceSourceConfig) GetDataSource() string {
if x != nil {
return x.DataSource
}
return ""
}
func (x *ResourceSourceConfig) GetCatalog() string {
if x != nil {
return x.Catalog
}
return ""
}
func (x *ResourceSourceConfig) GetEntity() string {
if x != nil {
return x.Entity
}
return ""
}
type ResourceIndexProperty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Order Order `protobuf:"varint,2,opt,name=order,proto3,enum=model.Order" json:"order,omitempty"`
}
func (x *ResourceIndexProperty) Reset() {
*x = ResourceIndexProperty{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResourceIndexProperty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResourceIndexProperty) ProtoMessage() {}
func (x *ResourceIndexProperty) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 ResourceIndexProperty.ProtoReflect.Descriptor instead.
func (*ResourceIndexProperty) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{4}
}
func (x *ResourceIndexProperty) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ResourceIndexProperty) GetOrder() Order {
if x != nil {
return x.Order
}
return Order_ORDER_UNKNOWN
}
type ResourceIndex struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Properties []*ResourceIndexProperty `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty"` // list of properties inside single index. Normally you will need only single property. Multi property will be needed for multi property indexes(for complex indexes)
IndexType ResourceIndexType `protobuf:"varint,2,opt,name=indexType,proto3,enum=model.ResourceIndexType" json:"indexType,omitempty"` // Index type(BTREE, HASH)
Unique bool `protobuf:"varint,3,opt,name=unique,proto3" json:"unique,omitempty"` // if true index will be unique index
Annotations map[string]string `protobuf:"bytes,103,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *ResourceIndex) Reset() {
*x = ResourceIndex{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResourceIndex) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResourceIndex) ProtoMessage() {}
func (x *ResourceIndex) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 ResourceIndex.ProtoReflect.Descriptor instead.
func (*ResourceIndex) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{5}
}
func (x *ResourceIndex) GetProperties() []*ResourceIndexProperty {
if x != nil {
return x.Properties
}
return nil
}
func (x *ResourceIndex) GetIndexType() ResourceIndexType {
if x != nil {
return x.IndexType
}
return ResourceIndexType_BTREE
}
func (x *ResourceIndex) GetUnique() bool {
if x != nil {
return x.Unique
}
return false
}
func (x *ResourceIndex) GetAnnotations() map[string]string {
if x != nil {
return x.Annotations
}
return nil
}
type ResourceSubType struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Properties []*ResourceProperty `protobuf:"bytes,6,rep,name=properties,proto3" json:"properties,omitempty"` // list of properties of resource. This properties will be used by records of resource. Properties is columns on sql databases. For schemaless data structures properties is only managed by API Brew itself
Annotations map[string]string `protobuf:"bytes,103,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *ResourceSubType) Reset() {
*x = ResourceSubType{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResourceSubType) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResourceSubType) ProtoMessage() {}
func (x *ResourceSubType) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_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 ResourceSubType.ProtoReflect.Descriptor instead.
func (*ResourceSubType) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{6}
}
func (x *ResourceSubType) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ResourceSubType) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *ResourceSubType) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *ResourceSubType) GetProperties() []*ResourceProperty {
if x != nil {
return x.Properties
}
return nil
}
func (x *ResourceSubType) GetAnnotations() map[string]string {
if x != nil {
return x.Annotations
}
return nil
}
type Resource struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // unique resource id; read only
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // unique resource name, it is unique per namespace
Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // each resource is kept inside a namespace. One namespace can have multiple resources
SourceConfig *ResourceSourceConfig `protobuf:"bytes,5,opt,name=sourceConfig,proto3" json:"sourceConfig,omitempty"` //
Properties []*ResourceProperty `protobuf:"bytes,6,rep,name=properties,proto3" json:"properties,omitempty"` // list of properties of resource. This properties will be used by records of resource. Properties is columns on sql databases. For schemaless data structures properties is only managed by API Brew itself
Types []*ResourceSubType `protobuf:"bytes,7,rep,name=types,proto3" json:"types,omitempty"`
Indexes []*ResourceIndex `protobuf:"bytes,8,rep,name=indexes,proto3" json:"indexes,omitempty"` // list of resource indexes. Its implementation is depending on data source backend and may not be supported by some backends.
Virtual bool `protobuf:"varint,11,opt,name=virtual,proto3" json:"virtual,omitempty"` // If virtual is true. Operations will not phisically affect datasource/backend. Virtual resources is for extension purposes. Their behaviors can be extended and altered. It can also be used to integrate 3rd party systems.
Immutable bool `protobuf:"varint,12,opt,name=immutable,proto3" json:"immutable,omitempty"` // if true, delete and update will not be allowed on this resource
Abstract bool `protobuf:"varint,13,opt,name=abstract,proto3" json:"abstract,omitempty"` // if abstract, resource is only available to internal and extension side operations
CheckReferences bool `protobuf:"varint,16,opt,name=checkReferences,proto3" json:"checkReferences,omitempty"`
Title *string `protobuf:"bytes,14,opt,name=title,proto3,oneof" json:"title,omitempty"`
Description *string `protobuf:"bytes,15,opt,name=description,proto3,oneof" json:"description,omitempty"`
AuditData *AuditData `protobuf:"bytes,101,opt,name=auditData,proto3" json:"auditData,omitempty"`
Version uint32 `protobuf:"varint,102,opt,name=version,proto3" json:"version,omitempty"`
Annotations map[string]string `protobuf:"bytes,103,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *Resource) Reset() {
*x = Resource{}
if protoimpl.UnsafeEnabled {
mi := &file_model_resource_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Resource) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Resource) ProtoMessage() {}
func (x *Resource) ProtoReflect() protoreflect.Message {
mi := &file_model_resource_proto_msgTypes[7]
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 Resource.ProtoReflect.Descriptor instead.
func (*Resource) Descriptor() ([]byte, []int) {
return file_model_resource_proto_rawDescGZIP(), []int{7}
}
func (x *Resource) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Resource) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Resource) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *Resource) GetSourceConfig() *ResourceSourceConfig {
if x != nil {
return x.SourceConfig
}
return nil
}
func (x *Resource) GetProperties() []*ResourceProperty {
if x != nil {
return x.Properties
}
return nil
}
func (x *Resource) GetTypes() []*ResourceSubType {
if x != nil {
return x.Types
}
return nil
}
func (x *Resource) GetIndexes() []*ResourceIndex {
if x != nil {
return x.Indexes
}
return nil
}
func (x *Resource) GetVirtual() bool {
if x != nil {
return x.Virtual
}
return false
}
func (x *Resource) GetImmutable() bool {
if x != nil {
return x.Immutable
}
return false
}
func (x *Resource) GetAbstract() bool {
if x != nil {
return x.Abstract
}
return false
}
func (x *Resource) GetCheckReferences() bool {
if x != nil {
return x.CheckReferences
}
return false
}
func (x *Resource) GetTitle() string {
if x != nil && x.Title != nil {
return *x.Title
}
return ""
}
func (x *Resource) GetDescription() string {
if x != nil && x.Description != nil {
return *x.Description
}
return ""
}
func (x *Resource) GetAuditData() *AuditData {
if x != nil {
return x.AuditData
}
return nil
}
func (x *Resource) GetVersion() uint32 {
if x != nil {
return x.Version
}
return 0
}
func (x *Resource) GetAnnotations() map[string]string {
if x != nil {
return x.Annotations
}
return nil
}
var File_model_resource_proto protoreflect.FileDescriptor
var file_model_resource_proto_rawDesc = []byte{
0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x1a, 0x11, 0x6d,
0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x68,
0x63, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x08, 0x0a, 0x10, 0x52, 0x65, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1b, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xca, 0x47, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79,
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
0x79, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x07,
0x74, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
0x07, 0x74, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x72,
0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72,
0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74,
0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12,
0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52,
0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6d, 0x6d, 0x75, 0x74,
0x61, 0x62, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x6d, 0x6d, 0x75,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61,
0x6c, 0x75, 0x65, 0x48, 0x01, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61,
0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x48, 0x02, 0x52, 0x0c, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x75,
0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72,
0x65, 0x6e, 0x63, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x0c, 0xc2, 0x47,
0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x03, 0x52, 0x09, 0x72, 0x65,
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x0d, 0x62, 0x61,
0x63, 0x6b, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x52, 0x65,
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x0c, 0xc2, 0x47, 0x09, 0x72, 0x65, 0x66, 0x65,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x04, 0x52, 0x0d, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x66,
0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x04, 0x69, 0x74, 0x65,
0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e,
0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
0x48, 0x05, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x74,
0x69, 0x74, 0x6c, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x05, 0x74, 0x69,
0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x0b, 0x64,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x5a, 0x0a,
0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x67, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75,
0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x41, 0x6e, 0x6e, 0x6f,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0e, 0xc2, 0x47,
0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x01, 0x0a, 0x04, 0x54, 0x79,
0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06,
0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41,
0x54, 0x33, 0x32, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34,
0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x04, 0x12, 0x09, 0x0a,