From 609abf00d1c6bd065f163e06882aa2f09dc0fcb5 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Thu, 6 Oct 2022 12:48:53 -0700 Subject: [PATCH] ObjectStore: Write json as json when possible (#56433) --- .../src/types/featureToggles.gen.ts | 1 + pkg/services/featuremgmt/registry.go | 9 +- pkg/services/featuremgmt/toggles_gen.go | 4 + .../store/object/dummy/dummy_server.go | 83 ++- .../store/object/dummy/dummy_server_test.go | 69 ++ pkg/services/store/object/http.go | 19 +- pkg/services/store/object/json.go | 312 ++++++++ pkg/services/store/object/json_test.go | 34 + pkg/services/store/object/kind.go | 52 ++ pkg/services/store/object/object.pb.go | 671 ++++++++++-------- pkg/services/store/object/object.proto | 17 +- 11 files changed, 918 insertions(+), 353 deletions(-) create mode 100644 pkg/services/store/object/dummy/dummy_server_test.go create mode 100644 pkg/services/store/object/json.go create mode 100644 pkg/services/store/object/json_test.go diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 8fa95143f28..f3190f85ecc 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -66,6 +66,7 @@ export interface FeatureToggles { internationalization?: boolean; topnav?: boolean; grpcServer?: boolean; + objectStore?: boolean; traceqlEditor?: boolean; redshiftAsyncQueryDataSupport?: boolean; athenaAsyncQueryDataSupport?: boolean; diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index a2a8ec46fc3..d8d5b1d1de8 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -277,7 +277,14 @@ var ( Description: "Run GRPC server", State: FeatureStateAlpha, RequiresDevMode: true, - }, { + }, + { + Name: "objectStore", + Description: "SQL based object store", + State: FeatureStateAlpha, + RequiresDevMode: true, + }, + { Name: "traceqlEditor", Description: "Show the TraceQL editor in the explore page", State: FeatureStateAlpha, diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 8ba975cc32b..94bcdfc632b 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -207,6 +207,10 @@ const ( // Run GRPC server FlagGrpcServer = "grpcServer" + // FlagObjectStore + // SQL based object store + FlagObjectStore = "objectStore" + // FlagTraceqlEditor // Show the TraceQL editor in the explore page FlagTraceqlEditor = "traceqlEditor" diff --git a/pkg/services/store/object/dummy/dummy_server.go b/pkg/services/store/object/dummy/dummy_server.go index 41eb8bbe23a..db5defe53eb 100644 --- a/pkg/services/store/object/dummy/dummy_server.go +++ b/pkg/services/store/object/dummy/dummy_server.go @@ -4,6 +4,7 @@ import ( "context" "crypto/md5" "encoding/hex" + "encoding/json" "errors" "fmt" "strconv" @@ -23,13 +24,14 @@ type ObjectVersionWithBody struct { } type RawObjectWithHistory struct { - *object.RawObject `json:"rawObject,omitempty"` - History []*ObjectVersionWithBody `json:"history,omitempty"` + Object *object.RawObject `json:"object,omitempty"` + Summary *object.ObjectSummary `json:"summary,omitempty"` + History []*ObjectVersionWithBody `json:"history,omitempty"` } var ( // increment when RawObject changes - rawObjectVersion = 3 + rawObjectVersion = 6 ) func ProvideDummyObjectServer(cfg *setting.Cfg, grpcServerProvider grpcserver.Provider) object.ObjectStoreServer { @@ -57,7 +59,7 @@ func (i dummyObjectServer) findObject(ctx context.Context, uid string, kind stri } obj, err := i.collection.FindFirst(ctx, namespaceFromUID(uid), func(i *RawObjectWithHistory) (bool, error) { - return i.UID == uid && i.Kind == kind, nil + return i.Object.UID == uid && i.Object.Kind == kind, nil }) if err != nil { @@ -70,16 +72,16 @@ func (i dummyObjectServer) findObject(ctx context.Context, uid string, kind stri getLatestVersion := version == "" if getLatestVersion { - return obj, obj.RawObject, nil + return obj, obj.Object, nil } for _, objVersion := range obj.History { if objVersion.Version == version { copy := &object.RawObject{ - UID: obj.UID, - Kind: obj.Kind, - Created: obj.Created, - CreatedBy: obj.CreatedBy, + UID: obj.Object.UID, + Kind: obj.Object.Kind, + Created: obj.Object.Created, + CreatedBy: obj.Object.CreatedBy, Updated: objVersion.Updated, UpdatedBy: objVersion.UpdatedBy, ETag: objVersion.ETag, @@ -109,10 +111,21 @@ func (i dummyObjectServer) Read(ctx context.Context, r *object.ReadObjectRequest }, nil } - return &object.ReadObjectResponse{ - Object: objVersion, - SummaryJson: nil, - }, nil + rsp := &object.ReadObjectResponse{ + Object: objVersion, + } + if r.WithSummary { + summary, _, e2 := object.GetSafeSaveObject(&object.WriteObjectRequest{ + UID: r.UID, + Kind: r.Kind, + Body: objVersion.Body, + }) + if e2 != nil { + return nil, e2 + } + rsp.SummaryJson, err = json.Marshal(summary) + } + return rsp, err } func (i dummyObjectServer) BatchRead(ctx context.Context, batchR *object.BatchReadObjectRequest) (*object.BatchReadObjectResponse, error) { @@ -137,16 +150,16 @@ func (i dummyObjectServer) update(ctx context.Context, r *object.WriteObjectRequ rsp := &object.WriteObjectResponse{} updatedCount, err := i.collection.Update(ctx, namespace, func(i *RawObjectWithHistory) (bool, *RawObjectWithHistory, error) { - match := i.UID == r.UID && i.Kind == r.Kind + match := i.Object.UID == r.UID && i.Object.Kind == r.Kind if !match { return false, nil, nil } - if r.PreviousVersion != "" && i.Version != r.PreviousVersion { - return false, nil, fmt.Errorf("expected the previous version to be %s, but was %s", r.PreviousVersion, i.Version) + if r.PreviousVersion != "" && i.Object.Version != r.PreviousVersion { + return false, nil, fmt.Errorf("expected the previous version to be %s, but was %s", r.PreviousVersion, i.Object.Version) } - prevVersion, err := strconv.Atoi(i.Version) + prevVersion, err := strconv.Atoi(i.Object.Version) if err != nil { return false, nil, err } @@ -156,8 +169,8 @@ func (i dummyObjectServer) update(ctx context.Context, r *object.WriteObjectRequ updated := &object.RawObject{ UID: r.UID, Kind: r.Kind, - Created: i.Created, - CreatedBy: i.CreatedBy, + Created: i.Object.Created, + CreatedBy: i.Object.CreatedBy, Updated: time.Now().Unix(), UpdatedBy: object.GetUserIDString(modifier), Size: int64(len(r.Body)), @@ -181,15 +194,15 @@ func (i dummyObjectServer) update(ctx context.Context, r *object.WriteObjectRequ rsp.Status = object.WriteObjectResponse_UPDATED // When saving, it must be different than the head version - if i.ETag == updated.ETag { - versionInfo.ObjectVersionInfo.Version = i.Version + if i.Object.ETag == updated.ETag { + versionInfo.ObjectVersionInfo.Version = i.Object.Version rsp.Status = object.WriteObjectResponse_UNCHANGED return false, nil, nil } return true, &RawObjectWithHistory{ - RawObject: updated, - History: append(i.History, versionInfo), + Object: updated, + History: append(i.History, versionInfo), }, nil }) @@ -229,7 +242,7 @@ func (i dummyObjectServer) insert(ctx context.Context, r *object.WriteObjectRequ } newObj := &RawObjectWithHistory{ - RawObject: rawObj, + Object: rawObj, History: []*ObjectVersionWithBody{{ ObjectVersionInfo: info, Body: r.Body, @@ -254,7 +267,7 @@ func (i dummyObjectServer) Write(ctx context.Context, r *object.WriteObjectReque if i == nil || r == nil { return false, nil } - return i.UID == r.UID, nil + return i.Object.UID == r.UID, nil }) if err != nil { return nil, err @@ -269,10 +282,10 @@ func (i dummyObjectServer) Write(ctx context.Context, r *object.WriteObjectReque func (i dummyObjectServer) Delete(ctx context.Context, r *object.DeleteObjectRequest) (*object.DeleteObjectResponse, error) { _, err := i.collection.Delete(ctx, namespaceFromUID(r.UID), func(i *RawObjectWithHistory) (bool, error) { - match := i.UID == r.UID && i.Kind == r.Kind + match := i.Object.UID == r.UID && i.Object.Kind == r.Kind if match { - if r.PreviousVersion != "" && i.Version != r.PreviousVersion { - return false, fmt.Errorf("expected the previous version to be %s, but was %s", r.PreviousVersion, i.Version) + if r.PreviousVersion != "" && i.Object.Version != r.PreviousVersion { + return false, fmt.Errorf("expected the previous version to be %s, but was %s", r.PreviousVersion, i.Object.Version) } return true, nil @@ -319,7 +332,7 @@ func (i dummyObjectServer) Search(ctx context.Context, r *object.ObjectSearchReq // TODO more filters objects, err := i.collection.Find(ctx, namespaceFromUID("TODO"), func(i *RawObjectWithHistory) (bool, error) { if len(r.Kind) != 0 { - if _, ok := kindMap[i.Kind]; !ok { + if _, ok := kindMap[i.Object.Kind]; !ok { return false, nil } } @@ -332,13 +345,13 @@ func (i dummyObjectServer) Search(ctx context.Context, r *object.ObjectSearchReq searchResults := make([]*object.ObjectSearchResult, 0) for _, o := range objects { searchResults = append(searchResults, &object.ObjectSearchResult{ - UID: o.UID, - Kind: o.Kind, - Version: o.Version, - Updated: o.Updated, - UpdatedBy: o.UpdatedBy, + UID: o.Object.UID, + Kind: o.Object.Kind, + Version: o.Object.Version, + Updated: o.Object.Updated, + UpdatedBy: o.Object.UpdatedBy, Name: "? name from summary", - Body: o.Body, + Body: o.Object.Body, }) } diff --git a/pkg/services/store/object/dummy/dummy_server_test.go b/pkg/services/store/object/dummy/dummy_server_test.go new file mode 100644 index 00000000000..23ffe51ba7c --- /dev/null +++ b/pkg/services/store/object/dummy/dummy_server_test.go @@ -0,0 +1,69 @@ +package objectdummyserver + +import ( + "encoding/json" + "fmt" + "testing" + + "github.com/grafana/grafana/pkg/services/store/object" + "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 := &ObjectVersionWithBody{ + &object.ObjectVersionInfo{ + 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 := &ObjectVersionWithBody{} + err = json.Unmarshal(b, copy) + require.NoError(t, err) +} + +func TestRawObjectWithHistory(t *testing.T) { + body, err := json.Marshal(map[string]interface{}{ + "hello": "world", + "field": 1.23, + }) + require.NoError(t, err) + + raw := &RawObjectWithHistory{ + Object: &object.RawObject{ + Version: "A", + Body: body, + }, + History: make([]*ObjectVersionWithBody, 0), + } + raw.History = append(raw.History, &ObjectVersionWithBody{ + &object.ObjectVersionInfo{ + Version: "B", + }, + body, + }) + + b, err := json.Marshal(raw) + require.NoError(t, err) + + str := string(b) + fmt.Printf("expect: %s", str) + require.JSONEq(t, `{"object":{"UID":"","version":"A","body":{"field":1.23,"hello":"world"}},"history":[{"info":{"version":"B"},"body":"eyJmaWVsZCI6MS4yMywiaGVsbG8iOiJ3b3JsZCJ9"}]}`, str) + + copy := &ObjectVersionWithBody{} + err = json.Unmarshal(b, copy) + require.NoError(t, err) +} diff --git a/pkg/services/store/object/http.go b/pkg/services/store/object/http.go index c53d99031fd..945f7d6d5ec 100644 --- a/pkg/services/store/object/http.go +++ b/pkg/services/store/object/http.go @@ -76,9 +76,9 @@ func (s *httpObjectStore) doGetObject(c *models.ReqContext) response.Response { rsp, err := s.store.Read(c.Req.Context(), &ReadObjectRequest{ UID: uid, Kind: kind, - Version: params["version"], // ?version = XYZ - WithBody: true, // ?? allow false? - WithSummary: true, // ?? allow false? + Version: params["version"], // ?version = XYZ + WithBody: params["body"] != "false", // default to true + WithSummary: params["summary"] == "true", // default to false }) if err != nil { return response.Error(500, "error fetching object", err) @@ -200,5 +200,16 @@ func (s *httpObjectStore) doListFolder(c *models.ReqContext) response.Response { } func (s *httpObjectStore) doSearch(c *models.ReqContext) response.Response { - return response.JSON(501, "Not implemented yet") + req := &ObjectSearchRequest{ + WithBody: true, + WithLabels: true, + WithFields: true, + // TODO!!! + } + + rsp, err := s.store.Search(c.Req.Context(), req) + if err != nil { + return response.Error(500, "?", err) + } + return response.JSON(200, rsp) } diff --git a/pkg/services/store/object/json.go b/pkg/services/store/object/json.go new file mode 100644 index 00000000000..2ac4dc63a33 --- /dev/null +++ b/pkg/services/store/object/json.go @@ -0,0 +1,312 @@ +package object + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "unsafe" + + jsoniter "github.com/json-iterator/go" +) + +func init() { //nolint:gochecknoinits + jsoniter.RegisterTypeEncoder("object.ObjectSearchResult", &searchResultCodec{}) + jsoniter.RegisterTypeEncoder("object.WriteObjectResponse", &writeResponseCodec{}) + jsoniter.RegisterTypeEncoder("object.ReadObjectResponse", &readResponseCodec{}) + + jsoniter.RegisterTypeEncoder("object.RawObject", &rawObjectCodec{}) + jsoniter.RegisterTypeDecoder("object.RawObject", &rawObjectCodec{}) +} + +func writeRawJson(stream *jsoniter.Stream, val []byte) { + if json.Valid(val) { + _, _ = stream.Write(val) + } else { + stream.WriteString(string(val)) + } +} + +// Unlike the standard JSON marshal, this will write bytes as JSON when it can +type rawObjectCodec struct{} + +func (obj *RawObject) MarshalJSON() ([]byte, error) { + var json = jsoniter.ConfigCompatibleWithStandardLibrary + return json.Marshal(obj) +} + +// UnmarshalJSON will read JSON into a RawObject +func (obj *RawObject) UnmarshalJSON(b []byte) error { + if obj == nil { + return fmt.Errorf("unexpected nil for raw objcet") + } + iter := jsoniter.ParseBytes(jsoniter.ConfigDefault, b) + readRawObject(iter, obj) + return iter.Error +} + +func (codec *rawObjectCodec) IsEmpty(ptr unsafe.Pointer) bool { + f := (*RawObject)(ptr) + return f.UID == "" && f.Body == nil +} + +func (codec *rawObjectCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) { + obj := (*RawObject)(ptr) + stream.WriteObjectStart() + stream.WriteObjectField("UID") + stream.WriteString(obj.UID) + + if obj.Kind != "" { + stream.WriteMore() + stream.WriteObjectField("kind") + stream.WriteString(obj.Kind) + } + if obj.Version != "" { + stream.WriteMore() + stream.WriteObjectField("version") + stream.WriteString(obj.Version) + } + if obj.Created > 0 { + stream.WriteMore() + stream.WriteObjectField("created") + stream.WriteInt64(obj.Created) + } + if obj.Updated > 0 { + stream.WriteMore() + stream.WriteObjectField("updated") + stream.WriteInt64(obj.Updated) + } + if obj.CreatedBy != "" { + stream.WriteMore() + stream.WriteObjectField("createdBy") + stream.WriteString(obj.CreatedBy) + } + if obj.UpdatedBy != "" { + stream.WriteMore() + stream.WriteObjectField("updatedBy") + stream.WriteString(obj.UpdatedBy) + } + if obj.Body != nil { + stream.WriteMore() + if json.Valid(obj.Body) { + stream.WriteObjectField("body") + stream.WriteRaw(string(obj.Body)) // works for strings + } else { + sEnc := base64.StdEncoding.EncodeToString(obj.Body) + stream.WriteObjectField("body_base64") + stream.WriteString(sEnc) // works for strings + } + } + if obj.ETag != "" { + stream.WriteMore() + stream.WriteObjectField("etag") + stream.WriteString(obj.ETag) + } + if obj.Size > 0 { + stream.WriteMore() + stream.WriteObjectField("size") + stream.WriteInt64(obj.Size) + } + + if obj.Sync != nil { + stream.WriteMore() + stream.WriteObjectField("sync") + stream.WriteVal(obj.Sync) + } + + stream.WriteObjectEnd() +} + +func (codec *rawObjectCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + *(*RawObject)(ptr) = RawObject{} + raw := (*RawObject)(ptr) + readRawObject(iter, raw) +} + +func readRawObject(iter *jsoniter.Iterator, raw *RawObject) { + for l1Field := iter.ReadObject(); l1Field != ""; l1Field = iter.ReadObject() { + switch l1Field { + case "UID": + raw.UID = iter.ReadString() + case "kind": + raw.Kind = iter.ReadString() + case "updated": + raw.Updated = iter.ReadInt64() + case "updatedBy": + raw.UpdatedBy = iter.ReadString() + case "created": + raw.Created = iter.ReadInt64() + case "createdBy": + raw.CreatedBy = iter.ReadString() + case "size": + raw.Size = iter.ReadInt64() + case "etag": + raw.ETag = iter.ReadString() + case "version": + raw.Version = iter.ReadString() + case "sync": + raw.Sync = &RawObjectSyncInfo{} + iter.ReadVal(raw.Sync) + + case "body": + 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 object", "error creating json from body") + return + } + raw.Body = body + + case "body_base64": + val := iter.ReadString() + body, err := base64.StdEncoding.DecodeString(val) + if err != nil { + iter.ReportError("raw object", "error decoding base64 body") + return + } + raw.Body = body + + default: + iter.ReportError("raw object", "unexpected field: "+l1Field) + return + } + } +} + +// Unlike the standard JSON marshal, this will write bytes as JSON when it can +type readResponseCodec struct{} + +func (obj *ReadObjectResponse) MarshalJSON() ([]byte, error) { + var json = jsoniter.ConfigCompatibleWithStandardLibrary + return json.Marshal(obj) +} + +func (codec *readResponseCodec) IsEmpty(ptr unsafe.Pointer) bool { + f := (*ReadObjectResponse)(ptr) + return f == nil +} + +func (codec *readResponseCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) { + obj := (*ReadObjectResponse)(ptr) + stream.WriteObjectStart() + stream.WriteObjectField("object") + stream.WriteVal(obj.Object) + + 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{} + +func (obj *ObjectSearchResult) MarshalJSON() ([]byte, error) { + var json = jsoniter.ConfigCompatibleWithStandardLibrary + return json.Marshal(obj) +} + +func (codec *searchResultCodec) IsEmpty(ptr unsafe.Pointer) bool { + f := (*ObjectSearchResult)(ptr) + return f.UID == "" && f.Body == nil +} + +func (codec *searchResultCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) { + obj := (*ObjectSearchResult)(ptr) + stream.WriteObjectStart() + stream.WriteObjectField("UID") + stream.WriteString(obj.UID) + + if obj.Kind != "" { + stream.WriteMore() + stream.WriteObjectField("kind") + stream.WriteString(obj.Kind) + } + if obj.Name != "" { + stream.WriteMore() + stream.WriteObjectField("name") + stream.WriteString(obj.Name) + } + if obj.Description != "" { + stream.WriteMore() + stream.WriteObjectField("description") + stream.WriteString(obj.Description) + } + if obj.Updated > 0 { + stream.WriteMore() + stream.WriteObjectField("updated") + stream.WriteInt64(obj.Updated) + } + if obj.UpdatedBy != "" { + stream.WriteMore() + stream.WriteObjectField("updatedBy") + stream.WriteVal(obj.UpdatedBy) + } + if obj.Body != nil { + stream.WriteMore() + if json.Valid(obj.Body) { + stream.WriteObjectField("body") + _, _ = stream.Write(obj.Body) // works for strings + } else { + stream.WriteObjectField("body_base64") + stream.WriteVal(obj.Body) // works for strings + } + } + if obj.Labels != nil { + stream.WriteMore() + stream.WriteObjectField("labels") + stream.WriteVal(obj.Labels) + } + if obj.ErrorJson != nil { + stream.WriteMore() + stream.WriteObjectField("error") + writeRawJson(stream, obj.ErrorJson) + } + if obj.FieldsJson != nil { + stream.WriteMore() + stream.WriteObjectField("fields") + writeRawJson(stream, obj.FieldsJson) + } + + stream.WriteObjectEnd() +} + +// Unlike the standard JSON marshal, this will write bytes as JSON when it can +type writeResponseCodec struct{} + +func (obj *WriteObjectResponse) MarshalJSON() ([]byte, error) { + var json = jsoniter.ConfigCompatibleWithStandardLibrary + return json.Marshal(obj) +} + +func (codec *writeResponseCodec) IsEmpty(ptr unsafe.Pointer) bool { + f := (*WriteObjectResponse)(ptr) + return f == nil +} + +func (codec *writeResponseCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) { + obj := (*WriteObjectResponse)(ptr) + stream.WriteObjectStart() + stream.WriteObjectField("status") + stream.WriteString(obj.Status.String()) + + if obj.Error != nil { + stream.WriteMore() + stream.WriteObjectField("error") + stream.WriteVal(obj.Error) + } + if obj.Object != nil { + stream.WriteMore() + stream.WriteObjectField("object") + stream.WriteVal(obj.Object) + } + if len(obj.SummaryJson) > 0 { + stream.WriteMore() + stream.WriteObjectField("summary") + writeRawJson(stream, obj.SummaryJson) + } + stream.WriteObjectEnd() +} diff --git a/pkg/services/store/object/json_test.go b/pkg/services/store/object/json_test.go new file mode 100644 index 00000000000..3268a5de42f --- /dev/null +++ b/pkg/services/store/object/json_test.go @@ -0,0 +1,34 @@ +package object + +import ( + "encoding/json" + "testing" + + "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 := &RawObject{ + UID: "a", + Kind: "b", + Version: "c", + ETag: "d", + Body: body, + } + + b, err := json.MarshalIndent(raw, "", " ") + require.NoError(t, err) + + str := string(b) + require.JSONEq(t, `{"UID":"a","kind":"b","version":"c","body":{"field":1.23,"hello":"world"},"etag":"d"}`, str) + + copy := &RawObject{} + err = json.Unmarshal(b, copy) + require.NoError(t, err) +} diff --git a/pkg/services/store/object/kind.go b/pkg/services/store/object/kind.go index 6b57250b315..8358a002d1b 100644 --- a/pkg/services/store/object/kind.go +++ b/pkg/services/store/object/kind.go @@ -1,5 +1,10 @@ package object +import ( + "fmt" + "time" +) + // NOTE this is just a temporary registry/list so we can use constants // TODO replace with codegen from kind schema system @@ -8,3 +13,50 @@ const StandardKindFolder = "folder" const StandardKindPanel = "panel" // types: heatmap, timeseries, table, ... const StandardKindDataSource = "ds" // types: influx, prometheus, test, ... const StandardKindTransform = "transform" // types: joinByField, pivot, organizeFields, ... + +// This is a stub -- it will soon lookup in a registry of known "kinds" +// Each kind will be able to define: +// 1. sanitize/normalize function (ie get safe bytes) +// 2. SummaryProvier +func GetSafeSaveObject(r *WriteObjectRequest) (*ObjectSummary, []byte, error) { + summary := &ObjectSummary{ + Name: fmt.Sprintf("hello: %s", r.Kind), + Description: fmt.Sprintf("Wrote at %s", time.Now().Local().String()), + Labels: map[string]string{ + "hello": "world", + "tag1": "", + "tag2": "", + }, + Fields: map[string]interface{}{ + "field1": "a string", + "field2": 1.224, + "field4": true, + }, + Error: nil, // ignore for now + Nested: nil, // ignore for now + References: []*ExternalReference{ + { + Kind: "ds", + Type: "influx", + UID: "xyz", + }, + { + Kind: "panel", + Type: "heatmap", + }, + { + Kind: "panel", + Type: "timeseries", + }, + }, + } + + if summary.UID != "" && r.UID != summary.UID { + return nil, nil, fmt.Errorf("internal UID mismatch") + } + if summary.Kind != "" && r.Kind != summary.Kind { + return nil, nil, fmt.Errorf("internal Kind mismatch") + } + + return summary, r.Body, nil +} diff --git a/pkg/services/store/object/object.pb.go b/pkg/services/store/object/object.pb.go index 4fabc672a52..de6000a28d1 100644 --- a/pkg/services/store/object/object.pb.go +++ b/pkg/services/store/object/object.pb.go @@ -70,7 +70,7 @@ func (x WriteObjectResponse_Status) Number() protoreflect.EnumNumber { // Deprecated: Use WriteObjectResponse_Status.Descriptor instead. func (WriteObjectResponse_Status) EnumDescriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{8, 0} + return file_object_proto_rawDescGZIP(), []int{9, 0} } // The canonical object/document data -- this represents the raw bytes and storage level metadata @@ -102,14 +102,8 @@ type RawObject struct { // // NOTE: currently managed by the dashboard+dashboard_version tables Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"` - // Location (path/repo/etc) that defines the canonocal form - // - // NOTE: currently managed by the dashboard_provisioning table - SyncSrc string `protobuf:"bytes,11,opt,name=sync_src,json=syncSrc,proto3" json:"sync_src,omitempty"` - // Time in epoch milliseconds that the object was last synced with an external system (provisioning/git) - // - // NOTE: currently managed by the dashboard_provisioning table - SyncTime int64 `protobuf:"varint,12,opt,name=sync_time,json=syncTime,proto3" json:"sync_time,omitempty"` + // External location info + Sync *RawObjectSyncInfo `protobuf:"bytes,11,opt,name=sync,proto3" json:"sync,omitempty"` } func (x *RawObject) Reset() { @@ -214,16 +208,66 @@ func (x *RawObject) GetVersion() string { return "" } -func (x *RawObject) GetSyncSrc() string { +func (x *RawObject) GetSync() *RawObjectSyncInfo { if x != nil { - return x.SyncSrc + return x.Sync + } + return nil +} + +type RawObjectSyncInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // NOTE: currently managed by the dashboard_provisioning table + Source string `protobuf:"bytes,11,opt,name=source,proto3" json:"source,omitempty"` + // Time in epoch milliseconds that the object was last synced with an external system (provisioning/git) + Time int64 `protobuf:"varint,12,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *RawObjectSyncInfo) Reset() { + *x = RawObjectSyncInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RawObjectSyncInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawObjectSyncInfo) ProtoMessage() {} + +func (x *RawObjectSyncInfo) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RawObjectSyncInfo.ProtoReflect.Descriptor instead. +func (*RawObjectSyncInfo) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{1} +} + +func (x *RawObjectSyncInfo) GetSource() string { + if x != nil { + return x.Source } return "" } -func (x *RawObject) GetSyncTime() int64 { +func (x *RawObjectSyncInfo) GetTime() int64 { if x != nil { - return x.SyncTime + return x.Time } return 0 } @@ -246,7 +290,7 @@ type ObjectErrorInfo struct { func (x *ObjectErrorInfo) Reset() { *x = ObjectErrorInfo{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[1] + mi := &file_object_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -259,7 +303,7 @@ func (x *ObjectErrorInfo) String() string { func (*ObjectErrorInfo) ProtoMessage() {} func (x *ObjectErrorInfo) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[1] + mi := &file_object_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -272,7 +316,7 @@ func (x *ObjectErrorInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectErrorInfo.ProtoReflect.Descriptor instead. func (*ObjectErrorInfo) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{1} + return file_object_proto_rawDescGZIP(), []int{2} } func (x *ObjectErrorInfo) GetCode() int64 { @@ -321,7 +365,7 @@ type ObjectVersionInfo struct { func (x *ObjectVersionInfo) Reset() { *x = ObjectVersionInfo{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[2] + mi := &file_object_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -334,7 +378,7 @@ func (x *ObjectVersionInfo) String() string { func (*ObjectVersionInfo) ProtoMessage() {} func (x *ObjectVersionInfo) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[2] + mi := &file_object_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -347,7 +391,7 @@ func (x *ObjectVersionInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectVersionInfo.ProtoReflect.Descriptor instead. func (*ObjectVersionInfo) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{2} + return file_object_proto_rawDescGZIP(), []int{3} } func (x *ObjectVersionInfo) GetVersion() string { @@ -412,7 +456,7 @@ type ReadObjectRequest struct { func (x *ReadObjectRequest) Reset() { *x = ReadObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[3] + mi := &file_object_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -425,7 +469,7 @@ func (x *ReadObjectRequest) String() string { func (*ReadObjectRequest) ProtoMessage() {} func (x *ReadObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[3] + mi := &file_object_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -438,7 +482,7 @@ func (x *ReadObjectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadObjectRequest.ProtoReflect.Descriptor instead. func (*ReadObjectRequest) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{3} + return file_object_proto_rawDescGZIP(), []int{4} } func (x *ReadObjectRequest) GetUID() string { @@ -490,7 +534,7 @@ type ReadObjectResponse struct { func (x *ReadObjectResponse) Reset() { *x = ReadObjectResponse{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[4] + mi := &file_object_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -503,7 +547,7 @@ func (x *ReadObjectResponse) String() string { func (*ReadObjectResponse) ProtoMessage() {} func (x *ReadObjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[4] + mi := &file_object_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -516,7 +560,7 @@ func (x *ReadObjectResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadObjectResponse.ProtoReflect.Descriptor instead. func (*ReadObjectResponse) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{4} + return file_object_proto_rawDescGZIP(), []int{5} } func (x *ReadObjectResponse) GetObject() *RawObject { @@ -544,7 +588,7 @@ type BatchReadObjectRequest struct { func (x *BatchReadObjectRequest) Reset() { *x = BatchReadObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[5] + mi := &file_object_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -557,7 +601,7 @@ func (x *BatchReadObjectRequest) String() string { func (*BatchReadObjectRequest) ProtoMessage() {} func (x *BatchReadObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[5] + mi := &file_object_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -570,7 +614,7 @@ func (x *BatchReadObjectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchReadObjectRequest.ProtoReflect.Descriptor instead. func (*BatchReadObjectRequest) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{5} + return file_object_proto_rawDescGZIP(), []int{6} } func (x *BatchReadObjectRequest) GetBatch() []*ReadObjectRequest { @@ -591,7 +635,7 @@ type BatchReadObjectResponse struct { func (x *BatchReadObjectResponse) Reset() { *x = BatchReadObjectResponse{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[6] + mi := &file_object_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -604,7 +648,7 @@ func (x *BatchReadObjectResponse) String() string { func (*BatchReadObjectResponse) ProtoMessage() {} func (x *BatchReadObjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[6] + mi := &file_object_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -617,7 +661,7 @@ func (x *BatchReadObjectResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchReadObjectResponse.ProtoReflect.Descriptor instead. func (*BatchReadObjectResponse) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{6} + return file_object_proto_rawDescGZIP(), []int{7} } func (x *BatchReadObjectResponse) GetResults() []*ReadObjectResponse { @@ -647,7 +691,7 @@ type WriteObjectRequest struct { func (x *WriteObjectRequest) Reset() { *x = WriteObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[7] + mi := &file_object_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -660,7 +704,7 @@ func (x *WriteObjectRequest) String() string { func (*WriteObjectRequest) ProtoMessage() {} func (x *WriteObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[7] + mi := &file_object_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -673,7 +717,7 @@ func (x *WriteObjectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteObjectRequest.ProtoReflect.Descriptor instead. func (*WriteObjectRequest) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{7} + return file_object_proto_rawDescGZIP(), []int{8} } func (x *WriteObjectRequest) GetUID() string { @@ -729,7 +773,7 @@ type WriteObjectResponse struct { func (x *WriteObjectResponse) Reset() { *x = WriteObjectResponse{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[8] + mi := &file_object_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -742,7 +786,7 @@ func (x *WriteObjectResponse) String() string { func (*WriteObjectResponse) ProtoMessage() {} func (x *WriteObjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[8] + mi := &file_object_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -755,7 +799,7 @@ func (x *WriteObjectResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteObjectResponse.ProtoReflect.Descriptor instead. func (*WriteObjectResponse) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{8} + return file_object_proto_rawDescGZIP(), []int{9} } func (x *WriteObjectResponse) GetError() *ObjectErrorInfo { @@ -802,7 +846,7 @@ type DeleteObjectRequest struct { func (x *DeleteObjectRequest) Reset() { *x = DeleteObjectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[9] + mi := &file_object_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -815,7 +859,7 @@ func (x *DeleteObjectRequest) String() string { func (*DeleteObjectRequest) ProtoMessage() {} func (x *DeleteObjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[9] + mi := &file_object_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -828,7 +872,7 @@ func (x *DeleteObjectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteObjectRequest.ProtoReflect.Descriptor instead. func (*DeleteObjectRequest) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{9} + return file_object_proto_rawDescGZIP(), []int{10} } func (x *DeleteObjectRequest) GetUID() string { @@ -863,7 +907,7 @@ type DeleteObjectResponse struct { func (x *DeleteObjectResponse) Reset() { *x = DeleteObjectResponse{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[10] + mi := &file_object_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -876,7 +920,7 @@ func (x *DeleteObjectResponse) String() string { func (*DeleteObjectResponse) ProtoMessage() {} func (x *DeleteObjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[10] + mi := &file_object_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -889,7 +933,7 @@ func (x *DeleteObjectResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteObjectResponse.ProtoReflect.Descriptor instead. func (*DeleteObjectResponse) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{10} + return file_object_proto_rawDescGZIP(), []int{11} } func (x *DeleteObjectResponse) GetOK() bool { @@ -917,7 +961,7 @@ type ObjectHistoryRequest struct { func (x *ObjectHistoryRequest) Reset() { *x = ObjectHistoryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[11] + mi := &file_object_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -930,7 +974,7 @@ func (x *ObjectHistoryRequest) String() string { func (*ObjectHistoryRequest) ProtoMessage() {} func (x *ObjectHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[11] + mi := &file_object_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -943,7 +987,7 @@ func (x *ObjectHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectHistoryRequest.ProtoReflect.Descriptor instead. func (*ObjectHistoryRequest) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{11} + return file_object_proto_rawDescGZIP(), []int{12} } func (x *ObjectHistoryRequest) GetUID() string { @@ -988,7 +1032,7 @@ type ObjectHistoryResponse struct { func (x *ObjectHistoryResponse) Reset() { *x = ObjectHistoryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[12] + mi := &file_object_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1001,7 +1045,7 @@ func (x *ObjectHistoryResponse) String() string { func (*ObjectHistoryResponse) ProtoMessage() {} func (x *ObjectHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[12] + mi := &file_object_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1014,7 +1058,7 @@ func (x *ObjectHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectHistoryResponse.ProtoReflect.Descriptor instead. func (*ObjectHistoryResponse) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{12} + return file_object_proto_rawDescGZIP(), []int{13} } func (x *ObjectHistoryResponse) GetVersions() []*ObjectVersionInfo { @@ -1061,7 +1105,7 @@ type ObjectSearchRequest struct { func (x *ObjectSearchRequest) Reset() { *x = ObjectSearchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[13] + mi := &file_object_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1074,7 +1118,7 @@ func (x *ObjectSearchRequest) String() string { func (*ObjectSearchRequest) ProtoMessage() {} func (x *ObjectSearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[13] + mi := &file_object_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1087,7 +1131,7 @@ func (x *ObjectSearchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectSearchRequest.ProtoReflect.Descriptor instead. func (*ObjectSearchRequest) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{13} + return file_object_proto_rawDescGZIP(), []int{14} } func (x *ObjectSearchRequest) GetNextPageToken() string { @@ -1186,15 +1230,15 @@ type ObjectSearchResult struct { // The structured labels Labels map[string]string `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Optionally include extracted JSON - FieldsJson string `protobuf:"bytes,10,opt,name=fields_json,json=fieldsJson,proto3" json:"fields_json,omitempty"` + FieldsJson []byte `protobuf:"bytes,10,opt,name=fields_json,json=fieldsJson,proto3" json:"fields_json,omitempty"` // ObjectErrorInfo in json - ErrorJson string `protobuf:"bytes,11,opt,name=error_json,json=errorJson,proto3" json:"error_json,omitempty"` + ErrorJson []byte `protobuf:"bytes,11,opt,name=error_json,json=errorJson,proto3" json:"error_json,omitempty"` } func (x *ObjectSearchResult) Reset() { *x = ObjectSearchResult{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[14] + mi := &file_object_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1207,7 +1251,7 @@ func (x *ObjectSearchResult) String() string { func (*ObjectSearchResult) ProtoMessage() {} func (x *ObjectSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[14] + mi := &file_object_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1220,7 +1264,7 @@ func (x *ObjectSearchResult) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectSearchResult.ProtoReflect.Descriptor instead. func (*ObjectSearchResult) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{14} + return file_object_proto_rawDescGZIP(), []int{15} } func (x *ObjectSearchResult) GetUID() string { @@ -1286,18 +1330,18 @@ func (x *ObjectSearchResult) GetLabels() map[string]string { return nil } -func (x *ObjectSearchResult) GetFieldsJson() string { +func (x *ObjectSearchResult) GetFieldsJson() []byte { if x != nil { return x.FieldsJson } - return "" + return nil } -func (x *ObjectSearchResult) GetErrorJson() string { +func (x *ObjectSearchResult) GetErrorJson() []byte { if x != nil { return x.ErrorJson } - return "" + return nil } type ObjectSearchResponse struct { @@ -1313,7 +1357,7 @@ type ObjectSearchResponse struct { func (x *ObjectSearchResponse) Reset() { *x = ObjectSearchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_object_proto_msgTypes[15] + mi := &file_object_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1326,7 +1370,7 @@ func (x *ObjectSearchResponse) String() string { func (*ObjectSearchResponse) ProtoMessage() {} func (x *ObjectSearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_proto_msgTypes[15] + mi := &file_object_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1339,7 +1383,7 @@ func (x *ObjectSearchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectSearchResponse.ProtoReflect.Descriptor instead. func (*ObjectSearchResponse) Descriptor() ([]byte, []int) { - return file_object_proto_rawDescGZIP(), []int{15} + return file_object_proto_rawDescGZIP(), []int{16} } func (x *ObjectSearchResponse) GetResults() []*ObjectSearchResult { @@ -1360,7 +1404,7 @@ var File_object_proto protoreflect.FileDescriptor var file_object_proto_rawDesc = []byte{ 0x0a, 0x0c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0xb1, 0x02, 0x0a, 0x09, 0x52, 0x61, 0x77, 0x4f, 0x62, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0xa8, 0x02, 0x0a, 0x09, 0x52, 0x61, 0x77, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, @@ -1376,189 +1420,192 @@ var file_object_proto_rawDesc = []byte{ 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, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x72, 0x63, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x72, 0x63, 0x12, 0x1b, 0x0a, - 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x0f, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 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, 0xa8, - 0x01, 0x0a, 0x11, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x18, - 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 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, 0x93, 0x01, 0x0a, 0x11, 0x52, 0x65, - 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, - 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 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, 0x04, 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, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, - 0x62, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, - 0x61, 0x77, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 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, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, - 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 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, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 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, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, - 0x93, 0x01, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 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, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x02, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x06, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, - 0x03, 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, 0x04, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x66, 0x0a, 0x13, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 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, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 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, 0x7a, 0x0a, 0x14, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 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, 0x76, 0x0a, 0x15, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x35, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 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, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0x84, 0x03, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x92, 0x03, 0x0a, 0x12, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x10, + 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x61, 0x77, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x73, 0x79, 0x6e, + 0x63, 0x22, 0x3f, 0x0a, 0x11, 0x52, 0x61, 0x77, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x79, + 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0xa8, 0x01, 0x0a, 0x11, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 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, 0x18, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 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, 0x93, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 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, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x62, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, + 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x61, 0x77, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x64, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4c, 0x61, + 0x6b, 0x69, 0x6e, 0x64, 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, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, + 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x02, + 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x66, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 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, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x7a, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 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, 0x76, 0x0a, 0x15, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 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, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 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, 0x0b, 0x20, 0x01, 0x28, 0x09, 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, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0xae, 0x03, 0x0a, 0x0b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x19, 0x2e, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, - 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, - 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, - 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x40, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x79, 0x12, 0x1c, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, + 0x92, 0x03, 0x0a, 0x12, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 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, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0a, 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, 0x0b, 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, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0xae, 0x03, 0x0a, 0x0b, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x52, 0x65, + 0x61, 0x64, 0x12, 0x19, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x64, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x12, 0x1a, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, + 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, + 0x2f, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1574,56 +1621,58 @@ func file_object_proto_rawDescGZIP() []byte { } var file_object_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_object_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_object_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_object_proto_goTypes = []interface{}{ (WriteObjectResponse_Status)(0), // 0: object.WriteObjectResponse.Status (*RawObject)(nil), // 1: object.RawObject - (*ObjectErrorInfo)(nil), // 2: object.ObjectErrorInfo - (*ObjectVersionInfo)(nil), // 3: object.ObjectVersionInfo - (*ReadObjectRequest)(nil), // 4: object.ReadObjectRequest - (*ReadObjectResponse)(nil), // 5: object.ReadObjectResponse - (*BatchReadObjectRequest)(nil), // 6: object.BatchReadObjectRequest - (*BatchReadObjectResponse)(nil), // 7: object.BatchReadObjectResponse - (*WriteObjectRequest)(nil), // 8: object.WriteObjectRequest - (*WriteObjectResponse)(nil), // 9: object.WriteObjectResponse - (*DeleteObjectRequest)(nil), // 10: object.DeleteObjectRequest - (*DeleteObjectResponse)(nil), // 11: object.DeleteObjectResponse - (*ObjectHistoryRequest)(nil), // 12: object.ObjectHistoryRequest - (*ObjectHistoryResponse)(nil), // 13: object.ObjectHistoryResponse - (*ObjectSearchRequest)(nil), // 14: object.ObjectSearchRequest - (*ObjectSearchResult)(nil), // 15: object.ObjectSearchResult - (*ObjectSearchResponse)(nil), // 16: object.ObjectSearchResponse - nil, // 17: object.ObjectSearchRequest.LabelsEntry - nil, // 18: object.ObjectSearchResult.LabelsEntry + (*RawObjectSyncInfo)(nil), // 2: object.RawObjectSyncInfo + (*ObjectErrorInfo)(nil), // 3: object.ObjectErrorInfo + (*ObjectVersionInfo)(nil), // 4: object.ObjectVersionInfo + (*ReadObjectRequest)(nil), // 5: object.ReadObjectRequest + (*ReadObjectResponse)(nil), // 6: object.ReadObjectResponse + (*BatchReadObjectRequest)(nil), // 7: object.BatchReadObjectRequest + (*BatchReadObjectResponse)(nil), // 8: object.BatchReadObjectResponse + (*WriteObjectRequest)(nil), // 9: object.WriteObjectRequest + (*WriteObjectResponse)(nil), // 10: object.WriteObjectResponse + (*DeleteObjectRequest)(nil), // 11: object.DeleteObjectRequest + (*DeleteObjectResponse)(nil), // 12: object.DeleteObjectResponse + (*ObjectHistoryRequest)(nil), // 13: object.ObjectHistoryRequest + (*ObjectHistoryResponse)(nil), // 14: object.ObjectHistoryResponse + (*ObjectSearchRequest)(nil), // 15: object.ObjectSearchRequest + (*ObjectSearchResult)(nil), // 16: object.ObjectSearchResult + (*ObjectSearchResponse)(nil), // 17: object.ObjectSearchResponse + nil, // 18: object.ObjectSearchRequest.LabelsEntry + nil, // 19: object.ObjectSearchResult.LabelsEntry } var file_object_proto_depIdxs = []int32{ - 1, // 0: object.ReadObjectResponse.object:type_name -> object.RawObject - 4, // 1: object.BatchReadObjectRequest.batch:type_name -> object.ReadObjectRequest - 5, // 2: object.BatchReadObjectResponse.results:type_name -> object.ReadObjectResponse - 2, // 3: object.WriteObjectResponse.error:type_name -> object.ObjectErrorInfo - 3, // 4: object.WriteObjectResponse.object:type_name -> object.ObjectVersionInfo - 0, // 5: object.WriteObjectResponse.status:type_name -> object.WriteObjectResponse.Status - 3, // 6: object.ObjectHistoryResponse.versions:type_name -> object.ObjectVersionInfo - 17, // 7: object.ObjectSearchRequest.labels:type_name -> object.ObjectSearchRequest.LabelsEntry - 18, // 8: object.ObjectSearchResult.labels:type_name -> object.ObjectSearchResult.LabelsEntry - 15, // 9: object.ObjectSearchResponse.results:type_name -> object.ObjectSearchResult - 4, // 10: object.ObjectStore.Read:input_type -> object.ReadObjectRequest - 6, // 11: object.ObjectStore.BatchRead:input_type -> object.BatchReadObjectRequest - 8, // 12: object.ObjectStore.Write:input_type -> object.WriteObjectRequest - 10, // 13: object.ObjectStore.Delete:input_type -> object.DeleteObjectRequest - 12, // 14: object.ObjectStore.History:input_type -> object.ObjectHistoryRequest - 14, // 15: object.ObjectStore.Search:input_type -> object.ObjectSearchRequest - 5, // 16: object.ObjectStore.Read:output_type -> object.ReadObjectResponse - 7, // 17: object.ObjectStore.BatchRead:output_type -> object.BatchReadObjectResponse - 9, // 18: object.ObjectStore.Write:output_type -> object.WriteObjectResponse - 11, // 19: object.ObjectStore.Delete:output_type -> object.DeleteObjectResponse - 13, // 20: object.ObjectStore.History:output_type -> object.ObjectHistoryResponse - 16, // 21: object.ObjectStore.Search:output_type -> object.ObjectSearchResponse - 16, // [16:22] is the sub-list for method output_type - 10, // [10:16] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 2, // 0: object.RawObject.sync:type_name -> object.RawObjectSyncInfo + 1, // 1: object.ReadObjectResponse.object:type_name -> object.RawObject + 5, // 2: object.BatchReadObjectRequest.batch:type_name -> object.ReadObjectRequest + 6, // 3: object.BatchReadObjectResponse.results:type_name -> object.ReadObjectResponse + 3, // 4: object.WriteObjectResponse.error:type_name -> object.ObjectErrorInfo + 4, // 5: object.WriteObjectResponse.object:type_name -> object.ObjectVersionInfo + 0, // 6: object.WriteObjectResponse.status:type_name -> object.WriteObjectResponse.Status + 4, // 7: object.ObjectHistoryResponse.versions:type_name -> object.ObjectVersionInfo + 18, // 8: object.ObjectSearchRequest.labels:type_name -> object.ObjectSearchRequest.LabelsEntry + 19, // 9: object.ObjectSearchResult.labels:type_name -> object.ObjectSearchResult.LabelsEntry + 16, // 10: object.ObjectSearchResponse.results:type_name -> object.ObjectSearchResult + 5, // 11: object.ObjectStore.Read:input_type -> object.ReadObjectRequest + 7, // 12: object.ObjectStore.BatchRead:input_type -> object.BatchReadObjectRequest + 9, // 13: object.ObjectStore.Write:input_type -> object.WriteObjectRequest + 11, // 14: object.ObjectStore.Delete:input_type -> object.DeleteObjectRequest + 13, // 15: object.ObjectStore.History:input_type -> object.ObjectHistoryRequest + 15, // 16: object.ObjectStore.Search:input_type -> object.ObjectSearchRequest + 6, // 17: object.ObjectStore.Read:output_type -> object.ReadObjectResponse + 8, // 18: object.ObjectStore.BatchRead:output_type -> object.BatchReadObjectResponse + 10, // 19: object.ObjectStore.Write:output_type -> object.WriteObjectResponse + 12, // 20: object.ObjectStore.Delete:output_type -> object.DeleteObjectResponse + 14, // 21: object.ObjectStore.History:output_type -> object.ObjectHistoryResponse + 17, // 22: object.ObjectStore.Search:output_type -> object.ObjectSearchResponse + 17, // [17:23] is the sub-list for method output_type + 11, // [11:17] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_object_proto_init() } @@ -1645,7 +1694,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectErrorInfo); i { + switch v := v.(*RawObjectSyncInfo); i { case 0: return &v.state case 1: @@ -1657,7 +1706,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectVersionInfo); i { + switch v := v.(*ObjectErrorInfo); i { case 0: return &v.state case 1: @@ -1669,7 +1718,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadObjectRequest); i { + switch v := v.(*ObjectVersionInfo); i { case 0: return &v.state case 1: @@ -1681,7 +1730,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadObjectResponse); i { + switch v := v.(*ReadObjectRequest); i { case 0: return &v.state case 1: @@ -1693,7 +1742,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchReadObjectRequest); i { + switch v := v.(*ReadObjectResponse); i { case 0: return &v.state case 1: @@ -1705,7 +1754,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchReadObjectResponse); i { + switch v := v.(*BatchReadObjectRequest); i { case 0: return &v.state case 1: @@ -1717,7 +1766,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteObjectRequest); i { + switch v := v.(*BatchReadObjectResponse); i { case 0: return &v.state case 1: @@ -1729,7 +1778,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteObjectResponse); i { + switch v := v.(*WriteObjectRequest); i { case 0: return &v.state case 1: @@ -1741,7 +1790,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteObjectRequest); i { + switch v := v.(*WriteObjectResponse); i { case 0: return &v.state case 1: @@ -1753,7 +1802,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteObjectResponse); i { + switch v := v.(*DeleteObjectRequest); i { case 0: return &v.state case 1: @@ -1765,7 +1814,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectHistoryRequest); i { + switch v := v.(*DeleteObjectResponse); i { case 0: return &v.state case 1: @@ -1777,7 +1826,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectHistoryResponse); i { + switch v := v.(*ObjectHistoryRequest); i { case 0: return &v.state case 1: @@ -1789,7 +1838,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectSearchRequest); i { + switch v := v.(*ObjectHistoryResponse); i { case 0: return &v.state case 1: @@ -1801,7 +1850,7 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectSearchResult); i { + switch v := v.(*ObjectSearchRequest); i { case 0: return &v.state case 1: @@ -1813,6 +1862,18 @@ func file_object_proto_init() { } } file_object_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectSearchResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ObjectSearchResponse); i { case 0: return &v.state @@ -1831,7 +1892,7 @@ func file_object_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_object_proto_rawDesc, NumEnums: 1, - NumMessages: 18, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/services/store/object/object.proto b/pkg/services/store/object/object.proto index 5f569e81168..e8966ffab71 100644 --- a/pkg/services/store/object/object.proto +++ b/pkg/services/store/object/object.proto @@ -38,15 +38,16 @@ message RawObject { // NOTE: currently managed by the dashboard+dashboard_version tables string version = 10; - // Location (path/repo/etc) that defines the canonocal form - // + // External location info + RawObjectSyncInfo sync = 11; +} + +message RawObjectSyncInfo { // NOTE: currently managed by the dashboard_provisioning table - string sync_src = 11; + string source = 11; // Time in epoch milliseconds that the object was last synced with an external system (provisioning/git) - // - // NOTE: currently managed by the dashboard_provisioning table - int64 sync_time = 12; + int64 time = 12; } // Report error while working with objects @@ -286,10 +287,10 @@ message ObjectSearchResult { map labels = 9; // Optionally include extracted JSON - string fields_json = 10; + bytes fields_json = 10; // ObjectErrorInfo in json - string error_json = 11; + bytes error_json = 11; } message ObjectSearchResponse {