diff --git a/pkg/models/object.go b/pkg/models/entity.go similarity index 96% rename from pkg/models/object.go rename to pkg/models/entity.go index b798aae2514..2205fbaf8b9 100644 --- a/pkg/models/object.go +++ b/pkg/models/entity.go @@ -88,6 +88,12 @@ type EntitySummary struct { // Key value pairs. Tags are are represented as keys with empty values Labels map[string]string `json:"labels,omitempty"` + // Parent folder UID + Folder string `json:"folder,omitempty"` + + // URL safe version of the name. It will be unique within the folder + Slug string `json:"slug,omitempty"` + // URL should only be set if the value is not derived directly from kind+uid // NOTE: this may go away with a more robust GRN solution /!\ URL string `json:"URL,omitempty"` diff --git a/pkg/services/playlist/playlistimpl/entity_store.go b/pkg/services/playlist/playlistimpl/entity_store.go index 43d0848f89b..4d44ad85e2a 100644 --- a/pkg/services/playlist/playlistimpl/entity_store.go +++ b/pkg/services/playlist/playlistimpl/entity_store.go @@ -152,13 +152,13 @@ func (s *entityStoreImpl) Get(ctx context.Context, q *playlist.GetPlaylistByUidQ if err != nil { return nil, err } - if rsp.Entity == nil || rsp.Entity.Body == nil { + if rsp == nil || rsp.Body == nil { return nil, fmt.Errorf("missing object") } // Get the object from payload found := &playlist.PlaylistDTO{} - err = json.Unmarshal(rsp.Entity.Body, found) + err = json.Unmarshal(rsp.Body, found) return found, err } diff --git a/pkg/services/store/entity/dummy/dummy_server.go b/pkg/services/store/entity/dummy/dummy_server.go deleted file mode 100644 index 84a6e8544f3..00000000000 --- a/pkg/services/store/entity/dummy/dummy_server.go +++ /dev/null @@ -1,398 +0,0 @@ -package dummy - -import ( - "context" - "crypto/md5" - "encoding/hex" - "encoding/json" - "errors" - "fmt" - "strconv" - "time" - - "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/infra/x/persistentcollection" - "github.com/grafana/grafana/pkg/services/grpcserver" - "github.com/grafana/grafana/pkg/services/store" - "github.com/grafana/grafana/pkg/services/store/entity" - "github.com/grafana/grafana/pkg/services/store/kind" - "github.com/grafana/grafana/pkg/setting" -) - -type EntityVersionWithBody struct { - *entity.EntityVersionInfo `json:"info,omitempty"` - - Body []byte `json:"body,omitempty"` -} - -type EntityWithHistory struct { - Entity *entity.Entity `json:"entity,omitempty"` - History []*EntityVersionWithBody `json:"history,omitempty"` -} - -var ( - // increment when Entity changes - rawEntityVersion = 10 -) - -// Make sure we implement both store + admin -var _ entity.EntityStoreServer = &dummyEntityServer{} -var _ entity.EntityStoreAdminServer = &dummyEntityServer{} - -func ProvideDummyEntityServer(cfg *setting.Cfg, grpcServerProvider grpcserver.Provider, kinds kind.KindRegistry) entity.EntityStoreServer { - objectServer := &dummyEntityServer{ - collection: persistentcollection.NewLocalFSPersistentCollection[*EntityWithHistory]("raw-object", cfg.DataPath, rawEntityVersion), - log: log.New("in-memory-object-server"), - kinds: kinds, - } - entity.RegisterEntityStoreServer(grpcServerProvider.GetServer(), objectServer) - return objectServer -} - -type dummyEntityServer struct { - log log.Logger - collection persistentcollection.PersistentCollection[*EntityWithHistory] - kinds kind.KindRegistry -} - -func namespaceFromUID(grn *entity.GRN) string { - // TODO - return "orgId-1" -} - -func (i *dummyEntityServer) findEntity(ctx context.Context, grn *entity.GRN, version string) (*EntityWithHistory, *entity.Entity, error) { - if grn == nil { - return nil, nil, errors.New("GRN must not be nil") - } - - obj, err := i.collection.FindFirst(ctx, namespaceFromUID(grn), func(i *EntityWithHistory) (bool, error) { - return grn.Equals(i.Entity.GRN), nil - }) - - if err != nil { - return nil, nil, err - } - - if obj == nil { - return nil, nil, nil - } - - getLatestVersion := version == "" - if getLatestVersion { - return obj, obj.Entity, nil - } - - for _, objVersion := range obj.History { - if objVersion.Version == version { - copy := &entity.Entity{ - GRN: obj.Entity.GRN, - CreatedAt: obj.Entity.CreatedAt, - CreatedBy: obj.Entity.CreatedBy, - UpdatedAt: objVersion.UpdatedAt, - UpdatedBy: objVersion.UpdatedBy, - ETag: objVersion.ETag, - Version: objVersion.Version, - - // Body is added from the dummy server cache (it does not exist in EntityVersionInfo) - Body: objVersion.Body, - } - - return obj, copy, nil - } - } - - return obj, nil, nil -} - -func (i *dummyEntityServer) Read(ctx context.Context, r *entity.ReadEntityRequest) (*entity.ReadEntityResponse, error) { - grn := getFullGRN(ctx, r.GRN) - _, objVersion, err := i.findEntity(ctx, grn, r.Version) - if err != nil { - return nil, err - } - - if objVersion == nil { - return &entity.ReadEntityResponse{ - Entity: nil, - SummaryJson: nil, - }, nil - } - - rsp := &entity.ReadEntityResponse{ - Entity: objVersion, - } - if r.WithSummary { - // Since we do not store the summary, we can just recreate on demand - builder := i.kinds.GetSummaryBuilder(r.GRN.Kind) - if builder != nil { - summary, _, e2 := builder(ctx, r.GRN.UID, objVersion.Body) - if e2 != nil { - return nil, e2 - } - rsp.SummaryJson, err = json.Marshal(summary) - } - } - return rsp, err -} - -func (i *dummyEntityServer) BatchRead(ctx context.Context, batchR *entity.BatchReadEntityRequest) (*entity.BatchReadEntityResponse, error) { - results := make([]*entity.ReadEntityResponse, 0) - for _, r := range batchR.Batch { - resp, err := i.Read(ctx, r) - if err != nil { - return nil, err - } - results = append(results, resp) - } - - return &entity.BatchReadEntityResponse{Results: results}, nil -} - -func createContentsHash(contents []byte) string { - hash := md5.Sum(contents) - return hex.EncodeToString(hash[:]) -} - -func (i *dummyEntityServer) update(ctx context.Context, r *entity.AdminWriteEntityRequest, namespace string) (*entity.WriteEntityResponse, error) { - builder := i.kinds.GetSummaryBuilder(r.GRN.Kind) - if builder == nil { - return nil, fmt.Errorf("unsupported kind: " + r.GRN.Kind) - } - rsp := &entity.WriteEntityResponse{} - - updatedCount, err := i.collection.Update(ctx, namespace, func(i *EntityWithHistory) (bool, *EntityWithHistory, error) { - if !r.GRN.Equals(i.Entity.GRN) { - return false, nil, nil - } - - if r.PreviousVersion != "" && i.Entity.Version != r.PreviousVersion { - return false, nil, fmt.Errorf("expected the previous version to be %s, but was %s", r.PreviousVersion, i.Entity.Version) - } - - prevVersion, err := strconv.Atoi(i.Entity.Version) - if err != nil { - return false, nil, err - } - - modifier := store.UserFromContext(ctx) - - updated := &entity.Entity{ - GRN: r.GRN, - CreatedAt: i.Entity.CreatedAt, - CreatedBy: i.Entity.CreatedBy, - UpdatedAt: time.Now().UnixMilli(), - UpdatedBy: store.GetUserIDString(modifier), - Size: int64(len(r.Body)), - ETag: createContentsHash(r.Body), - Body: r.Body, - Version: fmt.Sprintf("%d", prevVersion+1), - } - - versionInfo := &EntityVersionWithBody{ - Body: r.Body, - EntityVersionInfo: &entity.EntityVersionInfo{ - Version: updated.Version, - UpdatedAt: updated.UpdatedAt, - UpdatedBy: updated.UpdatedBy, - Size: updated.Size, - ETag: updated.ETag, - Comment: r.Comment, - }, - } - rsp.Entity = versionInfo.EntityVersionInfo - rsp.Status = entity.WriteEntityResponse_UPDATED - - // When saving, it must be different than the head version - if i.Entity.ETag == updated.ETag { - versionInfo.EntityVersionInfo.Version = i.Entity.Version - rsp.Status = entity.WriteEntityResponse_UNCHANGED - return false, nil, nil - } - - return true, &EntityWithHistory{ - Entity: updated, - History: append(i.History, versionInfo), - }, nil - }) - - if err != nil { - return nil, err - } - - if updatedCount == 0 && rsp.Entity == nil { - return nil, fmt.Errorf("could not find object: %v", r.GRN) - } - - return rsp, nil -} - -func (i *dummyEntityServer) insert(ctx context.Context, r *entity.AdminWriteEntityRequest, namespace string) (*entity.WriteEntityResponse, error) { - modifier := store.GetUserIDString(store.UserFromContext(ctx)) - rawObj := &entity.Entity{ - GRN: r.GRN, - UpdatedAt: time.Now().UnixMilli(), - CreatedAt: time.Now().UnixMilli(), - CreatedBy: modifier, - UpdatedBy: modifier, - Size: int64(len(r.Body)), - ETag: createContentsHash(r.Body), - Body: r.Body, - Version: fmt.Sprintf("%d", 1), - } - - info := &entity.EntityVersionInfo{ - Version: rawObj.Version, - UpdatedAt: rawObj.UpdatedAt, - UpdatedBy: rawObj.UpdatedBy, - Size: rawObj.Size, - ETag: rawObj.ETag, - Comment: r.Comment, - } - - newObj := &EntityWithHistory{ - Entity: rawObj, - History: []*EntityVersionWithBody{{ - EntityVersionInfo: info, - Body: r.Body, - }}, - } - - err := i.collection.Insert(ctx, namespace, newObj) - if err != nil { - return nil, err - } - - return &entity.WriteEntityResponse{ - Error: nil, - Entity: info, - Status: entity.WriteEntityResponse_CREATED, - }, nil -} - -func (i *dummyEntityServer) Write(ctx context.Context, r *entity.WriteEntityRequest) (*entity.WriteEntityResponse, error) { - return i.doWrite(ctx, entity.ToAdminWriteEntityRequest(r)) -} - -func (i *dummyEntityServer) AdminWrite(ctx context.Context, r *entity.AdminWriteEntityRequest) (*entity.WriteEntityResponse, error) { - // Check permissions? - return i.doWrite(ctx, r) -} - -func (i *dummyEntityServer) doWrite(ctx context.Context, r *entity.AdminWriteEntityRequest) (*entity.WriteEntityResponse, error) { - grn := getFullGRN(ctx, r.GRN) - namespace := namespaceFromUID(grn) - obj, err := i.collection.FindFirst(ctx, namespace, func(i *EntityWithHistory) (bool, error) { - if i == nil || r == nil { - return false, nil - } - return grn.Equals(i.Entity.GRN), nil - }) - if err != nil { - return nil, err - } - - if obj == nil { - return i.insert(ctx, r, namespace) - } - - return i.update(ctx, r, namespace) -} - -func (i *dummyEntityServer) Delete(ctx context.Context, r *entity.DeleteEntityRequest) (*entity.DeleteEntityResponse, error) { - grn := getFullGRN(ctx, r.GRN) - _, err := i.collection.Delete(ctx, namespaceFromUID(grn), func(i *EntityWithHistory) (bool, error) { - if grn.Equals(i.Entity.GRN) { - if r.PreviousVersion != "" && i.Entity.Version != r.PreviousVersion { - return false, fmt.Errorf("expected the previous version to be %s, but was %s", r.PreviousVersion, i.Entity.Version) - } - - return true, nil - } - - return false, nil - }) - - if err != nil { - return nil, err - } - - return &entity.DeleteEntityResponse{ - OK: true, - }, nil -} - -func (i *dummyEntityServer) History(ctx context.Context, r *entity.EntityHistoryRequest) (*entity.EntityHistoryResponse, error) { - grn := getFullGRN(ctx, r.GRN) - obj, _, err := i.findEntity(ctx, grn, "") - if err != nil { - return nil, err - } - - rsp := &entity.EntityHistoryResponse{} - if obj != nil { - // Return the most recent versions first - // Better? save them in this order? - for i := len(obj.History) - 1; i >= 0; i-- { - rsp.Versions = append(rsp.Versions, obj.History[i].EntityVersionInfo) - } - } - return rsp, nil -} - -func (i *dummyEntityServer) Search(ctx context.Context, r *entity.EntitySearchRequest) (*entity.EntitySearchResponse, error) { - var kindMap map[string]bool - if len(r.Kind) != 0 { - kindMap = make(map[string]bool) - for _, k := range r.Kind { - kindMap[k] = true - } - } - - // TODO more filters - objects, err := i.collection.Find(ctx, namespaceFromUID(&entity.GRN{}), func(i *EntityWithHistory) (bool, error) { - if len(r.Kind) != 0 { - if _, ok := kindMap[i.Entity.GRN.Kind]; !ok { - return false, nil - } - } - return true, nil - }) - if err != nil { - return nil, err - } - - searchResults := make([]*entity.EntitySearchResult, 0) - for _, o := range objects { - builder := i.kinds.GetSummaryBuilder(o.Entity.GRN.Kind) - if builder == nil { - continue - } - summary, clean, e2 := builder(ctx, o.Entity.GRN.UID, o.Entity.Body) - if e2 != nil { - continue - } - - searchResults = append(searchResults, &entity.EntitySearchResult{ - GRN: o.Entity.GRN, - Version: o.Entity.Version, - UpdatedAt: o.Entity.UpdatedAt, - UpdatedBy: o.Entity.UpdatedBy, - Name: summary.Name, - Description: summary.Description, - Body: clean, - }) - } - - return &entity.EntitySearchResponse{ - Results: searchResults, - }, nil -} - -// This sets the TenantId on the request GRN -func getFullGRN(ctx context.Context, grn *entity.GRN) *entity.GRN { - if grn.TenantId == 0 { - modifier := store.UserFromContext(ctx) - grn.TenantId = modifier.OrgID - } - return grn -} diff --git a/pkg/services/store/entity/dummy/dummy_server_test.go b/pkg/services/store/entity/dummy/dummy_server_test.go deleted file mode 100644 index 7566affdf2f..00000000000 --- a/pkg/services/store/entity/dummy/dummy_server_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package dummy - -import ( - "encoding/json" - "fmt" - "testing" - - "github.com/grafana/grafana/pkg/services/store/entity" - "github.com/stretchr/testify/require" -) - -func TestRawEncoders(t *testing.T) { - body, err := json.Marshal(map[string]interface{}{ - "hello": "world", - "field": 1.23, - }) - require.NoError(t, err) - - raw := &EntityVersionWithBody{ - &entity.EntityVersionInfo{ - Version: "A", - }, - body, - } - - b, err := json.Marshal(raw) - require.NoError(t, err) - - str := string(b) - fmt.Printf("expect: %s", str) - require.JSONEq(t, `{"info":{"version":"A"},"body":"eyJmaWVsZCI6MS4yMywiaGVsbG8iOiJ3b3JsZCJ9"}`, str) - - copy := &EntityVersionWithBody{} - err = json.Unmarshal(b, copy) - require.NoError(t, err) -} - -func TestRawEntityWithHistory(t *testing.T) { - body, err := json.Marshal(map[string]interface{}{ - "hello": "world", - "field": 1.23, - }) - require.NoError(t, err) - - raw := &EntityWithHistory{ - Entity: &entity.Entity{ - GRN: &entity.GRN{UID: "x"}, - Version: "A", - Body: body, - }, - History: make([]*EntityVersionWithBody, 0), - } - raw.History = append(raw.History, &EntityVersionWithBody{ - &entity.EntityVersionInfo{ - Version: "B", - }, - body, - }) - - b, err := json.MarshalIndent(raw, "", " ") - require.NoError(t, err) - - str := string(b) - //fmt.Printf("expect: %s", str) - require.JSONEq(t, `{ - "entity": { - "GRN": { - "UID": "x" - }, - "version": "A", - "body": { - "field": 1.23, - "hello": "world" - } - }, - "history": [ - { - "info": { - "version": "B" - }, - "body": "eyJmaWVsZCI6MS4yMywiaGVsbG8iOiJ3b3JsZCJ9" - } - ] - }`, str) - - copy := &EntityVersionWithBody{} - err = json.Unmarshal(b, copy) - require.NoError(t, err) -} diff --git a/pkg/services/store/entity/dummy/fake_store.go b/pkg/services/store/entity/dummy/fake_store.go index 59d2687b495..59166a30e46 100644 --- a/pkg/services/store/entity/dummy/fake_store.go +++ b/pkg/services/store/entity/dummy/fake_store.go @@ -25,7 +25,7 @@ func (i fakeEntityStore) Write(ctx context.Context, r *entity.WriteEntityRequest return nil, fmt.Errorf("unimplemented") } -func (i fakeEntityStore) Read(ctx context.Context, r *entity.ReadEntityRequest) (*entity.ReadEntityResponse, error) { +func (i fakeEntityStore) Read(ctx context.Context, r *entity.ReadEntityRequest) (*entity.Entity, error) { return nil, fmt.Errorf("unimplemented") } diff --git a/pkg/services/store/entity/entity.pb.go b/pkg/services/store/entity/entity.pb.go index e9a72463ed3..03e2a9ee5dd 100644 --- a/pkg/services/store/entity/entity.pb.go +++ b/pkg/services/store/entity/entity.pb.go @@ -70,7 +70,7 @@ func (x WriteEntityResponse_Status) Number() protoreflect.EnumNumber { // Deprecated: Use WriteEntityResponse_Status.Descriptor instead. func (WriteEntityResponse_Status) EnumDescriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{11, 0} + return file_entity_proto_rawDescGZIP(), []int{10, 0} } type GRN struct { @@ -149,30 +149,26 @@ type Entity struct { // Entity identifier GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + // The version will change when the entity is saved. It is not necessarily sortable + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Time in epoch milliseconds that the entity was created - CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Time in epoch milliseconds that the entity was updated - UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Who created the entity - CreatedBy string `protobuf:"bytes,4,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` + CreatedBy string `protobuf:"bytes,5,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` // Who updated the entity - UpdatedBy string `protobuf:"bytes,5,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` + UpdatedBy string `protobuf:"bytes,6,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` // Content Length - Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` + Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` // MD5 digest of the body - ETag string `protobuf:"bytes,7,opt,name=ETag,proto3" json:"ETag,omitempty"` + ETag string `protobuf:"bytes,8,opt,name=ETag,proto3" json:"ETag,omitempty"` // Raw bytes of the storage entity. The kind will determine what is a valid payload - Body []byte `protobuf:"bytes,8,opt,name=body,proto3" json:"body,omitempty"` - // Folder UID - Folder string `protobuf:"bytes,9,opt,name=folder,proto3" json:"folder,omitempty"` - // Unique slug within folder (may be UID) - Slug string `protobuf:"bytes,10,opt,name=slug,proto3" json:"slug,omitempty"` - // The version will change when the entity is saved. It is not necessarily sortable - // - // NOTE: currently managed by the dashboard+dashboard_version tables - Version string `protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty"` + Body []byte `protobuf:"bytes,9,opt,name=body,proto3" json:"body,omitempty"` + // Entity summary as JSON + SummaryJson []byte `protobuf:"bytes,10,opt,name=summary_json,json=summaryJson,proto3" json:"summary_json,omitempty"` // External location info - Origin *EntityOriginInfo `protobuf:"bytes,12,opt,name=origin,proto3" json:"origin,omitempty"` + Origin *EntityOriginInfo `protobuf:"bytes,11,opt,name=origin,proto3" json:"origin,omitempty"` } func (x *Entity) Reset() { @@ -214,6 +210,13 @@ func (x *Entity) GetGRN() *GRN { return nil } +func (x *Entity) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + func (x *Entity) GetCreatedAt() int64 { if x != nil { return x.CreatedAt @@ -263,25 +266,11 @@ func (x *Entity) GetBody() []byte { return nil } -func (x *Entity) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *Entity) GetSlug() string { - if x != nil { - return x.Slug - } - return "" -} - -func (x *Entity) GetVersion() string { +func (x *Entity) GetSummaryJson() []byte { if x != nil { - return x.Version + return x.SummaryJson } - return "" + return nil } func (x *Entity) GetOrigin() *EntityOriginInfo { @@ -291,14 +280,15 @@ func (x *Entity) GetOrigin() *EntityOriginInfo { return nil } +// This stores additional metadata for items entities that were synced from external systmes type EntityOriginInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // NOTE: currently managed by the dashboard_provisioning table + // identify the external source (plugin, git instance, etc) Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` - // Key in the upstream system + // Key in the upstream system (git hash, file path, etc) Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // Time in epoch milliseconds that the entity was last synced with an external system (provisioning/git) Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` @@ -596,63 +586,6 @@ func (x *ReadEntityRequest) GetWithSummary() bool { return false } -type ReadEntityResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Entity details with the body removed - Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"` - // Entity summary as JSON - SummaryJson []byte `protobuf:"bytes,2,opt,name=summary_json,json=summaryJson,proto3" json:"summary_json,omitempty"` -} - -func (x *ReadEntityResponse) Reset() { - *x = ReadEntityResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadEntityResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadEntityResponse) ProtoMessage() {} - -func (x *ReadEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_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 ReadEntityResponse.ProtoReflect.Descriptor instead. -func (*ReadEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{6} -} - -func (x *ReadEntityResponse) GetEntity() *Entity { - if x != nil { - return x.Entity - } - return nil -} - -func (x *ReadEntityResponse) GetSummaryJson() []byte { - if x != nil { - return x.SummaryJson - } - return nil -} - type BatchReadEntityRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -664,7 +597,7 @@ type BatchReadEntityRequest struct { func (x *BatchReadEntityRequest) Reset() { *x = BatchReadEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[7] + mi := &file_entity_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -677,7 +610,7 @@ func (x *BatchReadEntityRequest) String() string { func (*BatchReadEntityRequest) ProtoMessage() {} func (x *BatchReadEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[7] + mi := &file_entity_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -690,7 +623,7 @@ func (x *BatchReadEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchReadEntityRequest.ProtoReflect.Descriptor instead. func (*BatchReadEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{7} + return file_entity_proto_rawDescGZIP(), []int{6} } func (x *BatchReadEntityRequest) GetBatch() []*ReadEntityRequest { @@ -705,13 +638,13 @@ type BatchReadEntityResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Results []*ReadEntityResponse `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` + Results []*Entity `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (x *BatchReadEntityResponse) Reset() { *x = BatchReadEntityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[8] + mi := &file_entity_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +657,7 @@ func (x *BatchReadEntityResponse) String() string { func (*BatchReadEntityResponse) ProtoMessage() {} func (x *BatchReadEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[8] + mi := &file_entity_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -737,10 +670,10 @@ func (x *BatchReadEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchReadEntityResponse.ProtoReflect.Descriptor instead. func (*BatchReadEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{8} + return file_entity_proto_rawDescGZIP(), []int{7} } -func (x *BatchReadEntityResponse) GetResults() []*ReadEntityResponse { +func (x *BatchReadEntityResponse) GetResults() []*Entity { if x != nil { return x.Results } @@ -767,7 +700,7 @@ type WriteEntityRequest struct { func (x *WriteEntityRequest) Reset() { *x = WriteEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[9] + mi := &file_entity_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +713,7 @@ func (x *WriteEntityRequest) String() string { func (*WriteEntityRequest) ProtoMessage() {} func (x *WriteEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[9] + mi := &file_entity_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -793,7 +726,7 @@ func (x *WriteEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteEntityRequest.ProtoReflect.Descriptor instead. func (*WriteEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{9} + return file_entity_proto_rawDescGZIP(), []int{8} } func (x *WriteEntityRequest) GetGRN() *GRN { @@ -875,7 +808,7 @@ type AdminWriteEntityRequest struct { func (x *AdminWriteEntityRequest) Reset() { *x = AdminWriteEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[10] + mi := &file_entity_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -888,7 +821,7 @@ func (x *AdminWriteEntityRequest) String() string { func (*AdminWriteEntityRequest) ProtoMessage() {} func (x *AdminWriteEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[10] + mi := &file_entity_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,7 +834,7 @@ func (x *AdminWriteEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AdminWriteEntityRequest.ProtoReflect.Descriptor instead. func (*AdminWriteEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{10} + return file_entity_proto_rawDescGZIP(), []int{9} } func (x *AdminWriteEntityRequest) GetGRN() *GRN { @@ -1008,7 +941,7 @@ type WriteEntityResponse struct { func (x *WriteEntityResponse) Reset() { *x = WriteEntityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[11] + mi := &file_entity_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1021,7 +954,7 @@ func (x *WriteEntityResponse) String() string { func (*WriteEntityResponse) ProtoMessage() {} func (x *WriteEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[11] + mi := &file_entity_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1034,7 +967,7 @@ func (x *WriteEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteEntityResponse.ProtoReflect.Descriptor instead. func (*WriteEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{11} + return file_entity_proto_rawDescGZIP(), []int{10} } func (x *WriteEntityResponse) GetError() *EntityErrorInfo { @@ -1086,7 +1019,7 @@ type DeleteEntityRequest struct { func (x *DeleteEntityRequest) Reset() { *x = DeleteEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[12] + mi := &file_entity_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1099,7 +1032,7 @@ func (x *DeleteEntityRequest) String() string { func (*DeleteEntityRequest) ProtoMessage() {} func (x *DeleteEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[12] + mi := &file_entity_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1112,7 +1045,7 @@ func (x *DeleteEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteEntityRequest.ProtoReflect.Descriptor instead. func (*DeleteEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{12} + return file_entity_proto_rawDescGZIP(), []int{11} } func (x *DeleteEntityRequest) GetGRN() *GRN { @@ -1140,7 +1073,7 @@ type DeleteEntityResponse struct { func (x *DeleteEntityResponse) Reset() { *x = DeleteEntityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[13] + mi := &file_entity_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1153,7 +1086,7 @@ func (x *DeleteEntityResponse) String() string { func (*DeleteEntityResponse) ProtoMessage() {} func (x *DeleteEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[13] + mi := &file_entity_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1166,7 +1099,7 @@ func (x *DeleteEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteEntityResponse.ProtoReflect.Descriptor instead. func (*DeleteEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{13} + return file_entity_proto_rawDescGZIP(), []int{12} } func (x *DeleteEntityResponse) GetOK() bool { @@ -1192,7 +1125,7 @@ type EntityHistoryRequest struct { func (x *EntityHistoryRequest) Reset() { *x = EntityHistoryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[14] + mi := &file_entity_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1205,7 +1138,7 @@ func (x *EntityHistoryRequest) String() string { func (*EntityHistoryRequest) ProtoMessage() {} func (x *EntityHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[14] + mi := &file_entity_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1218,7 +1151,7 @@ func (x *EntityHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityHistoryRequest.ProtoReflect.Descriptor instead. func (*EntityHistoryRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{14} + return file_entity_proto_rawDescGZIP(), []int{13} } func (x *EntityHistoryRequest) GetGRN() *GRN { @@ -1258,7 +1191,7 @@ type EntityHistoryResponse struct { func (x *EntityHistoryResponse) Reset() { *x = EntityHistoryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[15] + mi := &file_entity_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1271,7 +1204,7 @@ func (x *EntityHistoryResponse) String() string { func (*EntityHistoryResponse) ProtoMessage() {} func (x *EntityHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[15] + mi := &file_entity_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1284,7 +1217,7 @@ func (x *EntityHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityHistoryResponse.ProtoReflect.Descriptor instead. func (*EntityHistoryResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{15} + return file_entity_proto_rawDescGZIP(), []int{14} } func (x *EntityHistoryResponse) GetGRN() *GRN { @@ -1338,7 +1271,7 @@ type EntitySearchRequest struct { func (x *EntitySearchRequest) Reset() { *x = EntitySearchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[16] + mi := &file_entity_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1351,7 +1284,7 @@ func (x *EntitySearchRequest) String() string { func (*EntitySearchRequest) ProtoMessage() {} func (x *EntitySearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[16] + mi := &file_entity_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1364,7 +1297,7 @@ func (x *EntitySearchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EntitySearchRequest.ProtoReflect.Descriptor instead. func (*EntitySearchRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{16} + return file_entity_proto_rawDescGZIP(), []int{15} } func (x *EntitySearchRequest) GetNextPageToken() string { @@ -1474,7 +1407,7 @@ type EntitySearchResult struct { func (x *EntitySearchResult) Reset() { *x = EntitySearchResult{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[17] + mi := &file_entity_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1487,7 +1420,7 @@ func (x *EntitySearchResult) String() string { func (*EntitySearchResult) ProtoMessage() {} func (x *EntitySearchResult) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[17] + mi := &file_entity_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1500,7 +1433,7 @@ func (x *EntitySearchResult) ProtoReflect() protoreflect.Message { // Deprecated: Use EntitySearchResult.ProtoReflect.Descriptor instead. func (*EntitySearchResult) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{17} + return file_entity_proto_rawDescGZIP(), []int{16} } func (x *EntitySearchResult) GetGRN() *GRN { @@ -1607,7 +1540,7 @@ type EntitySearchResponse struct { func (x *EntitySearchResponse) Reset() { *x = EntitySearchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[18] + mi := &file_entity_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1620,7 +1553,7 @@ func (x *EntitySearchResponse) String() string { func (*EntitySearchResponse) ProtoMessage() {} func (x *EntitySearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[18] + mi := &file_entity_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1633,7 +1566,7 @@ func (x *EntitySearchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EntitySearchResponse.ProtoReflect.Descriptor instead. func (*EntitySearchResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{18} + return file_entity_proto_rawDescGZIP(), []int{17} } func (x *EntitySearchResponse) GetResults() []*EntitySearchResult { @@ -1659,256 +1592,248 @@ var file_entity_proto_rawDesc = []byte{ 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, - 0x22, 0xd7, 0x02, 0x0a, 0x06, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x03, 0x47, + 0x22, 0xce, 0x02, 0x0a, 0x06, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, - 0x61, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, - 0x75, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x0f, - 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4a, 0x73, 0x6f, 0x6e, - 0x22, 0xad, 0x01, 0x0a, 0x11, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, - 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, - 0x77, 0x69, 0x74, 0x68, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, - 0x5f, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x21, 0x0a, - 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, - 0x22, 0x49, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x22, 0x4f, 0x0a, 0x17, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa4, 0x01, 0x0a, - 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, - 0x52, 0x4e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, - 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x96, 0x03, 0x0a, 0x17, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x16, - 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x68, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x63, 0x6c, - 0x65, 0x61, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xb3, 0x02, 0x0a, - 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, - 0x52, 0x4e, 0x12, 0x31, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, - 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x44, - 0x10, 0x03, 0x22, 0x5f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, + 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x12, + 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, + 0x69, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x5f, + 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0xad, 0x01, 0x0a, 0x11, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x73, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x49, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2f, 0x0a, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x22, 0x43, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x16, 0x0a, 0x06, + 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, + 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x96, 0x03, + 0x0a, 0x17, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, - 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, - 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, - 0x4b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x4f, 0x4b, 0x22, 0x73, 0x0a, 0x14, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xb3, 0x02, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, + 0x03, 0x47, 0x52, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x31, 0x0a, 0x06, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4a, 0x73, + 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3c, + 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, + 0x09, 0x55, 0x4e, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x44, 0x10, 0x03, 0x22, 0x5f, 0x0a, 0x13, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, - 0x52, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0x95, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, - 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x35, 0x0a, 0x08, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, - 0x12, 0x3f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, - 0xd0, 0x03, 0x0a, 0x12, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, - 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, - 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, - 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x4a, 0x73, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 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, 0x74, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xfa, 0x03, 0x0a, 0x0b, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, - 0x12, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1a, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, - 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, + 0x52, 0x4e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x0a, + 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x4b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x02, 0x4f, 0x4b, 0x22, 0x73, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1b, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, + 0x47, 0x52, 0x4e, 0x12, 0x35, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1f, 0x0a, 0x0b, + 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x39, + 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0xd0, 0x03, 0x0a, 0x12, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, + 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x4a, 0x73, + 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4a, 0x73, 0x6f, + 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x74, 0x0a, 0x14, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x32, 0xee, 0x03, 0x0a, 0x0b, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x19, 0x2e, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, + 0x61, 0x64, 0x12, 0x1e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5e, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, - 0x74, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x3b, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, + 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1b, 0x2e, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x5e, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x3b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1924,7 +1849,7 @@ func file_entity_proto_rawDescGZIP() []byte { } var file_entity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_entity_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_entity_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_entity_proto_goTypes = []interface{}{ (WriteEntityResponse_Status)(0), // 0: entity.WriteEntityResponse.Status (*GRN)(nil), // 1: entity.GRN @@ -1933,65 +1858,63 @@ var file_entity_proto_goTypes = []interface{}{ (*EntityErrorInfo)(nil), // 4: entity.EntityErrorInfo (*EntityVersionInfo)(nil), // 5: entity.EntityVersionInfo (*ReadEntityRequest)(nil), // 6: entity.ReadEntityRequest - (*ReadEntityResponse)(nil), // 7: entity.ReadEntityResponse - (*BatchReadEntityRequest)(nil), // 8: entity.BatchReadEntityRequest - (*BatchReadEntityResponse)(nil), // 9: entity.BatchReadEntityResponse - (*WriteEntityRequest)(nil), // 10: entity.WriteEntityRequest - (*AdminWriteEntityRequest)(nil), // 11: entity.AdminWriteEntityRequest - (*WriteEntityResponse)(nil), // 12: entity.WriteEntityResponse - (*DeleteEntityRequest)(nil), // 13: entity.DeleteEntityRequest - (*DeleteEntityResponse)(nil), // 14: entity.DeleteEntityResponse - (*EntityHistoryRequest)(nil), // 15: entity.EntityHistoryRequest - (*EntityHistoryResponse)(nil), // 16: entity.EntityHistoryResponse - (*EntitySearchRequest)(nil), // 17: entity.EntitySearchRequest - (*EntitySearchResult)(nil), // 18: entity.EntitySearchResult - (*EntitySearchResponse)(nil), // 19: entity.EntitySearchResponse - nil, // 20: entity.EntitySearchRequest.LabelsEntry - nil, // 21: entity.EntitySearchResult.LabelsEntry + (*BatchReadEntityRequest)(nil), // 7: entity.BatchReadEntityRequest + (*BatchReadEntityResponse)(nil), // 8: entity.BatchReadEntityResponse + (*WriteEntityRequest)(nil), // 9: entity.WriteEntityRequest + (*AdminWriteEntityRequest)(nil), // 10: entity.AdminWriteEntityRequest + (*WriteEntityResponse)(nil), // 11: entity.WriteEntityResponse + (*DeleteEntityRequest)(nil), // 12: entity.DeleteEntityRequest + (*DeleteEntityResponse)(nil), // 13: entity.DeleteEntityResponse + (*EntityHistoryRequest)(nil), // 14: entity.EntityHistoryRequest + (*EntityHistoryResponse)(nil), // 15: entity.EntityHistoryResponse + (*EntitySearchRequest)(nil), // 16: entity.EntitySearchRequest + (*EntitySearchResult)(nil), // 17: entity.EntitySearchResult + (*EntitySearchResponse)(nil), // 18: entity.EntitySearchResponse + nil, // 19: entity.EntitySearchRequest.LabelsEntry + nil, // 20: entity.EntitySearchResult.LabelsEntry } var file_entity_proto_depIdxs = []int32{ 1, // 0: entity.Entity.GRN:type_name -> entity.GRN 3, // 1: entity.Entity.origin:type_name -> entity.EntityOriginInfo 1, // 2: entity.ReadEntityRequest.GRN:type_name -> entity.GRN - 2, // 3: entity.ReadEntityResponse.entity:type_name -> entity.Entity - 6, // 4: entity.BatchReadEntityRequest.batch:type_name -> entity.ReadEntityRequest - 7, // 5: entity.BatchReadEntityResponse.results:type_name -> entity.ReadEntityResponse - 1, // 6: entity.WriteEntityRequest.GRN:type_name -> entity.GRN - 1, // 7: entity.AdminWriteEntityRequest.GRN:type_name -> entity.GRN - 3, // 8: entity.AdminWriteEntityRequest.origin:type_name -> entity.EntityOriginInfo - 4, // 9: entity.WriteEntityResponse.error:type_name -> entity.EntityErrorInfo - 1, // 10: entity.WriteEntityResponse.GRN:type_name -> entity.GRN - 5, // 11: entity.WriteEntityResponse.entity:type_name -> entity.EntityVersionInfo - 0, // 12: entity.WriteEntityResponse.status:type_name -> entity.WriteEntityResponse.Status - 1, // 13: entity.DeleteEntityRequest.GRN:type_name -> entity.GRN - 1, // 14: entity.EntityHistoryRequest.GRN:type_name -> entity.GRN - 1, // 15: entity.EntityHistoryResponse.GRN:type_name -> entity.GRN - 5, // 16: entity.EntityHistoryResponse.versions:type_name -> entity.EntityVersionInfo - 20, // 17: entity.EntitySearchRequest.labels:type_name -> entity.EntitySearchRequest.LabelsEntry - 1, // 18: entity.EntitySearchResult.GRN:type_name -> entity.GRN - 21, // 19: entity.EntitySearchResult.labels:type_name -> entity.EntitySearchResult.LabelsEntry - 18, // 20: entity.EntitySearchResponse.results:type_name -> entity.EntitySearchResult - 6, // 21: entity.EntityStore.Read:input_type -> entity.ReadEntityRequest - 8, // 22: entity.EntityStore.BatchRead:input_type -> entity.BatchReadEntityRequest - 10, // 23: entity.EntityStore.Write:input_type -> entity.WriteEntityRequest - 13, // 24: entity.EntityStore.Delete:input_type -> entity.DeleteEntityRequest - 15, // 25: entity.EntityStore.History:input_type -> entity.EntityHistoryRequest - 17, // 26: entity.EntityStore.Search:input_type -> entity.EntitySearchRequest - 11, // 27: entity.EntityStore.AdminWrite:input_type -> entity.AdminWriteEntityRequest - 11, // 28: entity.EntityStoreAdmin.AdminWrite:input_type -> entity.AdminWriteEntityRequest - 7, // 29: entity.EntityStore.Read:output_type -> entity.ReadEntityResponse - 9, // 30: entity.EntityStore.BatchRead:output_type -> entity.BatchReadEntityResponse - 12, // 31: entity.EntityStore.Write:output_type -> entity.WriteEntityResponse - 14, // 32: entity.EntityStore.Delete:output_type -> entity.DeleteEntityResponse - 16, // 33: entity.EntityStore.History:output_type -> entity.EntityHistoryResponse - 19, // 34: entity.EntityStore.Search:output_type -> entity.EntitySearchResponse - 12, // 35: entity.EntityStore.AdminWrite:output_type -> entity.WriteEntityResponse - 12, // 36: entity.EntityStoreAdmin.AdminWrite:output_type -> entity.WriteEntityResponse - 29, // [29:37] is the sub-list for method output_type - 21, // [21:29] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 6, // 3: entity.BatchReadEntityRequest.batch:type_name -> entity.ReadEntityRequest + 2, // 4: entity.BatchReadEntityResponse.results:type_name -> entity.Entity + 1, // 5: entity.WriteEntityRequest.GRN:type_name -> entity.GRN + 1, // 6: entity.AdminWriteEntityRequest.GRN:type_name -> entity.GRN + 3, // 7: entity.AdminWriteEntityRequest.origin:type_name -> entity.EntityOriginInfo + 4, // 8: entity.WriteEntityResponse.error:type_name -> entity.EntityErrorInfo + 1, // 9: entity.WriteEntityResponse.GRN:type_name -> entity.GRN + 5, // 10: entity.WriteEntityResponse.entity:type_name -> entity.EntityVersionInfo + 0, // 11: entity.WriteEntityResponse.status:type_name -> entity.WriteEntityResponse.Status + 1, // 12: entity.DeleteEntityRequest.GRN:type_name -> entity.GRN + 1, // 13: entity.EntityHistoryRequest.GRN:type_name -> entity.GRN + 1, // 14: entity.EntityHistoryResponse.GRN:type_name -> entity.GRN + 5, // 15: entity.EntityHistoryResponse.versions:type_name -> entity.EntityVersionInfo + 19, // 16: entity.EntitySearchRequest.labels:type_name -> entity.EntitySearchRequest.LabelsEntry + 1, // 17: entity.EntitySearchResult.GRN:type_name -> entity.GRN + 20, // 18: entity.EntitySearchResult.labels:type_name -> entity.EntitySearchResult.LabelsEntry + 17, // 19: entity.EntitySearchResponse.results:type_name -> entity.EntitySearchResult + 6, // 20: entity.EntityStore.Read:input_type -> entity.ReadEntityRequest + 7, // 21: entity.EntityStore.BatchRead:input_type -> entity.BatchReadEntityRequest + 9, // 22: entity.EntityStore.Write:input_type -> entity.WriteEntityRequest + 12, // 23: entity.EntityStore.Delete:input_type -> entity.DeleteEntityRequest + 14, // 24: entity.EntityStore.History:input_type -> entity.EntityHistoryRequest + 16, // 25: entity.EntityStore.Search:input_type -> entity.EntitySearchRequest + 10, // 26: entity.EntityStore.AdminWrite:input_type -> entity.AdminWriteEntityRequest + 10, // 27: entity.EntityStoreAdmin.AdminWrite:input_type -> entity.AdminWriteEntityRequest + 2, // 28: entity.EntityStore.Read:output_type -> entity.Entity + 8, // 29: entity.EntityStore.BatchRead:output_type -> entity.BatchReadEntityResponse + 11, // 30: entity.EntityStore.Write:output_type -> entity.WriteEntityResponse + 13, // 31: entity.EntityStore.Delete:output_type -> entity.DeleteEntityResponse + 15, // 32: entity.EntityStore.History:output_type -> entity.EntityHistoryResponse + 18, // 33: entity.EntityStore.Search:output_type -> entity.EntitySearchResponse + 11, // 34: entity.EntityStore.AdminWrite:output_type -> entity.WriteEntityResponse + 11, // 35: entity.EntityStoreAdmin.AdminWrite:output_type -> entity.WriteEntityResponse + 28, // [28:36] is the sub-list for method output_type + 20, // [20:28] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_entity_proto_init() } @@ -2073,18 +1996,6 @@ func file_entity_proto_init() { } } file_entity_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadEntityResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchReadEntityRequest); i { case 0: return &v.state @@ -2096,7 +2007,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchReadEntityResponse); i { case 0: return &v.state @@ -2108,7 +2019,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WriteEntityRequest); i { case 0: return &v.state @@ -2120,7 +2031,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AdminWriteEntityRequest); i { case 0: return &v.state @@ -2132,7 +2043,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WriteEntityResponse); i { case 0: return &v.state @@ -2144,7 +2055,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteEntityRequest); i { case 0: return &v.state @@ -2156,7 +2067,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteEntityResponse); i { case 0: return &v.state @@ -2168,7 +2079,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityHistoryRequest); i { case 0: return &v.state @@ -2180,7 +2091,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityHistoryResponse); i { case 0: return &v.state @@ -2192,7 +2103,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntitySearchRequest); i { case 0: return &v.state @@ -2204,7 +2115,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntitySearchResult); i { case 0: return &v.state @@ -2216,7 +2127,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_entity_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntitySearchResponse); i { case 0: return &v.state @@ -2235,7 +2146,7 @@ func file_entity_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_entity_proto_rawDesc, NumEnums: 1, - NumMessages: 21, + NumMessages: 20, NumExtensions: 0, NumServices: 2, }, diff --git a/pkg/services/store/entity/entity.proto b/pkg/services/store/entity/entity.proto index b0b57d4e1cd..7aca2697e48 100644 --- a/pkg/services/store/entity/entity.proto +++ b/pkg/services/store/entity/entity.proto @@ -21,47 +21,43 @@ message Entity { // Entity identifier GRN GRN = 1; + // The version will change when the entity is saved. It is not necessarily sortable + string version = 2; + // Time in epoch milliseconds that the entity was created - int64 created_at = 2; + int64 created_at = 3; // Time in epoch milliseconds that the entity was updated - int64 updated_at = 3; + int64 updated_at = 4; // Who created the entity - string created_by = 4; + string created_by = 5; // Who updated the entity - string updated_by = 5; + string updated_by = 6; // Content Length - int64 size = 6; + int64 size = 7; // MD5 digest of the body - string ETag = 7; + string ETag = 8; // Raw bytes of the storage entity. The kind will determine what is a valid payload - bytes body = 8; + bytes body = 9; - // Folder UID - string folder = 9; - - // Unique slug within folder (may be UID) - string slug = 10; - - // The version will change when the entity is saved. It is not necessarily sortable - // - // NOTE: currently managed by the dashboard+dashboard_version tables - string version = 11; + // Entity summary as JSON + bytes summary_json = 10; // External location info - EntityOriginInfo origin = 12; + EntityOriginInfo origin = 11; } +// This stores additional metadata for items entities that were synced from external systmes message EntityOriginInfo { - // NOTE: currently managed by the dashboard_provisioning table + // identify the external source (plugin, git instance, etc) string source = 1; - // Key in the upstream system + // Key in the upstream system (git hash, file path, etc) string key = 2; // Time in epoch milliseconds that the entity was last synced with an external system (provisioning/git) @@ -122,14 +118,6 @@ message ReadEntityRequest { bool with_summary = 4; } -message ReadEntityResponse { - // Entity details with the body removed - Entity entity = 1; - - // Entity summary as JSON - bytes summary_json = 2; -} - //------------------------------------------------------ // Make many read requests at once (by Kind+ID+version) //------------------------------------------------------ @@ -139,7 +127,7 @@ message BatchReadEntityRequest { } message BatchReadEntityResponse { - repeated ReadEntityResponse results = 1; + repeated Entity results = 1; } //----------------------------------------------- @@ -375,7 +363,7 @@ message EntitySearchResponse { // The entity store provides a basic CRUD (+watch eventually) interface for generic entitys service EntityStore { - rpc Read(ReadEntityRequest) returns (ReadEntityResponse); + rpc Read(ReadEntityRequest) returns (Entity); rpc BatchRead(BatchReadEntityRequest) returns (BatchReadEntityResponse); rpc Write(WriteEntityRequest) returns (WriteEntityResponse); rpc Delete(DeleteEntityRequest) returns (DeleteEntityResponse); diff --git a/pkg/services/store/entity/entity_grpc.pb.go b/pkg/services/store/entity/entity_grpc.pb.go index acc7cc694f8..35066972f8f 100644 --- a/pkg/services/store/entity/entity_grpc.pb.go +++ b/pkg/services/store/entity/entity_grpc.pb.go @@ -22,7 +22,7 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type EntityStoreClient interface { - Read(ctx context.Context, in *ReadEntityRequest, opts ...grpc.CallOption) (*ReadEntityResponse, error) + Read(ctx context.Context, in *ReadEntityRequest, opts ...grpc.CallOption) (*Entity, error) BatchRead(ctx context.Context, in *BatchReadEntityRequest, opts ...grpc.CallOption) (*BatchReadEntityResponse, error) Write(ctx context.Context, in *WriteEntityRequest, opts ...grpc.CallOption) (*WriteEntityResponse, error) Delete(ctx context.Context, in *DeleteEntityRequest, opts ...grpc.CallOption) (*DeleteEntityResponse, error) @@ -40,8 +40,8 @@ func NewEntityStoreClient(cc grpc.ClientConnInterface) EntityStoreClient { return &entityStoreClient{cc} } -func (c *entityStoreClient) Read(ctx context.Context, in *ReadEntityRequest, opts ...grpc.CallOption) (*ReadEntityResponse, error) { - out := new(ReadEntityResponse) +func (c *entityStoreClient) Read(ctx context.Context, in *ReadEntityRequest, opts ...grpc.CallOption) (*Entity, error) { + out := new(Entity) err := c.cc.Invoke(ctx, "/entity.EntityStore/Read", in, out, opts...) if err != nil { return nil, err @@ -107,7 +107,7 @@ func (c *entityStoreClient) AdminWrite(ctx context.Context, in *AdminWriteEntity // All implementations should embed UnimplementedEntityStoreServer // for forward compatibility type EntityStoreServer interface { - Read(context.Context, *ReadEntityRequest) (*ReadEntityResponse, error) + Read(context.Context, *ReadEntityRequest) (*Entity, error) BatchRead(context.Context, *BatchReadEntityRequest) (*BatchReadEntityResponse, error) Write(context.Context, *WriteEntityRequest) (*WriteEntityResponse, error) Delete(context.Context, *DeleteEntityRequest) (*DeleteEntityResponse, error) @@ -121,7 +121,7 @@ type EntityStoreServer interface { type UnimplementedEntityStoreServer struct { } -func (UnimplementedEntityStoreServer) Read(context.Context, *ReadEntityRequest) (*ReadEntityResponse, error) { +func (UnimplementedEntityStoreServer) Read(context.Context, *ReadEntityRequest) (*Entity, error) { return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") } func (UnimplementedEntityStoreServer) BatchRead(context.Context, *BatchReadEntityRequest) (*BatchReadEntityResponse, error) { diff --git a/pkg/services/store/entity/httpentitystore/service.go b/pkg/services/store/entity/httpentitystore/service.go index 4897241ddb4..786c8a28bfd 100644 --- a/pkg/services/store/entity/httpentitystore/service.go +++ b/pkg/services/store/entity/httpentitystore/service.go @@ -90,17 +90,17 @@ func (s *httpEntityStore) doGetEntity(c *models.ReqContext) response.Response { if err != nil { return response.Error(500, "error fetching entity", err) } - if rsp.Entity == nil { + if rsp == nil { return response.Error(404, "not found", nil) } // Configure etag support - currentEtag := rsp.Entity.ETag + currentEtag := rsp.ETag previousEtag := c.Req.Header.Get("If-None-Match") if previousEtag == currentEtag { return response.CreateNormalResponse( http.Header{ - "ETag": []string{rsp.Entity.ETag}, + "ETag": []string{rsp.ETag}, }, []byte{}, // nothing http.StatusNotModified, // 304 @@ -130,14 +130,14 @@ func (s *httpEntityStore) doGetRawEntity(c *models.ReqContext) response.Response return response.Error(400, "Unsupported kind", err) } - if rsp.Entity != nil && rsp.Entity.Body != nil { + if rsp != nil && rsp.Body != nil { // Configure etag support - currentEtag := rsp.Entity.ETag + currentEtag := rsp.ETag previousEtag := c.Req.Header.Get("If-None-Match") if previousEtag == currentEtag { return response.CreateNormalResponse( http.Header{ - "ETag": []string{rsp.Entity.ETag}, + "ETag": []string{rsp.ETag}, }, []byte{}, // nothing http.StatusNotModified, // 304 @@ -152,7 +152,7 @@ func (s *httpEntityStore) doGetRawEntity(c *models.ReqContext) response.Response "Content-Type": []string{mime}, "ETag": []string{currentEtag}, }, - rsp.Entity.Body, + rsp.Body, 200, ) } @@ -279,7 +279,7 @@ func (s *httpEntityStore) doUpload(c *models.ReqContext) response.Response { if err != nil { return response.Error(500, "Internal Server Error", err) } - if result.Entity != nil { + if result.GRN != nil { return response.Error(400, "File name already in use", err) } } diff --git a/pkg/services/store/entity/json.go b/pkg/services/store/entity/json.go index 34933e7dec9..ee867f1c9f9 100644 --- a/pkg/services/store/entity/json.go +++ b/pkg/services/store/entity/json.go @@ -12,7 +12,6 @@ import ( func init() { //nolint:gochecknoinits jsoniter.RegisterTypeEncoder("entity.EntitySearchResult", &searchResultCodec{}) jsoniter.RegisterTypeEncoder("entity.WriteEntityResponse", &writeResponseCodec{}) - jsoniter.RegisterTypeEncoder("entity.ReadEntityResponse", &readResponseCodec{}) jsoniter.RegisterTypeEncoder("entity.Entity", &rawEntityCodec{}) jsoniter.RegisterTypeDecoder("entity.Entity", &rawEntityCodec{}) @@ -91,33 +90,26 @@ func (codec *rawEntityCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) stream.WriteString(sEnc) // works for strings } } + if len(obj.SummaryJson) > 0 { + stream.WriteMore() + stream.WriteObjectField("summary") + writeRawJson(stream, obj.SummaryJson) + } if obj.ETag != "" { stream.WriteMore() stream.WriteObjectField("etag") stream.WriteString(obj.ETag) } - if obj.Folder != "" { - stream.WriteMore() - stream.WriteObjectField("folder") - stream.WriteString(obj.Folder) - } - if obj.Slug != "" { - stream.WriteMore() - stream.WriteObjectField("slug") - stream.WriteString(obj.Slug) - } if obj.Size > 0 { stream.WriteMore() stream.WriteObjectField("size") stream.WriteInt64(obj.Size) } - if obj.Origin != nil { stream.WriteMore() stream.WriteObjectField("origin") stream.WriteVal(obj.Origin) } - stream.WriteObjectEnd() } @@ -145,15 +137,20 @@ func readEntity(iter *jsoniter.Iterator, raw *Entity) { raw.Size = iter.ReadInt64() case "etag": raw.ETag = iter.ReadString() - case "folder": - raw.Folder = iter.ReadString() - case "slug": - raw.Slug = iter.ReadString() case "version": raw.Version = iter.ReadString() case "origin": raw.Origin = &EntityOriginInfo{} iter.ReadVal(raw.Origin) + case "summary": + var val interface{} + iter.ReadVal(&val) // ??? is there a smarter way to just keep the underlying bytes without read+marshal + body, err := json.Marshal(val) + if err != nil { + iter.ReportError("raw entity", "error reading summary body") + return + } + raw.SummaryJson = body case "body": var val interface{} @@ -181,34 +178,6 @@ func readEntity(iter *jsoniter.Iterator, raw *Entity) { } } -// Unlike the standard JSON marshal, this will write bytes as JSON when it can -type readResponseCodec struct{} - -func (obj *ReadEntityResponse) MarshalJSON() ([]byte, error) { - var json = jsoniter.ConfigCompatibleWithStandardLibrary - return json.Marshal(obj) -} - -func (codec *readResponseCodec) IsEmpty(ptr unsafe.Pointer) bool { - f := (*ReadEntityResponse)(ptr) - return f == nil -} - -func (codec *readResponseCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) { - obj := (*ReadEntityResponse)(ptr) - stream.WriteObjectStart() - stream.WriteObjectField("entity") - stream.WriteVal(obj.Entity) - - if len(obj.SummaryJson) > 0 { - stream.WriteMore() - stream.WriteObjectField("summary") - writeRawJson(stream, obj.SummaryJson) - } - - stream.WriteObjectEnd() -} - // Unlike the standard JSON marshal, this will write bytes as JSON when it can type searchResultCodec struct{} diff --git a/pkg/services/store/entity/sqlstash/sql_storage_server.go b/pkg/services/store/entity/sqlstash/sql_storage_server.go index 9b88660c3a1..022dd9eb938 100644 --- a/pkg/services/store/entity/sqlstash/sql_storage_server.go +++ b/pkg/services/store/entity/sqlstash/sql_storage_server.go @@ -46,8 +46,7 @@ type sqlEntityServer struct { func getReadSelect(r *entity.ReadEntityRequest) string { fields := []string{ "tenant_id", "kind", "uid", // The PK - "version", "slug", "folder", - "size", "etag", "errors", // errors are always returned + "version", "size", "etag", "errors", // errors are always returned "created_at", "created_by", "updated_at", "updated_by", "origin", "origin_key", "origin_ts"} @@ -56,23 +55,21 @@ func getReadSelect(r *entity.ReadEntityRequest) string { fields = append(fields, `body`) } if r.WithSummary { - fields = append(fields, `name`, `description`, `labels`, `fields`) + fields = append(fields, "name", "slug", "folder", "description", "labels", "fields") } return "SELECT " + strings.Join(fields, ",") + " FROM entity WHERE " } -func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql.Rows, r *entity.ReadEntityRequest) (*entity.ReadEntityResponse, error) { +func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql.Rows, r *entity.ReadEntityRequest) (*entity.Entity, error) { raw := &entity.Entity{ GRN: &entity.GRN{}, Origin: &entity.EntityOriginInfo{}, } - slug := "" summaryjson := &summarySupport{} args := []interface{}{ &raw.GRN.TenantId, &raw.GRN.Kind, &raw.GRN.UID, - &raw.Version, &slug, &raw.Folder, - &raw.Size, &raw.ETag, &summaryjson.errors, + &raw.Version, &raw.Size, &raw.ETag, &summaryjson.errors, &raw.CreatedAt, &raw.CreatedBy, &raw.UpdatedAt, &raw.UpdatedBy, &raw.Origin.Source, &raw.Origin.Key, &raw.Origin.Time, @@ -81,7 +78,7 @@ func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql args = append(args, &raw.Body) } if r.WithSummary { - args = append(args, &summaryjson.name, &summaryjson.description, &summaryjson.labels, &summaryjson.fields) + args = append(args, &summaryjson.name, &summaryjson.slug, &summaryjson.folder, &summaryjson.description, &summaryjson.labels, &summaryjson.fields) } err := rows.Scan(args...) @@ -93,10 +90,6 @@ func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql raw.Origin = nil } - rsp := &entity.ReadEntityResponse{ - Entity: raw, - } - if r.WithSummary || summaryjson.errors != nil { summary, err := summaryjson.toEntitySummary() if err != nil { @@ -107,9 +100,9 @@ func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql if err != nil { return nil, err } - rsp.SummaryJson = js + raw.SummaryJson = js } - return rsp, nil + return raw, nil } func (s *sqlEntityServer) validateGRN(ctx context.Context, grn *entity.GRN) (*entity.GRN, error) { @@ -138,7 +131,7 @@ func (s *sqlEntityServer) validateGRN(ctx context.Context, grn *entity.GRN) (*en return grn, nil } -func (s *sqlEntityServer) Read(ctx context.Context, r *entity.ReadEntityRequest) (*entity.ReadEntityResponse, error) { +func (s *sqlEntityServer) Read(ctx context.Context, r *entity.ReadEntityRequest) (*entity.Entity, error) { if r.Version != "" { return s.readFromHistory(ctx, r) } @@ -157,13 +150,13 @@ func (s *sqlEntityServer) Read(ctx context.Context, r *entity.ReadEntityRequest) defer func() { _ = rows.Close() }() if !rows.Next() { - return &entity.ReadEntityResponse{}, nil + return &entity.Entity{}, nil } return s.rowToReadEntityResponse(ctx, rows, r) } -func (s *sqlEntityServer) readFromHistory(ctx context.Context, r *entity.ReadEntityRequest) (*entity.ReadEntityResponse, error) { +func (s *sqlEntityServer) readFromHistory(ctx context.Context, r *entity.ReadEntityRequest) (*entity.Entity, error) { grn, err := s.validateGRN(ctx, r.GRN) if err != nil { return nil, err @@ -185,15 +178,12 @@ func (s *sqlEntityServer) readFromHistory(ctx context.Context, r *entity.ReadEnt // Version or key not found if !rows.Next() { - return &entity.ReadEntityResponse{}, nil + return &entity.Entity{}, nil } raw := &entity.Entity{ GRN: r.GRN, } - rsp := &entity.ReadEntityResponse{ - Entity: raw, - } err = rows.Scan(&raw.Body, &raw.Size, &raw.ETag, &raw.UpdatedAt, &raw.UpdatedBy) if err != nil { return nil, err @@ -210,7 +200,7 @@ func (s *sqlEntityServer) readFromHistory(ctx context.Context, r *entity.ReadEnt val, out, err := builder(ctx, r.GRN.UID, raw.Body) if err == nil { raw.Body = out // cleaned up - rsp.SummaryJson, err = json.Marshal(val) + raw.SummaryJson, err = json.Marshal(val) if err != nil { return nil, err } @@ -220,10 +210,10 @@ func (s *sqlEntityServer) readFromHistory(ctx context.Context, r *entity.ReadEnt // Clear the body if not requested if !r.WithBody { - rsp.Entity.Body = nil + raw.Body = nil } - return rsp, err + return raw, err } func (s *sqlEntityServer) BatchRead(ctx context.Context, b *entity.BatchReadEntityRequest) (*entity.BatchReadEntityResponse, error) { @@ -306,12 +296,6 @@ func (s *sqlEntityServer) AdminWrite(ctx context.Context, r *entity.AdminWriteEn return nil, err } - t := summary.name - if t == "" { - t = r.GRN.UID - } - - slug := slugify.Slugify(t) etag := createContentsHash(body) rsp := &entity.WriteEntityResponse{ GRN: grn, @@ -479,8 +463,8 @@ func (s *sqlEntityServer) AdminWrite(ctx context.Context, r *entity.AdminWriteEn " ?, ?, ?)", oid, grn.TenantId, grn.Kind, grn.UID, r.Folder, versionInfo.Size, body, etag, versionInfo.Version, - updatedAt, createdBy, createdAt, createdBy, // created + updated are the same - summary.model.Name, summary.model.Description, slug, + updatedAt, createdBy, createdAt, createdBy, + summary.model.Name, summary.model.Description, summary.model.Slug, summary.labels, summary.fields, summary.errors, origin.Source, origin.Key, origin.Time, ) @@ -550,6 +534,16 @@ func (s *sqlEntityServer) prepare(ctx context.Context, r *entity.AdminWriteEntit if err != nil { return nil, nil, err } + + // Update a summary based on the name (unless the root suggested one) + if summary.Slug == "" { + t := summary.Name + if t == "" { + t = r.GRN.UID + } + summary.Slug = slugify.Slugify(t) + } + return summaryjson, body, nil } diff --git a/pkg/services/store/entity/sqlstash/summary_handler.go b/pkg/services/store/entity/sqlstash/summary_handler.go index fa8aaa84e64..2519968f31e 100644 --- a/pkg/services/store/entity/sqlstash/summary_handler.go +++ b/pkg/services/store/entity/sqlstash/summary_handler.go @@ -10,6 +10,8 @@ type summarySupport struct { model *models.EntitySummary name string description *string // null or empty + slug *string // null or empty + folder *string // null or empty labels *string fields *string errors *string // should not allow saving with this! @@ -32,7 +34,12 @@ func newSummarySupport(summary *models.EntitySummary) (*summarySupport, error) { if summary.Description != "" { s.description = &summary.Description } - + if summary.Slug != "" { + s.slug = &summary.Slug + } + if summary.Folder != "" { + s.folder = &summary.Folder + } if len(summary.Labels) > 0 { js, err = json.Marshal(summary.Labels) if err != nil { @@ -71,6 +78,12 @@ func (s summarySupport) toEntitySummary() (*models.EntitySummary, error) { if s.description != nil { summary.Description = *s.description } + if s.slug != nil { + summary.Slug = *s.slug + } + if s.folder != nil { + summary.Folder = *s.folder + } if s.labels != nil { b := []byte(*s.labels) err = json.Unmarshal(b, &summary.Labels) diff --git a/pkg/services/store/entity/tests/server_integration_test.go b/pkg/services/store/entity/tests/server_integration_test.go index 4d6f689a44c..17f45487399 100644 --- a/pkg/services/store/entity/tests/server_integration_test.go +++ b/pkg/services/store/entity/tests/server_integration_test.go @@ -134,7 +134,7 @@ func TestIntegrationEntityServer(t *testing.T) { require.NoError(t, err) require.NotNil(t, resp) - require.Nil(t, resp.Entity) + require.Nil(t, resp.GRN) }) t.Run("should be able to read persisted objects", func(t *testing.T) { @@ -162,9 +162,9 @@ func TestIntegrationEntityServer(t *testing.T) { }) require.NoError(t, err) require.Nil(t, readResp.SummaryJson) - require.NotNil(t, readResp.Entity) + require.NotNil(t, readResp) - foundGRN := readResp.Entity.GRN + foundGRN := readResp.GRN require.NotNil(t, foundGRN) require.Equal(t, testCtx.user.OrgID, foundGRN.TenantId) // orgId becomes the tenant id when not set require.Equal(t, grn.Kind, foundGRN.Kind) @@ -179,7 +179,7 @@ func TestIntegrationEntityServer(t *testing.T) { body: body, version: &firstVersion, } - requireEntityMatch(t, readResp.Entity, objectMatcher) + requireEntityMatch(t, readResp, objectMatcher) deleteResp, err := testCtx.client.Delete(ctx, &entity.DeleteEntityRequest{ GRN: grn, @@ -194,7 +194,7 @@ func TestIntegrationEntityServer(t *testing.T) { WithBody: true, }) require.NoError(t, err) - require.Nil(t, readRespAfterDelete.Entity) + require.Nil(t, readRespAfterDelete.GRN) }) t.Run("should be able to update an object", func(t *testing.T) { @@ -258,7 +258,7 @@ func TestIntegrationEntityServer(t *testing.T) { }) require.NoError(t, err) require.Nil(t, readRespLatest.SummaryJson) - requireEntityMatch(t, readRespLatest.Entity, latestMatcher) + requireEntityMatch(t, readRespLatest, latestMatcher) readRespFirstVer, err := testCtx.client.Read(ctx, &entity.ReadEntityRequest{ GRN: grn, @@ -268,8 +268,8 @@ func TestIntegrationEntityServer(t *testing.T) { require.NoError(t, err) require.Nil(t, readRespFirstVer.SummaryJson) - require.NotNil(t, readRespFirstVer.Entity) - requireEntityMatch(t, readRespFirstVer.Entity, rawEntityMatcher{ + require.NotNil(t, readRespFirstVer) + requireEntityMatch(t, readRespFirstVer, rawEntityMatcher{ grn: grn, createdRange: []time.Time{before, time.Now()}, updatedRange: []time.Time{before, time.Now()},