From 213cfe51176391bf295028ac2a3ddfa68c560e29 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Thu, 29 Sep 2022 22:18:15 -0700 Subject: [PATCH] Object: use protobuf to declare the raw/summary types (#55646) --- pkg/services/store/object/generate.sh | 21 + pkg/services/store/object/object.go | 65 - pkg/services/store/object/object.pb.go | 1552 +++++++++++++++++++ pkg/services/store/object/object.proto | 257 +++ pkg/services/store/object/object_grpc.pb.go | 283 ++++ pkg/services/store/object/summary.go | 14 + 6 files changed, 2127 insertions(+), 65 deletions(-) create mode 100755 pkg/services/store/object/generate.sh delete mode 100644 pkg/services/store/object/object.go create mode 100644 pkg/services/store/object/object.pb.go create mode 100644 pkg/services/store/object/object.proto create mode 100644 pkg/services/store/object/object_grpc.pb.go diff --git a/pkg/services/store/object/generate.sh b/pkg/services/store/object/generate.sh new file mode 100755 index 00000000000..dac1819eed3 --- /dev/null +++ b/pkg/services/store/object/generate.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# To compile all protobuf files in this repository, run +# "mage protobuf" at the top-level. + +set -eu + +#DST_DIR=../genproto/entity +DST_DIR=./ + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +cd "$DIR" + +protoc -I ./ \ + --go_out=${DST_DIR} \ + --go-grpc_out=${DST_DIR} --go-grpc_opt=require_unimplemented_servers=false \ + object.proto + \ No newline at end of file diff --git a/pkg/services/store/object/object.go b/pkg/services/store/object/object.go deleted file mode 100644 index 089bc838f95..00000000000 --- a/pkg/services/store/object/object.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.5 -// source: object.proto - -package object - - -// Will be replaced with something from the SDK -type UserInfo struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // internal grafana ID - Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` // string ID? -} - -// The canonical object/document data -- this represents the raw bytes and storage level metadata -type RawObject struct { - // Unique ID - UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` - // Identify the object kind. This kind will be used to apply a schema to the body and - // will trigger additional indexing behavior. - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` - // Time in epoch milliseconds that the object was modified - Modified int64 `protobuf:"varint,3,opt,name=modified,proto3" json:"modified,omitempty"` - // Who modified the object - ModifiedBy *UserInfo `protobuf:"bytes,4,opt,name=modified_by,json=modifiedBy,proto3" json:"modified_by,omitempty"` - // Content Length - Size int64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` - // MD5 digest of the body - ETag string `protobuf:"bytes,6,opt,name=ETag,proto3" json:"ETag,omitempty"` - // Raw bytes of the storage object. The kind will determine what is a valid payload - Body []byte `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` - // The version will change when the object is saved. It is not necessarily sortable - // - // NOTE: currently managed by the dashboard+dashboard_version tables - Version string `protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty"` - // optional "save" or "commit" message - // - // NOTE: currently managed by the dashboard_version table, and will be returned from a "history" command - Comment string `protobuf:"bytes,9,opt,name=comment,proto3" json:"comment,omitempty"` - // Location (path/repo/etc) that defines the canonocal form - // - // NOTE: currently managed by the dashboard_provisioning table - SyncSrc string `protobuf:"bytes,10,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,11,opt,name=sync_time,json=syncTime,proto3" json:"sync_time,omitempty"` -} - -// Searchable fields extracted from the object -type ObjectErrorInfo struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // TODO... registry somewhere... should be limited to most severe issues - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - Details string `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` -} - -type ExternalReference struct { - // datasource, panel - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // prometheus / heatmap - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - // Unique ID for this object - UID string `protobuf:"bytes,3,opt,name=UID,proto3" json:"UID,omitempty"` -} diff --git a/pkg/services/store/object/object.pb.go b/pkg/services/store/object/object.pb.go new file mode 100644 index 00000000000..93d87d3a839 --- /dev/null +++ b/pkg/services/store/object/object.pb.go @@ -0,0 +1,1552 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.5 +// source: object.proto + +package object + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Will be replaced with something from the SDK +type UserInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // internal grafana user ID + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // login name + Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` // string ID? +} + +func (x *UserInfo) Reset() { + *x = UserInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserInfo) ProtoMessage() {} + +func (x *UserInfo) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserInfo.ProtoReflect.Descriptor instead. +func (*UserInfo) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{0} +} + +func (x *UserInfo) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserInfo) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +// The canonical object/document data -- this represents the raw bytes and storage level metadata +type RawObject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique ID + UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` + // Identify the object kind. This kind will be used to apply a schema to the body and + // will trigger additional indexing behavior. + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Time in epoch milliseconds that the object was created + Created int64 `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` + // Time in epoch milliseconds that the object was modified + Modified int64 `protobuf:"varint,4,opt,name=modified,proto3" json:"modified,omitempty"` + // Who created the object + CreatedBy *UserInfo `protobuf:"bytes,5,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` + // Who modified the object + ModifiedBy *UserInfo `protobuf:"bytes,6,opt,name=modified_by,json=modifiedBy,proto3" json:"modified_by,omitempty"` + // Content Length + Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` + // MD5 digest of the body + ETag string `protobuf:"bytes,8,opt,name=ETag,proto3" json:"ETag,omitempty"` + // Raw bytes of the storage object. The kind will determine what is a valid payload + Body []byte `protobuf:"bytes,9,opt,name=body,proto3" json:"body,omitempty"` + // The version will change when the object is saved. It is not necessarily sortable + // + // NOTE: currently managed by the dashboard+dashboard_version tables + Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"` + // optional "save" or "commit" message + // + // NOTE: currently managed by the dashboard_version table, and will be returned from a "history" command + Comment string `protobuf:"bytes,11,opt,name=comment,proto3" json:"comment,omitempty"` + // Location (path/repo/etc) that defines the canonocal form + // + // NOTE: currently managed by the dashboard_provisioning table + SyncSrc string `protobuf:"bytes,12,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,13,opt,name=sync_time,json=syncTime,proto3" json:"sync_time,omitempty"` +} + +func (x *RawObject) Reset() { + *x = RawObject{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RawObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawObject) ProtoMessage() {} + +func (x *RawObject) 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 RawObject.ProtoReflect.Descriptor instead. +func (*RawObject) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{1} +} + +func (x *RawObject) GetUID() string { + if x != nil { + return x.UID + } + return "" +} + +func (x *RawObject) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *RawObject) GetCreated() int64 { + if x != nil { + return x.Created + } + return 0 +} + +func (x *RawObject) GetModified() int64 { + if x != nil { + return x.Modified + } + return 0 +} + +func (x *RawObject) GetCreatedBy() *UserInfo { + if x != nil { + return x.CreatedBy + } + return nil +} + +func (x *RawObject) GetModifiedBy() *UserInfo { + if x != nil { + return x.ModifiedBy + } + return nil +} + +func (x *RawObject) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *RawObject) GetETag() string { + if x != nil { + return x.ETag + } + return "" +} + +func (x *RawObject) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *RawObject) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *RawObject) GetComment() string { + if x != nil { + return x.Comment + } + return "" +} + +func (x *RawObject) GetSyncSrc() string { + if x != nil { + return x.SyncSrc + } + return "" +} + +func (x *RawObject) GetSyncTime() int64 { + if x != nil { + return x.SyncTime + } + return 0 +} + +// Report error while working with objects +// NOTE: real systems at scale will contain errors. +type ObjectErrorInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Match an error code registry? + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + // Simple error display + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // Details encoded in JSON + DetailsJson []byte `protobuf:"bytes,3,opt,name=details_json,json=detailsJson,proto3" json:"details_json,omitempty"` +} + +func (x *ObjectErrorInfo) Reset() { + *x = ObjectErrorInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectErrorInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectErrorInfo) ProtoMessage() {} + +func (x *ObjectErrorInfo) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectErrorInfo.ProtoReflect.Descriptor instead. +func (*ObjectErrorInfo) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{2} +} + +func (x *ObjectErrorInfo) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ObjectErrorInfo) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ObjectErrorInfo) GetDetailsJson() []byte { + if x != nil { + return x.DetailsJson + } + return nil +} + +type ReadObjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Fetch an explicit version + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // Include the full body bytes + WithBody bool `protobuf:"varint,4,opt,name=with_body,json=withBody,proto3" json:"with_body,omitempty"` + // Include derived summary metadata + WithSummary bool `protobuf:"varint,5,opt,name=with_summary,json=withSummary,proto3" json:"with_summary,omitempty"` +} + +func (x *ReadObjectRequest) Reset() { + *x = ReadObjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadObjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadObjectRequest) ProtoMessage() {} + +func (x *ReadObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadObjectRequest.ProtoReflect.Descriptor instead. +func (*ReadObjectRequest) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{3} +} + +func (x *ReadObjectRequest) GetUID() string { + if x != nil { + return x.UID + } + return "" +} + +func (x *ReadObjectRequest) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *ReadObjectRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ReadObjectRequest) GetWithBody() bool { + if x != nil { + return x.WithBody + } + return false +} + +func (x *ReadObjectRequest) GetWithSummary() bool { + if x != nil { + return x.WithSummary + } + return false +} + +type ReadObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object details with the body removed + Object *RawObject `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + // Object summary as JSON + SummaryJson []byte `protobuf:"bytes,2,opt,name=summary_json,json=summaryJson,proto3" json:"summary_json,omitempty"` +} + +func (x *ReadObjectResponse) Reset() { + *x = ReadObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadObjectResponse) ProtoMessage() {} + +func (x *ReadObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadObjectResponse.ProtoReflect.Descriptor instead. +func (*ReadObjectResponse) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{4} +} + +func (x *ReadObjectResponse) GetObject() *RawObject { + if x != nil { + return x.Object + } + return nil +} + +func (x *ReadObjectResponse) GetSummaryJson() []byte { + if x != nil { + return x.SummaryJson + } + return nil +} + +type BatchReadObjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Batch []*ReadObjectRequest `protobuf:"bytes,3,rep,name=batch,proto3" json:"batch,omitempty"` +} + +func (x *BatchReadObjectRequest) Reset() { + *x = BatchReadObjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchReadObjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchReadObjectRequest) ProtoMessage() {} + +func (x *BatchReadObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchReadObjectRequest.ProtoReflect.Descriptor instead. +func (*BatchReadObjectRequest) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{5} +} + +func (x *BatchReadObjectRequest) GetBatch() []*ReadObjectRequest { + if x != nil { + return x.Batch + } + return nil +} + +type BatchReadObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*ReadObjectResponse `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *BatchReadObjectResponse) Reset() { + *x = BatchReadObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchReadObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchReadObjectResponse) ProtoMessage() {} + +func (x *BatchReadObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchReadObjectResponse.ProtoReflect.Descriptor instead. +func (*BatchReadObjectResponse) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{6} +} + +func (x *BatchReadObjectResponse) GetResults() []*ReadObjectResponse { + if x != nil { + return x.Results + } + return nil +} + +type WriteObjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // The raw object body + Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + // Message that can be seen when exploring object history + Comment string `protobuf:"bytes,4,opt,name=comment,proto3" json:"comment,omitempty"` + // Used for optimistic locking. If missing, the previous version will be replaced regardless + PreviousVersion string `protobuf:"bytes,6,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"` +} + +func (x *WriteObjectRequest) Reset() { + *x = WriteObjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteObjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteObjectRequest) ProtoMessage() {} + +func (x *WriteObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteObjectRequest.ProtoReflect.Descriptor instead. +func (*WriteObjectRequest) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{7} +} + +func (x *WriteObjectRequest) GetUID() string { + if x != nil { + return x.UID + } + return "" +} + +func (x *WriteObjectRequest) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *WriteObjectRequest) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *WriteObjectRequest) GetComment() string { + if x != nil { + return x.Comment + } + return "" +} + +func (x *WriteObjectRequest) GetPreviousVersion() string { + if x != nil { + return x.PreviousVersion + } + return "" +} + +type WriteObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Error info -- if exists, the save did not happen + Error *ObjectErrorInfo `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + // Object details with the body removed + Object *RawObject `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` + // Object summary as JSON + SummaryJson []byte `protobuf:"bytes,3,opt,name=summary_json,json=summaryJson,proto3" json:"summary_json,omitempty"` +} + +func (x *WriteObjectResponse) Reset() { + *x = WriteObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteObjectResponse) ProtoMessage() {} + +func (x *WriteObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[8] + 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 WriteObjectResponse.ProtoReflect.Descriptor instead. +func (*WriteObjectResponse) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{8} +} + +func (x *WriteObjectResponse) GetError() *ObjectErrorInfo { + if x != nil { + return x.Error + } + return nil +} + +func (x *WriteObjectResponse) GetObject() *RawObject { + if x != nil { + return x.Object + } + return nil +} + +func (x *WriteObjectResponse) GetSummaryJson() []byte { + if x != nil { + return x.SummaryJson + } + return nil +} + +type DeleteObjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Used for optimistic locking. If missing, the previous version will be replaced regardless + PreviousVersion string `protobuf:"bytes,3,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"` +} + +func (x *DeleteObjectRequest) Reset() { + *x = DeleteObjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteObjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteObjectRequest) ProtoMessage() {} + +func (x *DeleteObjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[9] + 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 DeleteObjectRequest.ProtoReflect.Descriptor instead. +func (*DeleteObjectRequest) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteObjectRequest) GetUID() string { + if x != nil { + return x.UID + } + return "" +} + +func (x *DeleteObjectRequest) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *DeleteObjectRequest) GetPreviousVersion() string { + if x != nil { + return x.PreviousVersion + } + return "" +} + +type DeleteObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OK bool `protobuf:"varint,1,opt,name=OK,proto3" json:"OK,omitempty"` +} + +func (x *DeleteObjectResponse) Reset() { + *x = DeleteObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteObjectResponse) ProtoMessage() {} + +func (x *DeleteObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[10] + 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 DeleteObjectResponse.ProtoReflect.Descriptor instead. +func (*DeleteObjectResponse) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteObjectResponse) GetOK() bool { + if x != nil { + return x.OK + } + return false +} + +type ObjectHistoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + UID string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"` + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Maximum number of items to return + Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + // Starting from the requested page + NextPageToken string `protobuf:"bytes,5,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ObjectHistoryRequest) Reset() { + *x = ObjectHistoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectHistoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectHistoryRequest) ProtoMessage() {} + +func (x *ObjectHistoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[11] + 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 ObjectHistoryRequest.ProtoReflect.Descriptor instead. +func (*ObjectHistoryRequest) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{11} +} + +func (x *ObjectHistoryRequest) GetUID() string { + if x != nil { + return x.UID + } + return "" +} + +func (x *ObjectHistoryRequest) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *ObjectHistoryRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ObjectHistoryRequest) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type ObjectHistoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object metadata without the raw bytes + Object []*RawObject `protobuf:"bytes,1,rep,name=object,proto3" json:"object,omitempty"` + // More results exist... pass this in the next request + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ObjectHistoryResponse) Reset() { + *x = ObjectHistoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectHistoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectHistoryResponse) ProtoMessage() {} + +func (x *ObjectHistoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[12] + 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 ObjectHistoryResponse.ProtoReflect.Descriptor instead. +func (*ObjectHistoryResponse) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{12} +} + +func (x *ObjectHistoryResponse) GetObject() []*RawObject { + if x != nil { + return x.Object + } + return nil +} + +func (x *ObjectHistoryResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +type ObjectSearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Starting from the requested page (other query parameters must match!) + NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // Maximum number of items to return + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + // Free text query string -- mileage may vary :) + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + // limit to a specific kind (empty is all) + Kind []string `protobuf:"bytes,4,rep,name=kind,proto3" json:"kind,omitempty"` + // Limit results to items in a specific folder + Folder string `protobuf:"bytes,5,opt,name=folder,proto3" json:"folder,omitempty"` + // Must match all labels + Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Sorting instructions `field ASC/DESC` + Sort []string `protobuf:"bytes,7,rep,name=sort,proto3" json:"sort,omitempty"` + // TODO, limit the set of fields we actually want returned + // Only supported in the QueryResponse flavor? + Fields []string `protobuf:"bytes,8,rep,name=fields,proto3" json:"fields,omitempty"` + // Return the full body in each payload + WithBody bool `protobuf:"varint,9,opt,name=with_body,json=withBody,proto3" json:"with_body,omitempty"` +} + +func (x *ObjectSearchRequest) Reset() { + *x = ObjectSearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectSearchRequest) ProtoMessage() {} + +func (x *ObjectSearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[13] + 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 ObjectSearchRequest.ProtoReflect.Descriptor instead. +func (*ObjectSearchRequest) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{13} +} + +func (x *ObjectSearchRequest) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ObjectSearchRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ObjectSearchRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *ObjectSearchRequest) GetKind() []string { + if x != nil { + return x.Kind + } + return nil +} + +func (x *ObjectSearchRequest) GetFolder() string { + if x != nil { + return x.Folder + } + return "" +} + +func (x *ObjectSearchRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ObjectSearchRequest) GetSort() []string { + if x != nil { + return x.Sort + } + return nil +} + +func (x *ObjectSearchRequest) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +func (x *ObjectSearchRequest) GetWithBody() bool { + if x != nil { + return x.WithBody + } + return false +} + +type ObjectSearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*RawObject `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` + // More results exist... pass this in the next request + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ObjectSearchResponse) Reset() { + *x = ObjectSearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectSearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectSearchResponse) ProtoMessage() {} + +func (x *ObjectSearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_proto_msgTypes[14] + 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 ObjectSearchResponse.ProtoReflect.Descriptor instead. +func (*ObjectSearchResponse) Descriptor() ([]byte, []int) { + return file_object_proto_rawDescGZIP(), []int{14} +} + +func (x *ObjectSearchResponse) GetResults() []*RawObject { + if x != nil { + return x.Results + } + return nil +} + +func (x *ObjectSearchResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +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, 0x30, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0xf3, 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, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x42, 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, + 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x12, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 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, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, + 0x72, 0x63, 0x18, 0x0c, 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, 0x0d, + 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, 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, 0x92, + 0x01, 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, 0x29, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x02, 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, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4a, + 0x73, 0x6f, 0x6e, 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, + 0x6a, 0x0a, 0x15, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x18, 0x01, 0x20, 0x03, 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, 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, 0xda, 0x02, 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, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, 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, 0x6b, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2b, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x61, 0x77, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 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 ( + file_object_proto_rawDescOnce sync.Once + file_object_proto_rawDescData = file_object_proto_rawDesc +) + +func file_object_proto_rawDescGZIP() []byte { + file_object_proto_rawDescOnce.Do(func() { + file_object_proto_rawDescData = protoimpl.X.CompressGZIP(file_object_proto_rawDescData) + }) + return file_object_proto_rawDescData +} + +var file_object_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_object_proto_goTypes = []interface{}{ + (*UserInfo)(nil), // 0: object.UserInfo + (*RawObject)(nil), // 1: object.RawObject + (*ObjectErrorInfo)(nil), // 2: object.ObjectErrorInfo + (*ReadObjectRequest)(nil), // 3: object.ReadObjectRequest + (*ReadObjectResponse)(nil), // 4: object.ReadObjectResponse + (*BatchReadObjectRequest)(nil), // 5: object.BatchReadObjectRequest + (*BatchReadObjectResponse)(nil), // 6: object.BatchReadObjectResponse + (*WriteObjectRequest)(nil), // 7: object.WriteObjectRequest + (*WriteObjectResponse)(nil), // 8: object.WriteObjectResponse + (*DeleteObjectRequest)(nil), // 9: object.DeleteObjectRequest + (*DeleteObjectResponse)(nil), // 10: object.DeleteObjectResponse + (*ObjectHistoryRequest)(nil), // 11: object.ObjectHistoryRequest + (*ObjectHistoryResponse)(nil), // 12: object.ObjectHistoryResponse + (*ObjectSearchRequest)(nil), // 13: object.ObjectSearchRequest + (*ObjectSearchResponse)(nil), // 14: object.ObjectSearchResponse + nil, // 15: object.ObjectSearchRequest.LabelsEntry +} +var file_object_proto_depIdxs = []int32{ + 0, // 0: object.RawObject.created_by:type_name -> object.UserInfo + 0, // 1: object.RawObject.modified_by:type_name -> object.UserInfo + 1, // 2: object.ReadObjectResponse.object:type_name -> object.RawObject + 3, // 3: object.BatchReadObjectRequest.batch:type_name -> object.ReadObjectRequest + 4, // 4: object.BatchReadObjectResponse.results:type_name -> object.ReadObjectResponse + 2, // 5: object.WriteObjectResponse.error:type_name -> object.ObjectErrorInfo + 1, // 6: object.WriteObjectResponse.object:type_name -> object.RawObject + 1, // 7: object.ObjectHistoryResponse.object:type_name -> object.RawObject + 15, // 8: object.ObjectSearchRequest.labels:type_name -> object.ObjectSearchRequest.LabelsEntry + 1, // 9: object.ObjectSearchResponse.results:type_name -> object.RawObject + 3, // 10: object.ObjectStore.Read:input_type -> object.ReadObjectRequest + 5, // 11: object.ObjectStore.BatchRead:input_type -> object.BatchReadObjectRequest + 7, // 12: object.ObjectStore.Write:input_type -> object.WriteObjectRequest + 9, // 13: object.ObjectStore.Delete:input_type -> object.DeleteObjectRequest + 11, // 14: object.ObjectStore.History:input_type -> object.ObjectHistoryRequest + 13, // 15: object.ObjectStore.Search:input_type -> object.ObjectSearchRequest + 4, // 16: object.ObjectStore.Read:output_type -> object.ReadObjectResponse + 6, // 17: object.ObjectStore.BatchRead:output_type -> object.BatchReadObjectResponse + 8, // 18: object.ObjectStore.Write:output_type -> object.WriteObjectResponse + 10, // 19: object.ObjectStore.Delete:output_type -> object.DeleteObjectResponse + 12, // 20: object.ObjectStore.History:output_type -> object.ObjectHistoryResponse + 14, // 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 +} + +func init() { file_object_proto_init() } +func file_object_proto_init() { + if File_object_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_object_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RawObject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectErrorInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadObjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadObjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchReadObjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchReadObjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteObjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteObjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteObjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteObjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectHistoryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectHistoryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectSearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectSearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_object_proto_rawDesc, + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_object_proto_goTypes, + DependencyIndexes: file_object_proto_depIdxs, + MessageInfos: file_object_proto_msgTypes, + }.Build() + File_object_proto = out.File + file_object_proto_rawDesc = nil + file_object_proto_goTypes = nil + file_object_proto_depIdxs = nil +} diff --git a/pkg/services/store/object/object.proto b/pkg/services/store/object/object.proto new file mode 100644 index 00000000000..b9eedebb787 --- /dev/null +++ b/pkg/services/store/object/object.proto @@ -0,0 +1,257 @@ +syntax = "proto3"; +package object; + +option go_package = "./;object"; + +// Will be replaced with something from the SDK +message UserInfo { + // internal grafana user ID + int64 id = 1; + + // login name + string login = 2; // string ID? +} + +// The canonical object/document data -- this represents the raw bytes and storage level metadata +message RawObject { + // Unique ID + string UID = 1; + + // Identify the object kind. This kind will be used to apply a schema to the body and + // will trigger additional indexing behavior. + string kind = 2; + + // Time in epoch milliseconds that the object was created + int64 created = 3; + + // Time in epoch milliseconds that the object was modified + int64 modified = 4; + + // Who created the object + UserInfo created_by = 5; + + // Who modified the object + UserInfo modified_by = 6; + + // Content Length + int64 size = 7; + + // MD5 digest of the body + string ETag = 8; + + // Raw bytes of the storage object. The kind will determine what is a valid payload + bytes body = 9; + + // The version will change when the object is saved. It is not necessarily sortable + // + // NOTE: currently managed by the dashboard+dashboard_version tables + string version = 10; + + // optional "save" or "commit" message + // + // NOTE: currently managed by the dashboard_version table, and will be returned from a "history" command + string comment = 11; + + // Location (path/repo/etc) that defines the canonocal form + // + // NOTE: currently managed by the dashboard_provisioning table + string sync_src = 12; + + // 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 = 13; +} + +// Report error while working with objects +// NOTE: real systems at scale will contain errors. +message ObjectErrorInfo { + // Match an error code registry? + int64 code = 1; + + // Simple error display + string message = 2; + + // Details encoded in JSON + bytes details_json = 3; +} + +//----------------------------------------------- +// Get request/response +//----------------------------------------------- + +message ReadObjectRequest { + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string UID = 1; + + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string kind = 2; + + // Fetch an explicit version + string version = 3; + + // Include the full body bytes + bool with_body = 4; + + // Include derived summary metadata + bool with_summary = 5; +} + +message ReadObjectResponse { + // Object details with the body removed + RawObject object = 1; + + // Object summary as JSON + bytes summary_json = 2; +} + +//------------------------------------------------------ +// Make many read requests at once (by Kind+ID+version) +//------------------------------------------------------ + +message BatchReadObjectRequest { + repeated ReadObjectRequest batch = 3; +} + +message BatchReadObjectResponse { + repeated ReadObjectResponse results = 1; +} + +//----------------------------------------------- +// Write request/response +//----------------------------------------------- + +message WriteObjectRequest { + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string UID = 1; + + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string kind = 2; + + // The raw object body + bytes body = 3; + + // Message that can be seen when exploring object history + string comment = 4; + + // Used for optimistic locking. If missing, the previous version will be replaced regardless + string previous_version = 6; +} + +message WriteObjectResponse { + // Error info -- if exists, the save did not happen + ObjectErrorInfo error = 1; + + // Object details with the body removed + RawObject object = 2; + + // Object summary as JSON + bytes summary_json = 3; +} + +//----------------------------------------------- +// Delete request/response +//----------------------------------------------- + +message DeleteObjectRequest { + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string UID = 1; + + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string kind = 2; + + // Used for optimistic locking. If missing, the previous version will be replaced regardless + string previous_version = 3; +} + +message DeleteObjectResponse { + bool OK = 1; +} + +//----------------------------------------------- +// History request/response +//----------------------------------------------- + +message ObjectHistoryRequest { + // Unique ID (Kind is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string UID = 1; + + // Object kind (UID is also required) NOTE: UID+kind will likely be replaced with GRN that encodes both + string kind = 2; + + // Maximum number of items to return + int64 limit = 3; + + // Starting from the requested page + string next_page_token = 5; +} + +message ObjectHistoryResponse { + // Object metadata without the raw bytes + repeated RawObject object = 1; + + // More results exist... pass this in the next request + string next_page_token = 2; +} + + +//----------------------------------------------- +// List request/response +//----------------------------------------------- + +message ObjectSearchRequest { + // Starting from the requested page (other query parameters must match!) + string next_page_token = 1; + + // Maximum number of items to return + int64 limit = 2; + + // Free text query string -- mileage may vary :) + string query = 3; + + // limit to a specific kind (empty is all) + repeated string kind = 4; + + // Limit results to items in a specific folder + string folder = 5; + + // Must match all labels + map labels = 6; + + // Sorting instructions `field ASC/DESC` + repeated string sort = 7; + + // TODO, limit the set of fields we actually want returned + // Only supported in the QueryResponse flavor? + repeated string fields = 8; + + // Return the full body in each payload + bool with_body = 9; +} + +message ObjectSearchResponse { + repeated RawObject results = 1; + + // More results exist... pass this in the next request + string next_page_token = 2; +} + + +//----------------------------------------------- +// Storage interface +//----------------------------------------------- + +// This assumes a future grpc interface where the user info is passed in context, not in each message body +// for now it will only work with an admin API key +service ObjectStore { + rpc Read(ReadObjectRequest) returns (ReadObjectResponse); + rpc BatchRead(BatchReadObjectRequest) returns (BatchReadObjectResponse); + rpc Write(WriteObjectRequest) returns (WriteObjectResponse); + rpc Delete(DeleteObjectRequest) returns (DeleteObjectResponse); + rpc History(ObjectHistoryRequest) returns (ObjectHistoryResponse); + rpc Search(ObjectSearchRequest) returns (ObjectSearchResponse); + +// Ideally an additional search endpoint with more flexibility to limit what you actually care about +// https://github.com/grafana/grafana-plugin-sdk-go/blob/main/proto/backend.proto#L129 +// rpc SearchEX(ObjectSearchRequest) returns (DataResponse); +} diff --git a/pkg/services/store/object/object_grpc.pb.go b/pkg/services/store/object/object_grpc.pb.go new file mode 100644 index 00000000000..1a4887e7353 --- /dev/null +++ b/pkg/services/store/object/object_grpc.pb.go @@ -0,0 +1,283 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.5 +// source: object.proto + +package object + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ObjectStoreClient is the client API for ObjectStore service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ObjectStoreClient interface { + Read(ctx context.Context, in *ReadObjectRequest, opts ...grpc.CallOption) (*ReadObjectResponse, error) + BatchRead(ctx context.Context, in *BatchReadObjectRequest, opts ...grpc.CallOption) (*BatchReadObjectResponse, error) + Write(ctx context.Context, in *WriteObjectRequest, opts ...grpc.CallOption) (*WriteObjectResponse, error) + Delete(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*DeleteObjectResponse, error) + History(ctx context.Context, in *ObjectHistoryRequest, opts ...grpc.CallOption) (*ObjectHistoryResponse, error) + Search(ctx context.Context, in *ObjectSearchRequest, opts ...grpc.CallOption) (*ObjectSearchResponse, error) +} + +type objectStoreClient struct { + cc grpc.ClientConnInterface +} + +func NewObjectStoreClient(cc grpc.ClientConnInterface) ObjectStoreClient { + return &objectStoreClient{cc} +} + +func (c *objectStoreClient) Read(ctx context.Context, in *ReadObjectRequest, opts ...grpc.CallOption) (*ReadObjectResponse, error) { + out := new(ReadObjectResponse) + err := c.cc.Invoke(ctx, "/object.ObjectStore/Read", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectStoreClient) BatchRead(ctx context.Context, in *BatchReadObjectRequest, opts ...grpc.CallOption) (*BatchReadObjectResponse, error) { + out := new(BatchReadObjectResponse) + err := c.cc.Invoke(ctx, "/object.ObjectStore/BatchRead", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectStoreClient) Write(ctx context.Context, in *WriteObjectRequest, opts ...grpc.CallOption) (*WriteObjectResponse, error) { + out := new(WriteObjectResponse) + err := c.cc.Invoke(ctx, "/object.ObjectStore/Write", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectStoreClient) Delete(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*DeleteObjectResponse, error) { + out := new(DeleteObjectResponse) + err := c.cc.Invoke(ctx, "/object.ObjectStore/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectStoreClient) History(ctx context.Context, in *ObjectHistoryRequest, opts ...grpc.CallOption) (*ObjectHistoryResponse, error) { + out := new(ObjectHistoryResponse) + err := c.cc.Invoke(ctx, "/object.ObjectStore/History", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *objectStoreClient) Search(ctx context.Context, in *ObjectSearchRequest, opts ...grpc.CallOption) (*ObjectSearchResponse, error) { + out := new(ObjectSearchResponse) + err := c.cc.Invoke(ctx, "/object.ObjectStore/Search", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ObjectStoreServer is the server API for ObjectStore service. +// All implementations should embed UnimplementedObjectStoreServer +// for forward compatibility +type ObjectStoreServer interface { + Read(context.Context, *ReadObjectRequest) (*ReadObjectResponse, error) + BatchRead(context.Context, *BatchReadObjectRequest) (*BatchReadObjectResponse, error) + Write(context.Context, *WriteObjectRequest) (*WriteObjectResponse, error) + Delete(context.Context, *DeleteObjectRequest) (*DeleteObjectResponse, error) + History(context.Context, *ObjectHistoryRequest) (*ObjectHistoryResponse, error) + Search(context.Context, *ObjectSearchRequest) (*ObjectSearchResponse, error) +} + +// UnimplementedObjectStoreServer should be embedded to have forward compatible implementations. +type UnimplementedObjectStoreServer struct { +} + +func (UnimplementedObjectStoreServer) Read(context.Context, *ReadObjectRequest) (*ReadObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") +} +func (UnimplementedObjectStoreServer) BatchRead(context.Context, *BatchReadObjectRequest) (*BatchReadObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchRead not implemented") +} +func (UnimplementedObjectStoreServer) Write(context.Context, *WriteObjectRequest) (*WriteObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") +} +func (UnimplementedObjectStoreServer) Delete(context.Context, *DeleteObjectRequest) (*DeleteObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedObjectStoreServer) History(context.Context, *ObjectHistoryRequest) (*ObjectHistoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method History not implemented") +} +func (UnimplementedObjectStoreServer) Search(context.Context, *ObjectSearchRequest) (*ObjectSearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") +} + +// UnsafeObjectStoreServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ObjectStoreServer will +// result in compilation errors. +type UnsafeObjectStoreServer interface { + mustEmbedUnimplementedObjectStoreServer() +} + +func RegisterObjectStoreServer(s grpc.ServiceRegistrar, srv ObjectStoreServer) { + s.RegisterService(&ObjectStore_ServiceDesc, srv) +} + +func _ObjectStore_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectStoreServer).Read(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/object.ObjectStore/Read", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectStoreServer).Read(ctx, req.(*ReadObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectStore_BatchRead_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchReadObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectStoreServer).BatchRead(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/object.ObjectStore/BatchRead", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectStoreServer).BatchRead(ctx, req.(*BatchReadObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectStore_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectStoreServer).Write(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/object.ObjectStore/Write", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectStoreServer).Write(ctx, req.(*WriteObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectStore_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectStoreServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/object.ObjectStore/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectStoreServer).Delete(ctx, req.(*DeleteObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectStore_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectHistoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectStoreServer).History(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/object.ObjectStore/History", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectStoreServer).History(ctx, req.(*ObjectHistoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ObjectStore_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectSearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectStoreServer).Search(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/object.ObjectStore/Search", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectStoreServer).Search(ctx, req.(*ObjectSearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ObjectStore_ServiceDesc is the grpc.ServiceDesc for ObjectStore service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ObjectStore_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "object.ObjectStore", + HandlerType: (*ObjectStoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Read", + Handler: _ObjectStore_Read_Handler, + }, + { + MethodName: "BatchRead", + Handler: _ObjectStore_BatchRead_Handler, + }, + { + MethodName: "Write", + Handler: _ObjectStore_Write_Handler, + }, + { + MethodName: "Delete", + Handler: _ObjectStore_Delete_Handler, + }, + { + MethodName: "History", + Handler: _ObjectStore_History_Handler, + }, + { + MethodName: "Search", + Handler: _ObjectStore_Search_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "object.proto", +} diff --git a/pkg/services/store/object/summary.go b/pkg/services/store/object/summary.go index 895e469237d..d19d3a6448c 100644 --- a/pkg/services/store/object/summary.go +++ b/pkg/services/store/object/summary.go @@ -24,6 +24,20 @@ type ObjectSummary struct { _ interface{} } +// Reference to another object outside itself +// This message is derived from the object body and can be used to search for references. +// This does not represent a method to declare a reference to another object. +type ExternalReference struct { + // datasource (instance), dashboard (instance), + Kind string `json:"kind,omitempty"` + + // prometheus / heatmap, heatamp|prometheus + Type string `json:"type,omitempty"` // flavor + + // Unique ID for this object + UID string `json:"UID,omitempty"` +} + // ObjectSummaryBuilder will read an object and create the summary. // This should not include values that depend on system state, only the raw object type ObjectSummaryBuilder = func(obj *RawObject) (ObjectSummary, error)