From 970c43cd29b6f9b4927153a71504ad9e9893c165 Mon Sep 17 00:00:00 2001 From: Abduh Date: Thu, 31 Mar 2022 10:59:15 +0700 Subject: [PATCH] feat(grpc): add asset, search, lineage (#103) * feat(grpc): add asset, search, lineage * fix(test): increase coverage --- Makefile | 4 +- api/api.go | 10 + api/httpapi/handlers/asset_handler_test.go | 12 +- api/proto/odpf/compass/v1beta1/service.pb.go | 4338 +++++++++++---- .../odpf/compass/v1beta1/service.pb.gw.go | 1133 +++- .../compass/v1beta1/service.pb.validate.go | 4830 +++++++++++++++-- .../odpf/compass/v1beta1/service_grpc.pb.go | 427 +- api/v1beta1/asset.go | 370 ++ api/v1beta1/asset_test.go | 1138 ++++ api/v1beta1/comment.go | 9 +- api/v1beta1/comment_test.go | 206 +- api/v1beta1/discussion.go | 11 +- api/v1beta1/discussion_test.go | 174 +- api/v1beta1/handler.go | 22 +- api/v1beta1/handler_test.go | 42 +- api/v1beta1/lineage.go | 28 + api/v1beta1/lineage_test.go | 70 + api/v1beta1/search.go | 106 + api/v1beta1/search_test.go | 365 ++ asset/asset.go | 161 +- asset/asset_test.go | 188 + asset/version.go | 74 +- buf.gen.yaml | 3 +- cmd/serve.go | 37 +- discovery/model.go | 13 + discovery/repo.go | 3 +- discussion/comment.go | 15 +- go.mod | 1 + lib/mocks/asset_repository.go | 214 +- lib/mocks/discovery_record_searcher.go | 117 + lib/mocks/discovery_repository.go | 58 +- lib/mocks/discussion_repository.go | 18 +- lib/mocks/lineage_repository.go | 60 +- lib/mocks/star_repository.go | 160 +- lib/mocks/tag_repository.go | 106 +- lib/mocks/tag_template_repository.go | 130 +- lib/mocks/user_repository.go | 58 +- lineage/graph.go | 55 +- lineage/repo.go | 2 +- star/star.go | 2 +- store/elasticsearch/discovery_repository.go | 1 + store/elasticsearch/search.go | 3 + store/postgres/asset_model.go | 8 +- store/postgres/asset_repository.go | 2 +- store/postgres/asset_repository_test.go | 2 +- tag/tag.go | 2 +- tag/tag_template.go | 2 +- third_party/OpenAPI/compass.swagger.json | 1198 +++- user/user.go | 46 +- user/user_test.go | 73 + 50 files changed, 14064 insertions(+), 2043 deletions(-) create mode 100644 api/v1beta1/asset.go create mode 100644 api/v1beta1/asset_test.go create mode 100644 api/v1beta1/lineage.go create mode 100644 api/v1beta1/lineage_test.go create mode 100644 api/v1beta1/search.go create mode 100644 api/v1beta1/search_test.go create mode 100644 lib/mocks/discovery_record_searcher.go diff --git a/Makefile b/Makefile index 5c1b1695..0ff1f904 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ NAME="github.com/odpf/columbus" VERSION=$(shell git describe --always --tags 2>/dev/null) COVERFILE="/tmp/columbus.coverprofile" -PROTON_COMMIT := "cdb580faf1f9cc5f0043ef1f8980dd8ac4e04679" +PROTON_COMMIT := "c3146a25d9f321bc721d94dbdf3aec8483a3cb03" .PHONY: all build test clean install proto @@ -24,7 +24,7 @@ dist: lint: golangci-lint run - + proto: ## Generate the protobuf files @echo " > generating protobuf from odpf/proton" @echo " > [info] make sure correct version of dependencies are installed using 'make install'" diff --git a/api/api.go b/api/api.go index 4add6543..6bbee3f5 100644 --- a/api/api.go +++ b/api/api.go @@ -109,6 +109,16 @@ func NewGRPCHandler(l log.Logger, deps *Dependencies) *v1beta1.Handler { return &v1beta1.Handler{ Logger: l, DiscussionRepository: deps.DiscussionRepository, + AssetRepository: deps.AssetRepository, + LineageRepository: deps.LineageRepository, + StarRepository: deps.StarRepository, + UserService: deps.UserService, + TagService: deps.TagService, + TagTemplateService: deps.TagTemplateService, + DiscoveryRepository: deps.DiscoveryRepository, + + //deprecated + DiscoveryService: deps.DiscoveryService, } } diff --git a/api/httpapi/handlers/asset_handler_test.go b/api/httpapi/handlers/asset_handler_test.go index a84455ba..869bf12c 100644 --- a/api/httpapi/handlers/asset_handler_test.go +++ b/api/httpapi/handlers/asset_handler_test.go @@ -905,14 +905,14 @@ func TestAssetHandlerGetVersionHistory(t *testing.T) { Description: `should return http 400 if asset id is not uuid`, ExpectStatus: http.StatusBadRequest, Setup: func(ctx context.Context, ar *mocks.AssetRepository) { - ar.On("GetVersionHistory", ctx, asset.Config{}, assetID).Return([]asset.AssetVersion{}, asset.InvalidError{AssetID: assetID}) + ar.On("GetVersionHistory", ctx, asset.Config{}, assetID).Return([]asset.Asset{}, asset.InvalidError{AssetID: assetID}) }, }, { Description: `should return http 500 if fetching fails`, ExpectStatus: http.StatusInternalServerError, Setup: func(ctx context.Context, ar *mocks.AssetRepository) { - ar.On("GetVersionHistory", ctx, asset.Config{}, assetID).Return([]asset.AssetVersion{}, errors.New("unknown error")) + ar.On("GetVersionHistory", ctx, asset.Config{}, assetID).Return([]asset.Asset{}, errors.New("unknown error")) }, }, { @@ -923,24 +923,24 @@ func TestAssetHandlerGetVersionHistory(t *testing.T) { ar.On("GetVersionHistory", ctx, asset.Config{ Size: 30, Offset: 50, - }, assetID).Return([]asset.AssetVersion{}, nil, nil) + }, assetID).Return([]asset.Asset{}, nil, nil) }, }, { Description: "should return http 200 status along with list of asset versions", ExpectStatus: http.StatusOK, Setup: func(ctx context.Context, ar *mocks.AssetRepository) { - ar.On("GetVersionHistory", ctx, asset.Config{}, assetID).Return([]asset.AssetVersion{ + ar.On("GetVersionHistory", ctx, asset.Config{}, assetID).Return([]asset.Asset{ {ID: "testid-1"}, {ID: "testid-2"}, }, nil, nil) }, PostCheck: func(r *http.Response) error { - expected := []asset.AssetVersion{ + expected := []asset.Asset{ {ID: "testid-1"}, {ID: "testid-2"}, } - var actual []asset.AssetVersion + var actual []asset.Asset err := json.NewDecoder(r.Body).Decode(&actual) if err != nil { return fmt.Errorf("error reading response body: %w", err) diff --git a/api/proto/odpf/compass/v1beta1/service.pb.go b/api/proto/odpf/compass/v1beta1/service.pb.go index 6ba4a2bb..f2e9dcd4 100644 --- a/api/proto/odpf/compass/v1beta1/service.pb.go +++ b/api/proto/odpf/compass/v1beta1/service.pb.go @@ -12,9 +12,9 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" structpb "google.golang.org/protobuf/types/known/structpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" ) @@ -26,61 +26,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type Asset_Type int32 - -const ( - Asset_TYPE_UNSPECIFIED Asset_Type = 0 - Asset_TYPE_TABLE Asset_Type = 1 - Asset_TYPE_JOB Asset_Type = 2 - Asset_TYPE_TOPIC Asset_Type = 3 - Asset_TYPE_DASHBOARD Asset_Type = 4 -) - -// Enum value maps for Asset_Type. -var ( - Asset_Type_name = map[int32]string{ - 0: "TYPE_UNSPECIFIED", - 1: "TYPE_TABLE", - 2: "TYPE_JOB", - 3: "TYPE_TOPIC", - 4: "TYPE_DASHBOARD", - } - Asset_Type_value = map[string]int32{ - "TYPE_UNSPECIFIED": 0, - "TYPE_TABLE": 1, - "TYPE_JOB": 2, - "TYPE_TOPIC": 3, - "TYPE_DASHBOARD": 4, - } -) - -func (x Asset_Type) Enum() *Asset_Type { - p := new(Asset_Type) - *p = x - return p -} - -func (x Asset_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Asset_Type) Descriptor() protoreflect.EnumDescriptor { - return file_odpf_compass_v1beta1_service_proto_enumTypes[0].Descriptor() -} - -func (Asset_Type) Type() protoreflect.EnumType { - return &file_odpf_compass_v1beta1_service_proto_enumTypes[0] -} - -func (x Asset_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Asset_Type.Descriptor instead. -func (Asset_Type) EnumDescriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{18, 0} -} - type GetAllDiscussionsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -641,6 +586,44 @@ func (x *CreateCommentRequest) GetBody() string { return "" } +type PatchDiscussionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PatchDiscussionResponse) Reset() { + *x = PatchDiscussionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchDiscussionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchDiscussionResponse) ProtoMessage() {} + +func (x *PatchDiscussionResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_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 PatchDiscussionResponse.ProtoReflect.Descriptor instead. +func (*PatchDiscussionResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{8} +} + type CreateCommentResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -652,7 +635,7 @@ type CreateCommentResponse struct { func (x *CreateCommentResponse) Reset() { *x = CreateCommentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[8] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -665,7 +648,7 @@ func (x *CreateCommentResponse) String() string { func (*CreateCommentResponse) ProtoMessage() {} func (x *CreateCommentResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[8] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -678,7 +661,7 @@ func (x *CreateCommentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateCommentResponse.ProtoReflect.Descriptor instead. func (*CreateCommentResponse) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{8} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{9} } func (x *CreateCommentResponse) GetId() string { @@ -703,7 +686,7 @@ type GetAllCommentsRequest struct { func (x *GetAllCommentsRequest) Reset() { *x = GetAllCommentsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[9] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -716,7 +699,7 @@ func (x *GetAllCommentsRequest) String() string { func (*GetAllCommentsRequest) ProtoMessage() {} func (x *GetAllCommentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[9] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -729,7 +712,7 @@ func (x *GetAllCommentsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllCommentsRequest.ProtoReflect.Descriptor instead. func (*GetAllCommentsRequest) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{9} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{10} } func (x *GetAllCommentsRequest) GetDiscussionId() string { @@ -778,7 +761,7 @@ type GetAllCommentsResponse struct { func (x *GetAllCommentsResponse) Reset() { *x = GetAllCommentsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[10] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -791,7 +774,7 @@ func (x *GetAllCommentsResponse) String() string { func (*GetAllCommentsResponse) ProtoMessage() {} func (x *GetAllCommentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[10] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -804,7 +787,7 @@ func (x *GetAllCommentsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllCommentsResponse.ProtoReflect.Descriptor instead. func (*GetAllCommentsResponse) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{10} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{11} } func (x *GetAllCommentsResponse) GetData() []*Comment { @@ -826,7 +809,7 @@ type GetCommentRequest struct { func (x *GetCommentRequest) Reset() { *x = GetCommentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[11] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -839,7 +822,7 @@ func (x *GetCommentRequest) String() string { func (*GetCommentRequest) ProtoMessage() {} func (x *GetCommentRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[11] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -852,7 +835,7 @@ func (x *GetCommentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCommentRequest.ProtoReflect.Descriptor instead. func (*GetCommentRequest) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{11} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{12} } func (x *GetCommentRequest) GetDiscussionId() string { @@ -880,7 +863,7 @@ type GetCommentResponse struct { func (x *GetCommentResponse) Reset() { *x = GetCommentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[12] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -893,7 +876,7 @@ func (x *GetCommentResponse) String() string { func (*GetCommentResponse) ProtoMessage() {} func (x *GetCommentResponse) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[12] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -906,7 +889,7 @@ func (x *GetCommentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCommentResponse.ProtoReflect.Descriptor instead. func (*GetCommentResponse) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{12} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{13} } func (x *GetCommentResponse) GetData() *Comment { @@ -929,7 +912,7 @@ type UpdateCommentRequest struct { func (x *UpdateCommentRequest) Reset() { *x = UpdateCommentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[13] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -942,7 +925,7 @@ func (x *UpdateCommentRequest) String() string { func (*UpdateCommentRequest) ProtoMessage() {} func (x *UpdateCommentRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[13] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -955,7 +938,7 @@ func (x *UpdateCommentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateCommentRequest.ProtoReflect.Descriptor instead. func (*UpdateCommentRequest) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{13} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{14} } func (x *UpdateCommentRequest) GetDiscussionId() string { @@ -979,6 +962,44 @@ func (x *UpdateCommentRequest) GetBody() string { return "" } +type UpdateCommentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateCommentResponse) Reset() { + *x = UpdateCommentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCommentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCommentResponse) ProtoMessage() {} + +func (x *UpdateCommentResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[15] + 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 UpdateCommentResponse.ProtoReflect.Descriptor instead. +func (*UpdateCommentResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{15} +} + type DeleteCommentRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -991,7 +1012,7 @@ type DeleteCommentRequest struct { func (x *DeleteCommentRequest) Reset() { *x = DeleteCommentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[14] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1004,7 +1025,7 @@ func (x *DeleteCommentRequest) String() string { func (*DeleteCommentRequest) ProtoMessage() {} func (x *DeleteCommentRequest) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[14] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1017,7 +1038,7 @@ func (x *DeleteCommentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteCommentRequest.ProtoReflect.Descriptor instead. func (*DeleteCommentRequest) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{14} + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{16} } func (x *DeleteCommentRequest) GetDiscussionId() string { @@ -1034,36 +1055,74 @@ func (x *DeleteCommentRequest) GetId() string { return "" } -type User struct { +type DeleteCommentResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields +} - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Provider string `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +func (x *DeleteCommentResponse) Reset() { + *x = DeleteCommentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (x *User) Reset() { - *x = User{} +func (x *DeleteCommentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCommentResponse) ProtoMessage() {} + +func (x *DeleteCommentResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[17] + 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 DeleteCommentResponse.ProtoReflect.Descriptor instead. +func (*DeleteCommentResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{17} +} + +type SearchAssetsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` + Rankby string `protobuf:"bytes,2,opt,name=rankby,proto3" json:"rankby,omitempty"` + Searchby string `protobuf:"bytes,3,opt,name=searchby,proto3" json:"searchby,omitempty"` + Size uint32 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Filter map[string]string `protobuf:"bytes,5,rep,name=filter,proto3" json:"filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Query map[string]string `protobuf:"bytes,6,rep,name=query,proto3" json:"query,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *SearchAssetsRequest) Reset() { + *x = SearchAssetsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[15] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *User) String() string { +func (x *SearchAssetsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*User) ProtoMessage() {} +func (*SearchAssetsRequest) ProtoMessage() {} -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[15] +func (x *SearchAssetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1074,78 +1133,78 @@ func (x *User) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{15} +// Deprecated: Use SearchAssetsRequest.ProtoReflect.Descriptor instead. +func (*SearchAssetsRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{18} } -func (x *User) GetId() string { +func (x *SearchAssetsRequest) GetText() string { if x != nil { - return x.Id + return x.Text } return "" } -func (x *User) GetUuid() string { +func (x *SearchAssetsRequest) GetRankby() string { if x != nil { - return x.Uuid + return x.Rankby } return "" } -func (x *User) GetEmail() string { +func (x *SearchAssetsRequest) GetSearchby() string { if x != nil { - return x.Email + return x.Searchby } return "" } -func (x *User) GetProvider() string { +func (x *SearchAssetsRequest) GetSize() uint32 { if x != nil { - return x.Provider + return x.Size } - return "" + return 0 } -func (x *User) GetCreatedAt() *timestamppb.Timestamp { +func (x *SearchAssetsRequest) GetFilter() map[string]string { if x != nil { - return x.CreatedAt + return x.Filter } return nil } -func (x *User) GetUpdatedAt() *timestamppb.Timestamp { +func (x *SearchAssetsRequest) GetQuery() map[string]string { if x != nil { - return x.UpdatedAt + return x.Query } return nil } -type Changelog struct { +type SearchAssetsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Changes []*Change `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"` + Data []*Asset `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` } -func (x *Changelog) Reset() { - *x = Changelog{} +func (x *SearchAssetsResponse) Reset() { + *x = SearchAssetsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[16] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Changelog) String() string { +func (x *SearchAssetsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Changelog) ProtoMessage() {} +func (*SearchAssetsResponse) ProtoMessage() {} -func (x *Changelog) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[16] +func (x *SearchAssetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1156,47 +1215,48 @@ func (x *Changelog) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Changelog.ProtoReflect.Descriptor instead. -func (*Changelog) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{16} +// Deprecated: Use SearchAssetsResponse.ProtoReflect.Descriptor instead. +func (*SearchAssetsResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{19} } -func (x *Changelog) GetChanges() []*Change { +func (x *SearchAssetsResponse) GetData() []*Asset { if x != nil { - return x.Changes + return x.Data } return nil } -type Change struct { +type SuggestAssetsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Path []string `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` - From *structpb.Struct `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"` - To *structpb.Struct `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` - Parent *structpb.Struct `protobuf:"bytes,5,opt,name=parent,proto3" json:"parent,omitempty"` + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` + Rankby string `protobuf:"bytes,2,opt,name=rankby,proto3" json:"rankby,omitempty"` + Searchby string `protobuf:"bytes,3,opt,name=searchby,proto3" json:"searchby,omitempty"` + Size uint32 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Filter map[string]string `protobuf:"bytes,5,rep,name=filter,proto3" json:"filter,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Query map[string]string `protobuf:"bytes,6,rep,name=query,proto3" json:"query,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *Change) Reset() { - *x = Change{} +func (x *SuggestAssetsRequest) Reset() { + *x = SuggestAssetsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[17] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Change) String() string { +func (x *SuggestAssetsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Change) ProtoMessage() {} +func (*SuggestAssetsRequest) ProtoMessage() {} -func (x *Change) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[17] +func (x *SuggestAssetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1207,84 +1267,78 @@ func (x *Change) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Change.ProtoReflect.Descriptor instead. -func (*Change) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{17} +// Deprecated: Use SuggestAssetsRequest.ProtoReflect.Descriptor instead. +func (*SuggestAssetsRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{20} } -func (x *Change) GetType() string { +func (x *SuggestAssetsRequest) GetText() string { if x != nil { - return x.Type + return x.Text } return "" } -func (x *Change) GetPath() []string { +func (x *SuggestAssetsRequest) GetRankby() string { if x != nil { - return x.Path + return x.Rankby } - return nil + return "" } -func (x *Change) GetFrom() *structpb.Struct { +func (x *SuggestAssetsRequest) GetSearchby() string { if x != nil { - return x.From + return x.Searchby } - return nil + return "" } -func (x *Change) GetTo() *structpb.Struct { +func (x *SuggestAssetsRequest) GetSize() uint32 { if x != nil { - return x.To + return x.Size + } + return 0 +} + +func (x *SuggestAssetsRequest) GetFilter() map[string]string { + if x != nil { + return x.Filter } return nil } -func (x *Change) GetParent() *structpb.Struct { +func (x *SuggestAssetsRequest) GetQuery() map[string]string { if x != nil { - return x.Parent + return x.Query } return nil } -type Asset struct { +type SuggestAssetsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Urn string `protobuf:"bytes,2,opt,name=urn,proto3" json:"urn,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Service string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` - Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - Data *structpb.Struct `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` - Labels *structpb.Struct `protobuf:"bytes,8,opt,name=labels,proto3" json:"labels,omitempty"` - Owners []*User `protobuf:"bytes,9,rep,name=owners,proto3" json:"owners,omitempty"` - Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"` - UpdatedBy *User `protobuf:"bytes,11,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` - Changelog *Changelog `protobuf:"bytes,12,opt,name=changelog,proto3" json:"changelog,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Data []string `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` } -func (x *Asset) Reset() { - *x = Asset{} +func (x *SuggestAssetsResponse) Reset() { + *x = SuggestAssetsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[18] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Asset) String() string { +func (x *SuggestAssetsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Asset) ProtoMessage() {} +func (*SuggestAssetsResponse) ProtoMessage() {} -func (x *Asset) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[18] +func (x *SuggestAssetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1295,144 +1349,225 @@ func (x *Asset) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Asset.ProtoReflect.Descriptor instead. -func (*Asset) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{18} +// Deprecated: Use SuggestAssetsResponse.ProtoReflect.Descriptor instead. +func (*SuggestAssetsResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{21} } -func (x *Asset) GetId() string { +func (x *SuggestAssetsResponse) GetData() []string { if x != nil { - return x.Id + return x.Data } - return "" + return nil } -func (x *Asset) GetUrn() string { - if x != nil { - return x.Urn +type GetGraphRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Urn string `protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty"` +} + +func (x *GetGraphRequest) Reset() { + *x = GetGraphRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (x *Asset) GetType() string { - if x != nil { - return x.Type +func (x *GetGraphRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGraphRequest) ProtoMessage() {} + +func (x *GetGraphRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *Asset) GetService() string { +// Deprecated: Use GetGraphRequest.ProtoReflect.Descriptor instead. +func (*GetGraphRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{22} +} + +func (x *GetGraphRequest) GetUrn() string { if x != nil { - return x.Service + return x.Urn } return "" } -func (x *Asset) GetName() string { - if x != nil { - return x.Name +type GetGraphResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*LineageEdge `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetGraphResponse) Reset() { + *x = GetGraphResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (x *Asset) GetDescription() string { - if x != nil { - return x.Description +func (x *GetGraphResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGraphResponse) ProtoMessage() {} + +func (x *GetGraphResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *Asset) GetData() *structpb.Struct { +// Deprecated: Use GetGraphResponse.ProtoReflect.Descriptor instead. +func (*GetGraphResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{23} +} + +func (x *GetGraphResponse) GetData() []*LineageEdge { if x != nil { return x.Data } return nil } -func (x *Asset) GetLabels() *structpb.Struct { - if x != nil { - return x.Labels +type GetAllAssetsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Service string `protobuf:"bytes,3,opt,name=service,proto3" json:"service,omitempty"` + Size uint32 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + Offset uint32 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` + WithTotal bool `protobuf:"varint,6,opt,name=with_total,json=withTotal,proto3" json:"with_total,omitempty"` +} + +func (x *GetAllAssetsRequest) Reset() { + *x = GetAllAssetsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *Asset) GetOwners() []*User { +func (x *GetAllAssetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllAssetsRequest) ProtoMessage() {} + +func (x *GetAllAssetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[24] + 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 GetAllAssetsRequest.ProtoReflect.Descriptor instead. +func (*GetAllAssetsRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{24} +} + +func (x *GetAllAssetsRequest) GetText() string { if x != nil { - return x.Owners + return x.Text } - return nil + return "" } -func (x *Asset) GetVersion() string { +func (x *GetAllAssetsRequest) GetType() string { if x != nil { - return x.Version + return x.Type } return "" } -func (x *Asset) GetUpdatedBy() *User { +func (x *GetAllAssetsRequest) GetService() string { if x != nil { - return x.UpdatedBy + return x.Service } - return nil + return "" } -func (x *Asset) GetChangelog() *Changelog { +func (x *GetAllAssetsRequest) GetSize() uint32 { if x != nil { - return x.Changelog + return x.Size } - return nil + return 0 } -func (x *Asset) GetCreatedAt() *timestamppb.Timestamp { +func (x *GetAllAssetsRequest) GetOffset() uint32 { if x != nil { - return x.CreatedAt + return x.Offset } - return nil + return 0 } -func (x *Asset) GetUpdatedAt() *timestamppb.Timestamp { +func (x *GetAllAssetsRequest) GetWithTotal() bool { if x != nil { - return x.UpdatedAt + return x.WithTotal } - return nil + return false } -type Discussion struct { +type GetAllAssetsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` - Labels []string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty"` - Assets []string `protobuf:"bytes,7,rep,name=assets,proto3" json:"assets,omitempty"` - Assignees []string `protobuf:"bytes,8,rep,name=assignees,proto3" json:"assignees,omitempty"` - Owner *User `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Data []*Asset `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + Total uint32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` } -func (x *Discussion) Reset() { - *x = Discussion{} +func (x *GetAllAssetsResponse) Reset() { + *x = GetAllAssetsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[19] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Discussion) String() string { +func (x *GetAllAssetsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Discussion) ProtoMessage() {} +func (*GetAllAssetsResponse) ProtoMessage() {} -func (x *Discussion) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[19] +func (x *GetAllAssetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1443,725 +1578,2991 @@ func (x *Discussion) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Discussion.ProtoReflect.Descriptor instead. -func (*Discussion) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{19} +// Deprecated: Use GetAllAssetsResponse.ProtoReflect.Descriptor instead. +func (*GetAllAssetsResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{25} } -func (x *Discussion) GetId() string { +func (x *GetAllAssetsResponse) GetData() []*Asset { if x != nil { - return x.Id + return x.Data } - return "" + return nil } -func (x *Discussion) GetTitle() string { +func (x *GetAllAssetsResponse) GetTotal() uint32 { if x != nil { - return x.Title + return x.Total } - return "" + return 0 } -func (x *Discussion) GetBody() string { - if x != nil { - return x.Body +type GetAssetByIDRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetAssetByIDRequest) Reset() { + *x = GetAssetByIDRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (x *Discussion) GetType() string { - if x != nil { - return x.Type +func (x *GetAssetByIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetByIDRequest) ProtoMessage() {} + +func (x *GetAssetByIDRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *Discussion) GetState() string { +// Deprecated: Use GetAssetByIDRequest.ProtoReflect.Descriptor instead. +func (*GetAssetByIDRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{26} +} + +func (x *GetAssetByIDRequest) GetId() string { if x != nil { - return x.State + return x.Id } return "" } -func (x *Discussion) GetLabels() []string { - if x != nil { - return x.Labels - } - return nil +type GetAssetByIDResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *Asset `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } -func (x *Discussion) GetAssets() []string { - if x != nil { - return x.Assets +func (x *GetAssetByIDResponse) Reset() { + *x = GetAssetByIDResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *Discussion) GetAssignees() []string { - if x != nil { - return x.Assignees - } - return nil +func (x *GetAssetByIDResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *Discussion) GetOwner() *User { - if x != nil { - return x.Owner +func (*GetAssetByIDResponse) ProtoMessage() {} + +func (x *GetAssetByIDResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *Discussion) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil +// Deprecated: Use GetAssetByIDResponse.ProtoReflect.Descriptor instead. +func (*GetAssetByIDResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{27} } -func (x *Discussion) GetUpdatedAt() *timestamppb.Timestamp { +func (x *GetAssetByIDResponse) GetData() *Asset { if x != nil { - return x.UpdatedAt + return x.Data } return nil } -type Comment struct { +type UpsertAssetRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - DiscussionId string `protobuf:"bytes,2,opt,name=discussion_id,json=discussionId,proto3" json:"discussion_id,omitempty"` - Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` - Owner *User `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` - UpdatedBy *User `protobuf:"bytes,5,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Asset *UpsertAssetRequest_BaseAsset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` + Upstreams []*LineageNode `protobuf:"bytes,2,rep,name=upstreams,proto3" json:"upstreams,omitempty"` + Downstreams []*LineageNode `protobuf:"bytes,3,rep,name=downstreams,proto3" json:"downstreams,omitempty"` } -func (x *Comment) Reset() { - *x = Comment{} +func (x *UpsertAssetRequest) Reset() { + *x = UpsertAssetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[20] + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Comment) String() string { +func (x *UpsertAssetRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Comment) ProtoMessage() {} +func (*UpsertAssetRequest) ProtoMessage() {} -func (x *Comment) ProtoReflect() protoreflect.Message { - mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[20] +func (x *UpsertAssetRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[28] 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 Comment.ProtoReflect.Descriptor instead. -func (*Comment) Descriptor() ([]byte, []int) { - return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{20} -} - -func (x *Comment) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Comment) GetDiscussionId() string { - if x != nil { - return x.DiscussionId - } - return "" -} - -func (x *Comment) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *Comment) GetOwner() *User { - if x != nil { - return x.Owner - } - return nil -} - -func (x *Comment) GetUpdatedBy() *User { - if x != nil { - return x.UpdatedBy - } - return nil -} - -func (x *Comment) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Comment) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -var File_odpf_compass_v1beta1_service_proto protoreflect.FileDescriptor - -var file_odpf_compass_v1beta1_service_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, - 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x04, - 0x0a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x52, - 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, - 0x65, 0x73, 0x52, 0x05, 0x71, 0x61, 0x6e, 0x64, 0x61, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0xd0, 0x01, - 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xfa, 0x42, 0x18, 0x72, 0x16, 0x52, 0x04, 0x6f, - 0x70, 0x65, 0x6e, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x52, 0x03, 0x61, 0x6c, 0x6c, - 0xd0, 0x01, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, - 0xd0, 0x01, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x08, 0x61, 0x73, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, - 0x12, 0x1e, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x12, 0x20, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x20, 0xfa, 0x42, 0x1d, 0x72, 0x1b, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0xd0, - 0x01, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xfa, 0x42, 0x10, - 0x72, 0x0e, 0x52, 0x03, 0x61, 0x73, 0x63, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0xd0, 0x01, 0x01, - 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x04, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, - 0x28, 0x00, 0x40, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, - 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3a, 0x45, 0x92, - 0x41, 0x42, 0x0a, 0x40, 0x2a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, - 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x24, - 0x53, 0x6f, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, - 0x74, 0x6f, 0x20, 0x66, 0x65, 0x74, 0x63, 0x68, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, - 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x20, 0x92, 0x41, 0x1d, 0x0a, 0x1b, 0x2a, 0x19, - 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8b, 0x03, 0x0a, 0x17, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x1f, 0xfa, 0x42, 0x1c, 0x72, 0x1a, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x6e, 0x64, 0x65, - 0x64, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x05, 0x71, 0x61, 0x6e, 0x64, 0x61, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xfa, 0x42, 0x13, 0x72, 0x11, 0x52, 0x04, 0x6f, 0x70, - 0x65, 0x6e, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, - 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, - 0x18, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x09, - 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, 0x09, 0x61, 0x73, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x3a, 0x5f, 0x92, 0x41, 0x5c, 0x0a, 0x5a, 0x2a, 0x17, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x29, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, - 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0xd2, 0x01, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0xd2, 0x01, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0xd2, 0x01, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4b, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x3a, 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0x2a, 0x18, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x1b, 0x92, 0x41, - 0x18, 0x0a, 0x16, 0x2a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6b, 0x0a, 0x15, 0x47, 0x65, 0x74, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x1c, 0x92, 0x41, 0x19, 0x0a, 0x17, 0x2a, - 0x15, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdd, 0x02, 0x0a, 0x16, 0x50, 0x61, 0x74, 0x63, 0x68, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x1e, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, - 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xfa, - 0x42, 0x1f, 0x72, 0x1d, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, - 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x05, 0x71, 0x61, 0x6e, 0x64, 0x61, 0xd0, 0x01, - 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xfa, 0x42, 0x13, 0x72, 0x11, 0x52, 0x04, 0x6f, - 0x70, 0x65, 0x6e, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0xd0, 0x01, 0x01, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, - 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, - 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x28, 0x0a, - 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, - 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, 0x09, 0x61, 0x73, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x3a, 0x1d, 0x92, 0x41, 0x1a, 0x0a, 0x18, 0x2a, 0x16, - 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa4, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x3a, 0x4a, 0x92, 0x41, 0x47, 0x0a, 0x45, 0x2a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x26, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, - 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x45, 0x0a, - 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x1c, 0x92, 0x41, 0x19, 0x0a, 0x17, 0x2a, 0x15, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, - 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x20, 0xfa, 0x42, 0x1d, 0x72, 0x1b, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0xd0, 0x01, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x09, 0x64, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xfa, 0x42, - 0x10, 0x72, 0x0e, 0x52, 0x03, 0x61, 0x73, 0x63, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0xd0, 0x01, - 0x01, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, - 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, - 0x2a, 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3a, 0x1c, - 0x92, 0x41, 0x19, 0x0a, 0x17, 0x2a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6a, 0x0a, 0x16, - 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x1d, 0x92, 0x41, 0x1a, 0x0a, 0x18, - 0x2a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x62, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, - 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x3a, 0x18, 0x92, 0x41, 0x15, 0x0a, 0x13, 0x2a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x62, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x19, 0x92, 0x41, 0x16, 0x0a, 0x14, 0x2a, 0x12, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x85, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, - 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x3a, 0x1b, 0x92, 0x41, 0x18, - 0x0a, 0x16, 0x2a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x1b, 0x92, 0x41, 0x18, 0x0a, 0x16, 0x2a, 0x14, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0xdf, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, - 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x0b, 0x92, 0x41, 0x08, 0x0a, 0x06, 0x2a, 0x04, - 0x55, 0x73, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, - 0x67, 0x12, 0x36, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x10, 0x92, 0x41, 0x0d, 0x0a, 0x0b, - 0x2a, 0x09, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x22, 0xc6, 0x01, 0x0a, 0x06, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2b, - 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x02, 0x74, - 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x52, 0x02, 0x74, 0x6f, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3a, 0x0d, 0x92, 0x41, 0x0a, 0x0a, 0x08, 0x2a, 0x06, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x22, 0x97, 0x05, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x2f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 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, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, - 0x09, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x22, 0x5e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, - 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0c, - 0x0a, 0x08, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x42, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x4f, 0x50, 0x49, 0x43, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x41, 0x53, 0x48, 0x42, 0x4f, 0x41, 0x52, 0x44, 0x10, 0x04, - 0x3a, 0x0c, 0x92, 0x41, 0x09, 0x0a, 0x07, 0x2a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x22, 0xf9, - 0x02, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x12, - 0x30, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x11, 0x92, 0x41, 0x0e, 0x0a, 0x0c, 0x2a, 0x0a, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc5, 0x02, 0x0a, 0x07, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, - 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, - 0x30, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x39, 0x0a, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x3a, 0x0e, 0x92, 0x41, 0x0b, 0x0a, 0x09, 0x2a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x32, 0x82, 0x0e, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb6, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x92, 0x41, - 0x21, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x47, - 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb6, - 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x21, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x64, 0x69, - 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xac, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x44, - 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, - 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x42, 0x92, 0x41, 0x1e, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa0, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x74, 0x63, 0x68, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x6f, 0x64, 0x70, - 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x47, 0x92, 0x41, 0x20, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x50, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x32, 0x19, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xdc, 0x01, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x69, - 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xdc, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x2e, 0x6f, 0x64, - 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, - 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x20, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, - 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xd2, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, - 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x92, 0x41, 0x34, 0x0a, 0x0a, - 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, - 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xcc, 0x01, 0x0a, - 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, - 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x77, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, - 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x37, 0x1a, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, - 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x69, 0x73, 0x63, - 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xc9, 0x01, 0x0a, 0x0d, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, - 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x22, 0x74, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, - 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x34, 0x2a, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, - 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x69, 0x73, 0x63, 0x75, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xe3, 0x02, 0x0a, 0x16, 0x69, 0x6f, 0x2e, 0x6f, - 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x73, 0x73, 0x42, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x92, 0x41, 0xf9, 0x01, 0x12, 0x97, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, - 0x12, 0x3c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x6f, 0x66, 0x20, 0x6f, 0x75, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x20, 0x41, - 0x50, 0x49, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x67, 0x52, 0x50, 0x43, 0x20, 0x61, 0x6e, 0x64, - 0x20, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x2a, 0x47, - 0x0a, 0x12, 0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, - 0x20, 0x32, 0x2e, 0x30, 0x12, 0x31, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x63, 0x6f, - 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, - 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x39, 0x2a, 0x01, - 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x72, 0x36, 0x0a, 0x12, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, - 0x6f, 0x75, 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x12, 0x20, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x67, 0x69, 0x74, 0x62, 0x6f, 0x6f, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_odpf_compass_v1beta1_service_proto_rawDescOnce sync.Once - file_odpf_compass_v1beta1_service_proto_rawDescData = file_odpf_compass_v1beta1_service_proto_rawDesc -) - -func file_odpf_compass_v1beta1_service_proto_rawDescGZIP() []byte { - file_odpf_compass_v1beta1_service_proto_rawDescOnce.Do(func() { - file_odpf_compass_v1beta1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_compass_v1beta1_service_proto_rawDescData) - }) - return file_odpf_compass_v1beta1_service_proto_rawDescData -} - -var file_odpf_compass_v1beta1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_odpf_compass_v1beta1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 21) -var file_odpf_compass_v1beta1_service_proto_goTypes = []interface{}{ - (Asset_Type)(0), // 0: odpf.compass.v1beta1.Asset.Type - (*GetAllDiscussionsRequest)(nil), // 1: odpf.compass.v1beta1.GetAllDiscussionsRequest - (*GetAllDiscussionsResponse)(nil), // 2: odpf.compass.v1beta1.GetAllDiscussionsResponse - (*CreateDiscussionRequest)(nil), // 3: odpf.compass.v1beta1.CreateDiscussionRequest - (*CreateDiscussionResponse)(nil), // 4: odpf.compass.v1beta1.CreateDiscussionResponse - (*GetDiscussionRequest)(nil), // 5: odpf.compass.v1beta1.GetDiscussionRequest - (*GetDiscussionResponse)(nil), // 6: odpf.compass.v1beta1.GetDiscussionResponse - (*PatchDiscussionRequest)(nil), // 7: odpf.compass.v1beta1.PatchDiscussionRequest - (*CreateCommentRequest)(nil), // 8: odpf.compass.v1beta1.CreateCommentRequest - (*CreateCommentResponse)(nil), // 9: odpf.compass.v1beta1.CreateCommentResponse - (*GetAllCommentsRequest)(nil), // 10: odpf.compass.v1beta1.GetAllCommentsRequest - (*GetAllCommentsResponse)(nil), // 11: odpf.compass.v1beta1.GetAllCommentsResponse - (*GetCommentRequest)(nil), // 12: odpf.compass.v1beta1.GetCommentRequest - (*GetCommentResponse)(nil), // 13: odpf.compass.v1beta1.GetCommentResponse - (*UpdateCommentRequest)(nil), // 14: odpf.compass.v1beta1.UpdateCommentRequest - (*DeleteCommentRequest)(nil), // 15: odpf.compass.v1beta1.DeleteCommentRequest - (*User)(nil), // 16: odpf.compass.v1beta1.User - (*Changelog)(nil), // 17: odpf.compass.v1beta1.Changelog - (*Change)(nil), // 18: odpf.compass.v1beta1.Change - (*Asset)(nil), // 19: odpf.compass.v1beta1.Asset - (*Discussion)(nil), // 20: odpf.compass.v1beta1.Discussion - (*Comment)(nil), // 21: odpf.compass.v1beta1.Comment - (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 23: google.protobuf.Struct - (*emptypb.Empty)(nil), // 24: google.protobuf.Empty -} -var file_odpf_compass_v1beta1_service_proto_depIdxs = []int32{ - 20, // 0: odpf.compass.v1beta1.GetAllDiscussionsResponse.data:type_name -> odpf.compass.v1beta1.Discussion - 20, // 1: odpf.compass.v1beta1.GetDiscussionResponse.data:type_name -> odpf.compass.v1beta1.Discussion - 21, // 2: odpf.compass.v1beta1.GetAllCommentsResponse.data:type_name -> odpf.compass.v1beta1.Comment - 21, // 3: odpf.compass.v1beta1.GetCommentResponse.data:type_name -> odpf.compass.v1beta1.Comment - 22, // 4: odpf.compass.v1beta1.User.created_at:type_name -> google.protobuf.Timestamp - 22, // 5: odpf.compass.v1beta1.User.updated_at:type_name -> google.protobuf.Timestamp - 18, // 6: odpf.compass.v1beta1.Changelog.changes:type_name -> odpf.compass.v1beta1.Change - 23, // 7: odpf.compass.v1beta1.Change.from:type_name -> google.protobuf.Struct - 23, // 8: odpf.compass.v1beta1.Change.to:type_name -> google.protobuf.Struct - 23, // 9: odpf.compass.v1beta1.Change.parent:type_name -> google.protobuf.Struct - 23, // 10: odpf.compass.v1beta1.Asset.data:type_name -> google.protobuf.Struct - 23, // 11: odpf.compass.v1beta1.Asset.labels:type_name -> google.protobuf.Struct - 16, // 12: odpf.compass.v1beta1.Asset.owners:type_name -> odpf.compass.v1beta1.User - 16, // 13: odpf.compass.v1beta1.Asset.updated_by:type_name -> odpf.compass.v1beta1.User - 17, // 14: odpf.compass.v1beta1.Asset.changelog:type_name -> odpf.compass.v1beta1.Changelog - 22, // 15: odpf.compass.v1beta1.Asset.created_at:type_name -> google.protobuf.Timestamp - 22, // 16: odpf.compass.v1beta1.Asset.updated_at:type_name -> google.protobuf.Timestamp - 16, // 17: odpf.compass.v1beta1.Discussion.owner:type_name -> odpf.compass.v1beta1.User - 22, // 18: odpf.compass.v1beta1.Discussion.created_at:type_name -> google.protobuf.Timestamp - 22, // 19: odpf.compass.v1beta1.Discussion.updated_at:type_name -> google.protobuf.Timestamp - 16, // 20: odpf.compass.v1beta1.Comment.owner:type_name -> odpf.compass.v1beta1.User - 16, // 21: odpf.compass.v1beta1.Comment.updated_by:type_name -> odpf.compass.v1beta1.User - 22, // 22: odpf.compass.v1beta1.Comment.created_at:type_name -> google.protobuf.Timestamp - 22, // 23: odpf.compass.v1beta1.Comment.updated_at:type_name -> google.protobuf.Timestamp - 1, // 24: odpf.compass.v1beta1.CompassService.GetAllDiscussions:input_type -> odpf.compass.v1beta1.GetAllDiscussionsRequest - 3, // 25: odpf.compass.v1beta1.CompassService.CreateDiscussion:input_type -> odpf.compass.v1beta1.CreateDiscussionRequest - 5, // 26: odpf.compass.v1beta1.CompassService.GetDiscussion:input_type -> odpf.compass.v1beta1.GetDiscussionRequest - 7, // 27: odpf.compass.v1beta1.CompassService.PatchDiscussion:input_type -> odpf.compass.v1beta1.PatchDiscussionRequest - 8, // 28: odpf.compass.v1beta1.CompassService.CreateComment:input_type -> odpf.compass.v1beta1.CreateCommentRequest - 10, // 29: odpf.compass.v1beta1.CompassService.GetAllComments:input_type -> odpf.compass.v1beta1.GetAllCommentsRequest - 12, // 30: odpf.compass.v1beta1.CompassService.GetComment:input_type -> odpf.compass.v1beta1.GetCommentRequest - 14, // 31: odpf.compass.v1beta1.CompassService.UpdateComment:input_type -> odpf.compass.v1beta1.UpdateCommentRequest - 15, // 32: odpf.compass.v1beta1.CompassService.DeleteComment:input_type -> odpf.compass.v1beta1.DeleteCommentRequest - 2, // 33: odpf.compass.v1beta1.CompassService.GetAllDiscussions:output_type -> odpf.compass.v1beta1.GetAllDiscussionsResponse - 4, // 34: odpf.compass.v1beta1.CompassService.CreateDiscussion:output_type -> odpf.compass.v1beta1.CreateDiscussionResponse - 6, // 35: odpf.compass.v1beta1.CompassService.GetDiscussion:output_type -> odpf.compass.v1beta1.GetDiscussionResponse - 24, // 36: odpf.compass.v1beta1.CompassService.PatchDiscussion:output_type -> google.protobuf.Empty - 9, // 37: odpf.compass.v1beta1.CompassService.CreateComment:output_type -> odpf.compass.v1beta1.CreateCommentResponse - 11, // 38: odpf.compass.v1beta1.CompassService.GetAllComments:output_type -> odpf.compass.v1beta1.GetAllCommentsResponse - 13, // 39: odpf.compass.v1beta1.CompassService.GetComment:output_type -> odpf.compass.v1beta1.GetCommentResponse - 24, // 40: odpf.compass.v1beta1.CompassService.UpdateComment:output_type -> google.protobuf.Empty - 24, // 41: odpf.compass.v1beta1.CompassService.DeleteComment:output_type -> google.protobuf.Empty - 33, // [33:42] is the sub-list for method output_type - 24, // [24:33] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name -} - -func init() { file_odpf_compass_v1beta1_service_proto_init() } -func file_odpf_compass_v1beta1_service_proto_init() { - if File_odpf_compass_v1beta1_service_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_odpf_compass_v1beta1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllDiscussionsRequest); i { + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpsertAssetRequest.ProtoReflect.Descriptor instead. +func (*UpsertAssetRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{28} +} + +func (x *UpsertAssetRequest) GetAsset() *UpsertAssetRequest_BaseAsset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *UpsertAssetRequest) GetUpstreams() []*LineageNode { + if x != nil { + return x.Upstreams + } + return nil +} + +func (x *UpsertAssetRequest) GetDownstreams() []*LineageNode { + if x != nil { + return x.Downstreams + } + return nil +} + +type UpsertAssetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *UpsertAssetResponse) Reset() { + *x = UpsertAssetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpsertAssetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpsertAssetResponse) ProtoMessage() {} + +func (x *UpsertAssetResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[29] + 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 UpsertAssetResponse.ProtoReflect.Descriptor instead. +func (*UpsertAssetResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{29} +} + +func (x *UpsertAssetResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type UpsertPatchAssetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Asset *UpsertPatchAssetRequest_BaseAsset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` + Upstreams []*LineageNode `protobuf:"bytes,2,rep,name=upstreams,proto3" json:"upstreams,omitempty"` + Downstreams []*LineageNode `protobuf:"bytes,3,rep,name=downstreams,proto3" json:"downstreams,omitempty"` +} + +func (x *UpsertPatchAssetRequest) Reset() { + *x = UpsertPatchAssetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpsertPatchAssetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpsertPatchAssetRequest) ProtoMessage() {} + +func (x *UpsertPatchAssetRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[30] + 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 UpsertPatchAssetRequest.ProtoReflect.Descriptor instead. +func (*UpsertPatchAssetRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{30} +} + +func (x *UpsertPatchAssetRequest) GetAsset() *UpsertPatchAssetRequest_BaseAsset { + if x != nil { + return x.Asset + } + return nil +} + +func (x *UpsertPatchAssetRequest) GetUpstreams() []*LineageNode { + if x != nil { + return x.Upstreams + } + return nil +} + +func (x *UpsertPatchAssetRequest) GetDownstreams() []*LineageNode { + if x != nil { + return x.Downstreams + } + return nil +} + +type UpsertPatchAssetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *UpsertPatchAssetResponse) Reset() { + *x = UpsertPatchAssetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpsertPatchAssetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpsertPatchAssetResponse) ProtoMessage() {} + +func (x *UpsertPatchAssetResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[31] + 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 UpsertPatchAssetResponse.ProtoReflect.Descriptor instead. +func (*UpsertPatchAssetResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{31} +} + +func (x *UpsertPatchAssetResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteAssetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteAssetRequest) Reset() { + *x = DeleteAssetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAssetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAssetRequest) ProtoMessage() {} + +func (x *DeleteAssetRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[32] + 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 DeleteAssetRequest.ProtoReflect.Descriptor instead. +func (*DeleteAssetRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{32} +} + +func (x *DeleteAssetRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteAssetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteAssetResponse) Reset() { + *x = DeleteAssetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAssetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAssetResponse) ProtoMessage() {} + +func (x *DeleteAssetResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[33] + 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 DeleteAssetResponse.ProtoReflect.Descriptor instead. +func (*DeleteAssetResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{33} +} + +type GetAssetStargazersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Offset uint32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *GetAssetStargazersRequest) Reset() { + *x = GetAssetStargazersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssetStargazersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetStargazersRequest) ProtoMessage() {} + +func (x *GetAssetStargazersRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[34] + 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 GetAssetStargazersRequest.ProtoReflect.Descriptor instead. +func (*GetAssetStargazersRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{34} +} + +func (x *GetAssetStargazersRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetAssetStargazersRequest) GetSize() uint32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetAssetStargazersRequest) GetOffset() uint32 { + if x != nil { + return x.Offset + } + return 0 +} + +type GetAssetStargazersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*User `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetAssetStargazersResponse) Reset() { + *x = GetAssetStargazersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssetStargazersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetStargazersResponse) ProtoMessage() {} + +func (x *GetAssetStargazersResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[35] + 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 GetAssetStargazersResponse.ProtoReflect.Descriptor instead. +func (*GetAssetStargazersResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{35} +} + +func (x *GetAssetStargazersResponse) GetData() []*User { + if x != nil { + return x.Data + } + return nil +} + +type GetAssetVersionHistoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Offset uint32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *GetAssetVersionHistoryRequest) Reset() { + *x = GetAssetVersionHistoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssetVersionHistoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetVersionHistoryRequest) ProtoMessage() {} + +func (x *GetAssetVersionHistoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[36] + 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 GetAssetVersionHistoryRequest.ProtoReflect.Descriptor instead. +func (*GetAssetVersionHistoryRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{36} +} + +func (x *GetAssetVersionHistoryRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetAssetVersionHistoryRequest) GetSize() uint32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetAssetVersionHistoryRequest) GetOffset() uint32 { + if x != nil { + return x.Offset + } + return 0 +} + +type GetAssetVersionHistoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*Asset `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetAssetVersionHistoryResponse) Reset() { + *x = GetAssetVersionHistoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssetVersionHistoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetVersionHistoryResponse) ProtoMessage() {} + +func (x *GetAssetVersionHistoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[37] + 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 GetAssetVersionHistoryResponse.ProtoReflect.Descriptor instead. +func (*GetAssetVersionHistoryResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{37} +} + +func (x *GetAssetVersionHistoryResponse) GetData() []*Asset { + if x != nil { + return x.Data + } + return nil +} + +type GetAssetByVersionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *GetAssetByVersionRequest) Reset() { + *x = GetAssetByVersionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssetByVersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetByVersionRequest) ProtoMessage() {} + +func (x *GetAssetByVersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[38] + 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 GetAssetByVersionRequest.ProtoReflect.Descriptor instead. +func (*GetAssetByVersionRequest) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{38} +} + +func (x *GetAssetByVersionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetAssetByVersionRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type GetAssetByVersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *Asset `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetAssetByVersionResponse) Reset() { + *x = GetAssetByVersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssetByVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetByVersionResponse) ProtoMessage() {} + +func (x *GetAssetByVersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[39] + 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 GetAssetByVersionResponse.ProtoReflect.Descriptor instead. +func (*GetAssetByVersionResponse) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{39} +} + +func (x *GetAssetByVersionResponse) GetData() *Asset { + if x != nil { + return x.Data + } + return nil +} + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Provider string `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[40] + 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 User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{40} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *User) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *User) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type Changelog struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Changes []*Change `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"` +} + +func (x *Changelog) Reset() { + *x = Changelog{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Changelog) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Changelog) ProtoMessage() {} + +func (x *Changelog) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[41] + 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 Changelog.ProtoReflect.Descriptor instead. +func (*Changelog) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{41} +} + +func (x *Changelog) GetChanges() []*Change { + if x != nil { + return x.Changes + } + return nil +} + +type Change struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Path []string `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` + From *structpb.Value `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"` + To *structpb.Value `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` +} + +func (x *Change) Reset() { + *x = Change{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Change) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Change) ProtoMessage() {} + +func (x *Change) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[42] + 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 Change.ProtoReflect.Descriptor instead. +func (*Change) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{42} +} + +func (x *Change) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Change) GetPath() []string { + if x != nil { + return x.Path + } + return nil +} + +func (x *Change) GetFrom() *structpb.Value { + if x != nil { + return x.From + } + return nil +} + +func (x *Change) GetTo() *structpb.Value { + if x != nil { + return x.To + } + return nil +} + +type Asset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Urn string `protobuf:"bytes,2,opt,name=urn,proto3" json:"urn,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Service string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + Data *structpb.Struct `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + Labels *structpb.Struct `protobuf:"bytes,8,opt,name=labels,proto3" json:"labels,omitempty"` + Owners []*User `protobuf:"bytes,9,rep,name=owners,proto3" json:"owners,omitempty"` + Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"` + UpdatedBy *User `protobuf:"bytes,11,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` + Changelog *Changelog `protobuf:"bytes,12,opt,name=changelog,proto3" json:"changelog,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *Asset) Reset() { + *x = Asset{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Asset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Asset) ProtoMessage() {} + +func (x *Asset) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[43] + 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 Asset.ProtoReflect.Descriptor instead. +func (*Asset) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{43} +} + +func (x *Asset) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Asset) GetUrn() string { + if x != nil { + return x.Urn + } + return "" +} + +func (x *Asset) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Asset) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *Asset) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Asset) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Asset) GetData() *structpb.Struct { + if x != nil { + return x.Data + } + return nil +} + +func (x *Asset) GetLabels() *structpb.Struct { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Asset) GetOwners() []*User { + if x != nil { + return x.Owners + } + return nil +} + +func (x *Asset) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Asset) GetUpdatedBy() *User { + if x != nil { + return x.UpdatedBy + } + return nil +} + +func (x *Asset) GetChangelog() *Changelog { + if x != nil { + return x.Changelog + } + return nil +} + +func (x *Asset) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Asset) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type Discussion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` + Labels []string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty"` + Assets []string `protobuf:"bytes,7,rep,name=assets,proto3" json:"assets,omitempty"` + Assignees []string `protobuf:"bytes,8,rep,name=assignees,proto3" json:"assignees,omitempty"` + Owner *User `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *Discussion) Reset() { + *x = Discussion{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Discussion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Discussion) ProtoMessage() {} + +func (x *Discussion) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[44] + 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 Discussion.ProtoReflect.Descriptor instead. +func (*Discussion) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{44} +} + +func (x *Discussion) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Discussion) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Discussion) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *Discussion) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Discussion) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *Discussion) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Discussion) GetAssets() []string { + if x != nil { + return x.Assets + } + return nil +} + +func (x *Discussion) GetAssignees() []string { + if x != nil { + return x.Assignees + } + return nil +} + +func (x *Discussion) GetOwner() *User { + if x != nil { + return x.Owner + } + return nil +} + +func (x *Discussion) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Discussion) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type Comment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + DiscussionId string `protobuf:"bytes,2,opt,name=discussion_id,json=discussionId,proto3" json:"discussion_id,omitempty"` + Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` + Owner *User `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` + UpdatedBy *User `protobuf:"bytes,5,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *Comment) Reset() { + *x = Comment{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Comment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Comment) ProtoMessage() {} + +func (x *Comment) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[45] + 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 Comment.ProtoReflect.Descriptor instead. +func (*Comment) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{45} +} + +func (x *Comment) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Comment) GetDiscussionId() string { + if x != nil { + return x.DiscussionId + } + return "" +} + +func (x *Comment) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *Comment) GetOwner() *User { + if x != nil { + return x.Owner + } + return nil +} + +func (x *Comment) GetUpdatedBy() *User { + if x != nil { + return x.UpdatedBy + } + return nil +} + +func (x *Comment) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Comment) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type LineageEdge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + Prop *structpb.Struct `protobuf:"bytes,3,opt,name=prop,proto3" json:"prop,omitempty"` +} + +func (x *LineageEdge) Reset() { + *x = LineageEdge{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LineageEdge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LineageEdge) ProtoMessage() {} + +func (x *LineageEdge) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[46] + 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 LineageEdge.ProtoReflect.Descriptor instead. +func (*LineageEdge) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{46} +} + +func (x *LineageEdge) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *LineageEdge) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *LineageEdge) GetProp() *structpb.Struct { + if x != nil { + return x.Prop + } + return nil +} + +type LineageNode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Urn string `protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Service string `protobuf:"bytes,3,opt,name=service,proto3" json:"service,omitempty"` +} + +func (x *LineageNode) Reset() { + *x = LineageNode{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LineageNode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LineageNode) ProtoMessage() {} + +func (x *LineageNode) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[47] + 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 LineageNode.ProtoReflect.Descriptor instead. +func (*LineageNode) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{47} +} + +func (x *LineageNode) GetUrn() string { + if x != nil { + return x.Urn + } + return "" +} + +func (x *LineageNode) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *LineageNode) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +type UpsertAssetRequest_BaseAsset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Urn string `protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Service string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + Data *structpb.Struct `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` + Labels *structpb.Struct `protobuf:"bytes,7,opt,name=labels,proto3" json:"labels,omitempty"` +} + +func (x *UpsertAssetRequest_BaseAsset) Reset() { + *x = UpsertAssetRequest_BaseAsset{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpsertAssetRequest_BaseAsset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpsertAssetRequest_BaseAsset) ProtoMessage() {} + +func (x *UpsertAssetRequest_BaseAsset) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[52] + 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 UpsertAssetRequest_BaseAsset.ProtoReflect.Descriptor instead. +func (*UpsertAssetRequest_BaseAsset) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{28, 0} +} + +func (x *UpsertAssetRequest_BaseAsset) GetUrn() string { + if x != nil { + return x.Urn + } + return "" +} + +func (x *UpsertAssetRequest_BaseAsset) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpsertAssetRequest_BaseAsset) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpsertAssetRequest_BaseAsset) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *UpsertAssetRequest_BaseAsset) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UpsertAssetRequest_BaseAsset) GetData() *structpb.Struct { + if x != nil { + return x.Data + } + return nil +} + +func (x *UpsertAssetRequest_BaseAsset) GetLabels() *structpb.Struct { + if x != nil { + return x.Labels + } + return nil +} + +type UpsertPatchAssetRequest_BaseAsset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Urn string `protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Service string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Description *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + Data *structpb.Struct `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` + Labels *structpb.Struct `protobuf:"bytes,7,opt,name=labels,proto3" json:"labels,omitempty"` +} + +func (x *UpsertPatchAssetRequest_BaseAsset) Reset() { + *x = UpsertPatchAssetRequest_BaseAsset{} + if protoimpl.UnsafeEnabled { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpsertPatchAssetRequest_BaseAsset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpsertPatchAssetRequest_BaseAsset) ProtoMessage() {} + +func (x *UpsertPatchAssetRequest_BaseAsset) ProtoReflect() protoreflect.Message { + mi := &file_odpf_compass_v1beta1_service_proto_msgTypes[53] + 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 UpsertPatchAssetRequest_BaseAsset.ProtoReflect.Descriptor instead. +func (*UpsertPatchAssetRequest_BaseAsset) Descriptor() ([]byte, []int) { + return file_odpf_compass_v1beta1_service_proto_rawDescGZIP(), []int{30, 0} +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetUrn() string { + if x != nil { + return x.Urn + } + return "" +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetDescription() *wrapperspb.StringValue { + if x != nil { + return x.Description + } + return nil +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetData() *structpb.Struct { + if x != nil { + return x.Data + } + return nil +} + +func (x *UpsertPatchAssetRequest_BaseAsset) GetLabels() *structpb.Struct { + if x != nil { + return x.Labels + } + return nil +} + +var File_odpf_compass_v1beta1_service_proto protoreflect.FileDescriptor + +var file_odpf_compass_v1beta1_service_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x84, 0x04, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, + 0x72, 0x22, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x06, 0x69, + 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x05, 0x71, 0x61, 0x6e, 0x64, 0x61, 0x52, 0x03, 0x61, 0x6c, + 0x6c, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xfa, 0x42, 0x18, 0x72, 0x16, + 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x52, 0x03, + 0x61, 0x6c, 0x6c, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x24, 0x0a, + 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x20, 0xfa, 0x42, 0x1d, 0x72, 0x1b, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x09, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, + 0xfa, 0x42, 0x10, 0x72, 0x0e, 0x52, 0x03, 0x61, 0x73, 0x63, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, + 0xd0, 0x01, 0x01, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, + 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, + 0x06, 0x2a, 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, + 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x3a, 0x45, 0x92, 0x41, 0x42, 0x0a, 0x40, 0x2a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x32, 0x24, 0x53, 0x6f, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x65, 0x74, 0x63, 0x68, 0x20, 0x64, 0x69, 0x73, 0x63, + 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x6c, + 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x20, 0x92, 0x41, 0x1d, 0x0a, + 0x1b, 0x2a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8b, 0x03, 0x0a, + 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1f, 0xfa, 0x42, 0x1c, 0x72, 0x1a, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x65, + 0x6e, 0x64, 0x65, 0x64, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x05, 0x71, 0x61, + 0x6e, 0x64, 0x61, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xfa, 0x42, 0x13, 0x72, 0x11, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0xd0, 0x01, 0x01, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, + 0x01, 0x28, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, + 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, + 0x28, 0x0a, 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, 0x09, + 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x3a, 0x5f, 0x92, 0x41, 0x5c, 0x0a, 0x5a, + 0x2a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x29, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, + 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0xd2, 0x01, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0xd2, 0x01, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4b, 0x0a, 0x18, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0x2a, 0x18, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, + 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, + 0x1b, 0x92, 0x41, 0x18, 0x0a, 0x16, 0x2a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6b, 0x0a, 0x15, + 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x1c, 0x92, 0x41, 0x19, + 0x0a, 0x17, 0x2a, 0x15, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdd, 0x02, 0x0a, 0x16, 0x50, 0x61, + 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x22, 0xfa, 0x42, 0x1f, 0x72, 0x1d, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x6e, 0x64, + 0x65, 0x64, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x05, 0x71, 0x61, 0x6e, 0x64, + 0x61, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xfa, 0x42, 0x13, 0x72, 0x11, + 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x52, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0xd0, 0x01, + 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, + 0x18, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x22, 0x0a, 0x06, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, + 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x12, 0x28, 0x0a, 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x18, 0x01, 0x28, 0x01, 0x52, + 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x3a, 0x1d, 0x92, 0x41, 0x1a, 0x0a, + 0x18, 0x2a, 0x16, 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa4, 0x01, 0x0a, 0x14, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x3a, 0x4a, 0x92, 0x41, 0x47, 0x0a, 0x45, 0x2a, 0x14, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x32, 0x26, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, + 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, + 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0xd2, 0x01, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x22, 0x19, 0x0a, 0x17, 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0x0a, 0x15, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x3a, 0x1c, 0x92, 0x41, 0x19, 0x0a, 0x17, 0x2a, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x85, 0x02, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x34, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x20, 0xfa, 0x42, 0x1d, 0x72, 0x1b, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0xd0, 0x01, + 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xfa, 0x42, 0x10, 0x72, + 0x0e, 0x52, 0x03, 0x61, 0x73, 0x63, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0xd0, 0x01, 0x01, 0x52, + 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, + 0x00, 0x40, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, + 0x28, 0x00, 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3a, 0x1c, 0x92, 0x41, + 0x19, 0x0a, 0x17, 0x2a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6a, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x1d, 0x92, 0x41, 0x1a, 0x0a, 0x18, 0x2a, 0x16, + 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x62, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x3a, 0x18, 0x92, 0x41, 0x15, 0x0a, 0x13, 0x2a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x62, 0x0a, 0x12, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x31, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x3a, 0x19, 0x92, 0x41, 0x16, 0x0a, 0x14, 0x2a, 0x12, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, + 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x3a, 0x1b, 0x92, 0x41, 0x18, 0x0a, 0x16, + 0x2a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x68, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x1b, 0x92, 0x41, + 0x18, 0x0a, 0x16, 0x2a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x91, 0x06, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0x92, 0x41, 0x1c, 0x32, 0x1a, 0x74, + 0x65, 0x78, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x28, 0x66, 0x75, 0x7a, 0x7a, 0x79, 0x29, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, + 0x01, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0xbe, 0x01, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x6b, + 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xa5, 0x01, 0x92, 0x41, 0x99, 0x01, 0x32, + 0x96, 0x01, 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x73, + 0x6f, 0x72, 0x74, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x6e, + 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, + 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x65, 0x67, 0x2c, 0x20, 0x22, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x75, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, + 0x52, 0x06, 0x72, 0x61, 0x6e, 0x6b, 0x62, 0x79, 0x12, 0xac, 0x01, 0x0a, 0x08, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x8f, 0x01, 0x92, 0x41, + 0x83, 0x01, 0x32, 0x80, 0x01, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x6f, 0x6e, 0x20, 0x61, + 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x77, 0x72, 0x69, + 0x74, 0x74, 0x65, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x65, 0x67, 0x2c, 0x20, 0x22, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x2e, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x73, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x62, 0x79, 0x12, 0x3d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x29, 0x92, 0x41, 0x1d, 0x32, 0x1b, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x74, 0x6f, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, 0x40, 0x01, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 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, 0x1a, 0x38, 0x0a, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 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, 0x47, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, + 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x94, 0x06, 0x0a, 0x14, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0x92, 0x41, 0x1c, 0x32, 0x1a, 0x74, 0x65, 0x78, + 0x74, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x28, 0x66, 0x75, 0x7a, 0x7a, 0x79, 0x29, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0xbe, 0x01, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x6b, 0x62, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0xa5, 0x01, 0x92, 0x41, 0x99, 0x01, 0x32, 0x96, 0x01, + 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x73, 0x6f, 0x72, + 0x74, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x6e, 0x75, 0x6d, + 0x65, 0x72, 0x69, 0x63, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x77, 0x72, + 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x65, 0x67, 0x2c, 0x20, 0x22, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x06, + 0x72, 0x61, 0x6e, 0x6b, 0x62, 0x79, 0x12, 0xac, 0x01, 0x0a, 0x08, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x8f, 0x01, 0x92, 0x41, 0x83, 0x01, + 0x32, 0x80, 0x01, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x20, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, + 0x65, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x73, + 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x65, 0x67, 0x2c, 0x20, 0x22, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x62, 0x79, 0x12, 0x3d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0d, 0x42, 0x29, 0x92, 0x41, 0x1d, 0x32, 0x1b, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x20, 0x6f, 0x66, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x72, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, + 0x65, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, + 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 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, 0x1a, 0x38, 0x0a, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 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, 0x2b, 0x0a, 0x15, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, + 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x22, 0x23, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x22, 0x49, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x47, + 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x64, 0x70, + 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x45, 0x64, 0x67, 0x65, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x22, 0xf2, 0x02, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x04, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0x92, 0x41, 0x10, 0x32, 0x0e, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x74, 0x65, 0x78, 0x74, 0xfa, 0x42, + 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x2f, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0x92, 0x41, 0x10, 0x32, + 0x0e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0xfa, + 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, + 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, + 0x92, 0x41, 0x13, 0x32, 0x11, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x23, 0x92, 0x41, 0x17, 0x32, 0x15, 0x6d, 0x61, 0x78, 0x69, + 0x6d, 0x75, 0x6d, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x65, 0x74, 0x63, + 0x68, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, 0x40, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x12, 0x3a, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, + 0x42, 0x22, 0x92, 0x41, 0x16, 0x32, 0x14, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, + 0x20, 0x66, 0x65, 0x74, 0x63, 0x68, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0xfa, 0x42, 0x06, 0x2a, 0x04, + 0x28, 0x00, 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x4a, 0x0a, 0x0a, + 0x77, 0x69, 0x74, 0x68, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x2b, 0x92, 0x41, 0x28, 0x32, 0x26, 0x69, 0x66, 0x20, 0x73, 0x65, 0x74, 0x20, 0x69, 0x6e, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x20, 0x69, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x77, + 0x69, 0x74, 0x68, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x5d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, + 0x6c, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x25, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x47, + 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x85, 0x04, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, + 0x72, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, + 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x3f, 0x0a, 0x09, 0x75, 0x70, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x64, + 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, + 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x64, 0x6f, 0x77, + 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x9e, + 0x02, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x72, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x46, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0x92, 0x41, 0x19, 0x32, 0x17, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, + 0x73, 0x65, 0x74, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x17, + 0x92, 0x41, 0x14, 0x32, 0x12, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, + 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, + 0x25, 0x0a, 0x13, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x89, 0x05, 0x0a, 0x17, 0x55, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x50, 0x61, 0x74, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x37, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x50, + 0x61, 0x74, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x42, 0x61, 0x73, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x12, 0x3f, 0x0a, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x65, + 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x98, 0x03, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x65, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1d, 0x92, 0x41, 0x12, 0x32, 0x10, 0x6e, 0x61, + 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0xfa, 0x42, + 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x24, 0x92, 0x41, 0x19, 0x32, 0x17, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, + 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x42, 0x1d, 0x92, 0x41, 0x1a, 0x32, 0x18, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x42, 0x17, 0x92, 0x41, 0x14, 0x32, 0x12, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x22, 0x2a, 0x0a, 0x18, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x50, 0x61, 0x74, 0x63, + 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x24, + 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6d, 0x0a, 0x19, 0x47, + 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x72, 0x67, 0x61, 0x7a, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, 0x40, + 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, + 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x4c, 0x0a, 0x1a, 0x47, 0x65, + 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x72, 0x67, 0x61, 0x7a, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x71, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, 0x00, + 0x40, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x2a, 0x04, 0x28, + 0x00, 0x40, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x51, 0x0a, 0x1e, 0x47, + 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x64, + 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x44, + 0x0a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x79, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4c, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x42, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x22, 0xdf, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x0b, 0x92, 0x41, 0x08, 0x0a, 0x06, 0x2a, 0x04, + 0x55, 0x73, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, + 0x67, 0x12, 0x36, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x10, 0x92, 0x41, 0x0d, 0x0a, 0x0b, + 0x2a, 0x09, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x22, 0x93, 0x01, 0x0a, 0x06, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2a, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x26, 0x0a, 0x02, 0x74, 0x6f, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, + 0x74, 0x6f, 0x3a, 0x0d, 0x92, 0x41, 0x0a, 0x0a, 0x08, 0x2a, 0x06, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x22, 0xb7, 0x04, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x32, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x73, 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, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x64, + 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x09, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, 0x0c, 0x92, + 0x41, 0x09, 0x0a, 0x07, 0x2a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x22, 0xf9, 0x02, 0x0a, 0x0a, + 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x05, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, + 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x3a, 0x11, 0x92, 0x41, 0x0e, 0x0a, 0x0c, 0x2a, 0x0a, 0x44, 0x69, 0x73, + 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc5, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, + 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x05, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, + 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x39, + 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x3a, + 0x0e, 0x92, 0x41, 0x0b, 0x0a, 0x09, 0x2a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, + 0x6a, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x45, 0x64, 0x67, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2b, + 0x0a, 0x04, 0x70, 0x72, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x70, 0x22, 0x4d, 0x0a, 0x0b, 0x4c, + 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, 0xfd, 0x24, 0x0a, 0x0e, 0x43, + 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb6, 0x01, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, + 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, + 0x6c, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x92, 0x41, 0x21, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x64, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, + 0x12, 0x14, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb6, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, 0x6f, 0x64, + 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, + 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x21, 0x0a, + 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x01, 0x2a, 0x12, + 0xac, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, + 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x92, 0x41, 0x1e, 0x0a, + 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x47, 0x65, 0x74, + 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, + 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xb7, + 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x44, 0x69, 0x73, + 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x47, 0x92, 0x41, 0x20, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x50, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x32, 0x19, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xdc, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x6f, 0x64, 0x70, + 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x72, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, + 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x69, 0x73, + 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xdc, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, + 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x2e, 0x6f, 0x64, 0x70, + 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63, + 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x20, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xd2, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, + 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x92, 0x41, 0x34, 0x0a, 0x0a, 0x44, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x1d, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, + 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xe1, 0x01, 0x0a, 0x0d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, + 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, + 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x77, 0x92, 0x41, 0x37, 0x0a, 0x0a, 0x44, 0x69, 0x73, + 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x1a, 0x32, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, + 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, + 0xde, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x92, 0x41, 0x37, 0x0a, + 0x0a, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x07, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x20, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x63, + 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x2a, 0x32, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0xf0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x12, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f, + 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x88, 0x04, 0x92, 0x41, 0xed, 0x03, 0x0a, + 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x13, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x1a, 0xc6, 0x03, 0x41, 0x50, 0x49, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x20, 0x27, 0x74, 0x65, 0x78, 0x74, 0x27, 0x20, 0x69, 0x73, 0x20, 0x66, 0x75, 0x7a, 0x7a, + 0x79, 0x20, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x73, + 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x2c, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x2e, 0x20, + 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x20, 0x63, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, + 0x27, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x2a, 0x27, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x20, 0x59, 0x6f, 0x75, + 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x65, 0x61, 0x63, + 0x68, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, + 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x79, 0x20, 0x61, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, + 0x77, 0x6f, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, 0x27, 0x76, 0x6e, + 0x27, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x27, 0x74, 0x68, 0x27, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x60, + 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x3f, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x3c, 0x74, + 0x65, 0x78, 0x74, 0x3e, 0x26, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x26, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6c, 0x61, 0x6e, 0x64, 0x73, + 0x63, 0x61, 0x70, 0x65, 0x3d, 0x76, 0x6e, 0x26, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x6c, + 0x61, 0x6e, 0x64, 0x73, 0x63, 0x61, 0x70, 0x65, 0x3d, 0x74, 0x68, 0x60, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x12, 0xad, 0x01, 0x0a, 0x0d, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, + 0x92, 0x41, 0x21, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x0a, 0x05, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x12, 0x10, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x73, 0x75, 0x67, 0x67, + 0x65, 0x73, 0x74, 0x12, 0xbe, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, + 0x12, 0x25, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x63, 0x92, 0x41, 0x42, 0x0a, 0x07, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x0a, 0x05, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x12, 0x11, 0x47, 0x65, 0x74, 0x20, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x67, + 0x65, 0x20, 0x47, 0x72, 0x61, 0x70, 0x68, 0x1a, 0x1d, 0x47, 0x65, 0x74, 0x20, 0x6c, 0x69, 0x6e, + 0x65, 0x61, 0x67, 0x65, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, + 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x67, 0x65, 0x2f, 0x7b, + 0x75, 0x72, 0x6e, 0x7d, 0x12, 0xdd, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x6c, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x92, 0x41, + 0x5c, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x12, 0x47, 0x65, 0x74, 0x20, 0x6c, 0x69, + 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x1a, 0x3f, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x2c, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, + 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x79, 0x70, + 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x12, 0xc2, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x42, 0x79, 0x49, 0x44, 0x12, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2a, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x92, 0x41, + 0x3c, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x61, + 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x24, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x20, + 0x77, 0x69, 0x74, 0x68, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x49, 0x44, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x81, 0x02, 0x0a, 0x0b, 0x55, 0x70, + 0x73, 0x65, 0x72, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, + 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9c, + 0x01, 0x92, 0x41, 0x7f, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0f, 0x55, 0x70, 0x73, + 0x65, 0x72, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x65, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x20, 0x69, 0x66, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x72, 0x6e, 0x2c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x61, + 0x6e, 0x64, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x73, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x74, + 0x65, 0x61, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x1a, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xf4, 0x01, + 0x0a, 0x10, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x50, 0x61, 0x74, 0x63, 0x68, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x12, 0x2d, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, + 0x50, 0x61, 0x74, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x50, + 0x61, 0x74, 0x63, 0x68, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x80, 0x01, 0x92, 0x41, 0x63, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x15, + 0x50, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x20, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x43, 0x53, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x20, 0x74, + 0x6f, 0x20, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x20, 0x62, 0x75, 0x74, 0x20, 0x77, 0x69, 0x74, + 0x68, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, + 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x62, + 0x6f, 0x64, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, + 0x32, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xc0, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x92, 0x41, 0x3d, 0x0a, 0x05, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x6e, + 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x23, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, + 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x49, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x16, 0x2a, 0x14, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xf7, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x72, 0x67, 0x61, 0x7a, 0x65, 0x72, 0x73, 0x12, 0x2f, + 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x72, 0x67, 0x61, 0x7a, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x30, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x72, 0x67, 0x61, 0x7a, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x7e, 0x92, 0x41, 0x54, 0x0a, 0x05, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1e, 0x46, + 0x69, 0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, + 0x74, 0x61, 0x72, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x1a, 0x2b, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, + 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, + 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, + 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x67, 0x61, 0x7a, 0x65, 0x72, + 0x73, 0x12, 0xfe, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x33, 0x2e, 0x6f, + 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x34, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x92, 0x41, 0x51, 0x0a, 0x05, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x12, 0x1f, 0x47, 0x65, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x20, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x1a, 0x27, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, + 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x20, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0xf5, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7f, 0x92, 0x41, 0x4d, 0x0a, 0x05, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x47, 0x65, 0x74, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x27, 0x73, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x1a, 0x26, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, + 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x42, 0xe3, 0x02, 0x0a, 0x16, 0x69, + 0x6f, 0x2e, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x73, 0x73, 0x42, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x92, 0x41, 0xf9, 0x01, 0x12, 0x97, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x73, 0x73, 0x12, 0x3c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x6f, 0x75, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, + 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x67, 0x52, 0x50, 0x43, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x2a, 0x47, 0x0a, 0x12, 0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, + 0x6e, 0x73, 0x65, 0x20, 0x32, 0x2e, 0x30, 0x12, 0x31, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, + 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x64, 0x70, 0x66, + 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, + 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x30, 0x2e, 0x31, 0x2e, + 0x39, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x72, 0x36, 0x0a, 0x12, 0x4d, 0x6f, 0x72, 0x65, + 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x12, 0x20, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x64, 0x70, 0x66, 0x2e, 0x67, 0x69, 0x74, + 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x73, 0x73, 0x2f, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_odpf_compass_v1beta1_service_proto_rawDescOnce sync.Once + file_odpf_compass_v1beta1_service_proto_rawDescData = file_odpf_compass_v1beta1_service_proto_rawDesc +) + +func file_odpf_compass_v1beta1_service_proto_rawDescGZIP() []byte { + file_odpf_compass_v1beta1_service_proto_rawDescOnce.Do(func() { + file_odpf_compass_v1beta1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_odpf_compass_v1beta1_service_proto_rawDescData) + }) + return file_odpf_compass_v1beta1_service_proto_rawDescData +} + +var file_odpf_compass_v1beta1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 54) +var file_odpf_compass_v1beta1_service_proto_goTypes = []interface{}{ + (*GetAllDiscussionsRequest)(nil), // 0: odpf.compass.v1beta1.GetAllDiscussionsRequest + (*GetAllDiscussionsResponse)(nil), // 1: odpf.compass.v1beta1.GetAllDiscussionsResponse + (*CreateDiscussionRequest)(nil), // 2: odpf.compass.v1beta1.CreateDiscussionRequest + (*CreateDiscussionResponse)(nil), // 3: odpf.compass.v1beta1.CreateDiscussionResponse + (*GetDiscussionRequest)(nil), // 4: odpf.compass.v1beta1.GetDiscussionRequest + (*GetDiscussionResponse)(nil), // 5: odpf.compass.v1beta1.GetDiscussionResponse + (*PatchDiscussionRequest)(nil), // 6: odpf.compass.v1beta1.PatchDiscussionRequest + (*CreateCommentRequest)(nil), // 7: odpf.compass.v1beta1.CreateCommentRequest + (*PatchDiscussionResponse)(nil), // 8: odpf.compass.v1beta1.PatchDiscussionResponse + (*CreateCommentResponse)(nil), // 9: odpf.compass.v1beta1.CreateCommentResponse + (*GetAllCommentsRequest)(nil), // 10: odpf.compass.v1beta1.GetAllCommentsRequest + (*GetAllCommentsResponse)(nil), // 11: odpf.compass.v1beta1.GetAllCommentsResponse + (*GetCommentRequest)(nil), // 12: odpf.compass.v1beta1.GetCommentRequest + (*GetCommentResponse)(nil), // 13: odpf.compass.v1beta1.GetCommentResponse + (*UpdateCommentRequest)(nil), // 14: odpf.compass.v1beta1.UpdateCommentRequest + (*UpdateCommentResponse)(nil), // 15: odpf.compass.v1beta1.UpdateCommentResponse + (*DeleteCommentRequest)(nil), // 16: odpf.compass.v1beta1.DeleteCommentRequest + (*DeleteCommentResponse)(nil), // 17: odpf.compass.v1beta1.DeleteCommentResponse + (*SearchAssetsRequest)(nil), // 18: odpf.compass.v1beta1.SearchAssetsRequest + (*SearchAssetsResponse)(nil), // 19: odpf.compass.v1beta1.SearchAssetsResponse + (*SuggestAssetsRequest)(nil), // 20: odpf.compass.v1beta1.SuggestAssetsRequest + (*SuggestAssetsResponse)(nil), // 21: odpf.compass.v1beta1.SuggestAssetsResponse + (*GetGraphRequest)(nil), // 22: odpf.compass.v1beta1.GetGraphRequest + (*GetGraphResponse)(nil), // 23: odpf.compass.v1beta1.GetGraphResponse + (*GetAllAssetsRequest)(nil), // 24: odpf.compass.v1beta1.GetAllAssetsRequest + (*GetAllAssetsResponse)(nil), // 25: odpf.compass.v1beta1.GetAllAssetsResponse + (*GetAssetByIDRequest)(nil), // 26: odpf.compass.v1beta1.GetAssetByIDRequest + (*GetAssetByIDResponse)(nil), // 27: odpf.compass.v1beta1.GetAssetByIDResponse + (*UpsertAssetRequest)(nil), // 28: odpf.compass.v1beta1.UpsertAssetRequest + (*UpsertAssetResponse)(nil), // 29: odpf.compass.v1beta1.UpsertAssetResponse + (*UpsertPatchAssetRequest)(nil), // 30: odpf.compass.v1beta1.UpsertPatchAssetRequest + (*UpsertPatchAssetResponse)(nil), // 31: odpf.compass.v1beta1.UpsertPatchAssetResponse + (*DeleteAssetRequest)(nil), // 32: odpf.compass.v1beta1.DeleteAssetRequest + (*DeleteAssetResponse)(nil), // 33: odpf.compass.v1beta1.DeleteAssetResponse + (*GetAssetStargazersRequest)(nil), // 34: odpf.compass.v1beta1.GetAssetStargazersRequest + (*GetAssetStargazersResponse)(nil), // 35: odpf.compass.v1beta1.GetAssetStargazersResponse + (*GetAssetVersionHistoryRequest)(nil), // 36: odpf.compass.v1beta1.GetAssetVersionHistoryRequest + (*GetAssetVersionHistoryResponse)(nil), // 37: odpf.compass.v1beta1.GetAssetVersionHistoryResponse + (*GetAssetByVersionRequest)(nil), // 38: odpf.compass.v1beta1.GetAssetByVersionRequest + (*GetAssetByVersionResponse)(nil), // 39: odpf.compass.v1beta1.GetAssetByVersionResponse + (*User)(nil), // 40: odpf.compass.v1beta1.User + (*Changelog)(nil), // 41: odpf.compass.v1beta1.Changelog + (*Change)(nil), // 42: odpf.compass.v1beta1.Change + (*Asset)(nil), // 43: odpf.compass.v1beta1.Asset + (*Discussion)(nil), // 44: odpf.compass.v1beta1.Discussion + (*Comment)(nil), // 45: odpf.compass.v1beta1.Comment + (*LineageEdge)(nil), // 46: odpf.compass.v1beta1.LineageEdge + (*LineageNode)(nil), // 47: odpf.compass.v1beta1.LineageNode + nil, // 48: odpf.compass.v1beta1.SearchAssetsRequest.FilterEntry + nil, // 49: odpf.compass.v1beta1.SearchAssetsRequest.QueryEntry + nil, // 50: odpf.compass.v1beta1.SuggestAssetsRequest.FilterEntry + nil, // 51: odpf.compass.v1beta1.SuggestAssetsRequest.QueryEntry + (*UpsertAssetRequest_BaseAsset)(nil), // 52: odpf.compass.v1beta1.UpsertAssetRequest.BaseAsset + (*UpsertPatchAssetRequest_BaseAsset)(nil), // 53: odpf.compass.v1beta1.UpsertPatchAssetRequest.BaseAsset + (*timestamppb.Timestamp)(nil), // 54: google.protobuf.Timestamp + (*structpb.Value)(nil), // 55: google.protobuf.Value + (*structpb.Struct)(nil), // 56: google.protobuf.Struct + (*wrapperspb.StringValue)(nil), // 57: google.protobuf.StringValue +} +var file_odpf_compass_v1beta1_service_proto_depIdxs = []int32{ + 44, // 0: odpf.compass.v1beta1.GetAllDiscussionsResponse.data:type_name -> odpf.compass.v1beta1.Discussion + 44, // 1: odpf.compass.v1beta1.GetDiscussionResponse.data:type_name -> odpf.compass.v1beta1.Discussion + 45, // 2: odpf.compass.v1beta1.GetAllCommentsResponse.data:type_name -> odpf.compass.v1beta1.Comment + 45, // 3: odpf.compass.v1beta1.GetCommentResponse.data:type_name -> odpf.compass.v1beta1.Comment + 48, // 4: odpf.compass.v1beta1.SearchAssetsRequest.filter:type_name -> odpf.compass.v1beta1.SearchAssetsRequest.FilterEntry + 49, // 5: odpf.compass.v1beta1.SearchAssetsRequest.query:type_name -> odpf.compass.v1beta1.SearchAssetsRequest.QueryEntry + 43, // 6: odpf.compass.v1beta1.SearchAssetsResponse.data:type_name -> odpf.compass.v1beta1.Asset + 50, // 7: odpf.compass.v1beta1.SuggestAssetsRequest.filter:type_name -> odpf.compass.v1beta1.SuggestAssetsRequest.FilterEntry + 51, // 8: odpf.compass.v1beta1.SuggestAssetsRequest.query:type_name -> odpf.compass.v1beta1.SuggestAssetsRequest.QueryEntry + 46, // 9: odpf.compass.v1beta1.GetGraphResponse.data:type_name -> odpf.compass.v1beta1.LineageEdge + 43, // 10: odpf.compass.v1beta1.GetAllAssetsResponse.data:type_name -> odpf.compass.v1beta1.Asset + 43, // 11: odpf.compass.v1beta1.GetAssetByIDResponse.data:type_name -> odpf.compass.v1beta1.Asset + 52, // 12: odpf.compass.v1beta1.UpsertAssetRequest.asset:type_name -> odpf.compass.v1beta1.UpsertAssetRequest.BaseAsset + 47, // 13: odpf.compass.v1beta1.UpsertAssetRequest.upstreams:type_name -> odpf.compass.v1beta1.LineageNode + 47, // 14: odpf.compass.v1beta1.UpsertAssetRequest.downstreams:type_name -> odpf.compass.v1beta1.LineageNode + 53, // 15: odpf.compass.v1beta1.UpsertPatchAssetRequest.asset:type_name -> odpf.compass.v1beta1.UpsertPatchAssetRequest.BaseAsset + 47, // 16: odpf.compass.v1beta1.UpsertPatchAssetRequest.upstreams:type_name -> odpf.compass.v1beta1.LineageNode + 47, // 17: odpf.compass.v1beta1.UpsertPatchAssetRequest.downstreams:type_name -> odpf.compass.v1beta1.LineageNode + 40, // 18: odpf.compass.v1beta1.GetAssetStargazersResponse.data:type_name -> odpf.compass.v1beta1.User + 43, // 19: odpf.compass.v1beta1.GetAssetVersionHistoryResponse.data:type_name -> odpf.compass.v1beta1.Asset + 43, // 20: odpf.compass.v1beta1.GetAssetByVersionResponse.data:type_name -> odpf.compass.v1beta1.Asset + 54, // 21: odpf.compass.v1beta1.User.created_at:type_name -> google.protobuf.Timestamp + 54, // 22: odpf.compass.v1beta1.User.updated_at:type_name -> google.protobuf.Timestamp + 42, // 23: odpf.compass.v1beta1.Changelog.changes:type_name -> odpf.compass.v1beta1.Change + 55, // 24: odpf.compass.v1beta1.Change.from:type_name -> google.protobuf.Value + 55, // 25: odpf.compass.v1beta1.Change.to:type_name -> google.protobuf.Value + 56, // 26: odpf.compass.v1beta1.Asset.data:type_name -> google.protobuf.Struct + 56, // 27: odpf.compass.v1beta1.Asset.labels:type_name -> google.protobuf.Struct + 40, // 28: odpf.compass.v1beta1.Asset.owners:type_name -> odpf.compass.v1beta1.User + 40, // 29: odpf.compass.v1beta1.Asset.updated_by:type_name -> odpf.compass.v1beta1.User + 41, // 30: odpf.compass.v1beta1.Asset.changelog:type_name -> odpf.compass.v1beta1.Changelog + 54, // 31: odpf.compass.v1beta1.Asset.created_at:type_name -> google.protobuf.Timestamp + 54, // 32: odpf.compass.v1beta1.Asset.updated_at:type_name -> google.protobuf.Timestamp + 40, // 33: odpf.compass.v1beta1.Discussion.owner:type_name -> odpf.compass.v1beta1.User + 54, // 34: odpf.compass.v1beta1.Discussion.created_at:type_name -> google.protobuf.Timestamp + 54, // 35: odpf.compass.v1beta1.Discussion.updated_at:type_name -> google.protobuf.Timestamp + 40, // 36: odpf.compass.v1beta1.Comment.owner:type_name -> odpf.compass.v1beta1.User + 40, // 37: odpf.compass.v1beta1.Comment.updated_by:type_name -> odpf.compass.v1beta1.User + 54, // 38: odpf.compass.v1beta1.Comment.created_at:type_name -> google.protobuf.Timestamp + 54, // 39: odpf.compass.v1beta1.Comment.updated_at:type_name -> google.protobuf.Timestamp + 56, // 40: odpf.compass.v1beta1.LineageEdge.prop:type_name -> google.protobuf.Struct + 56, // 41: odpf.compass.v1beta1.UpsertAssetRequest.BaseAsset.data:type_name -> google.protobuf.Struct + 56, // 42: odpf.compass.v1beta1.UpsertAssetRequest.BaseAsset.labels:type_name -> google.protobuf.Struct + 57, // 43: odpf.compass.v1beta1.UpsertPatchAssetRequest.BaseAsset.name:type_name -> google.protobuf.StringValue + 57, // 44: odpf.compass.v1beta1.UpsertPatchAssetRequest.BaseAsset.description:type_name -> google.protobuf.StringValue + 56, // 45: odpf.compass.v1beta1.UpsertPatchAssetRequest.BaseAsset.data:type_name -> google.protobuf.Struct + 56, // 46: odpf.compass.v1beta1.UpsertPatchAssetRequest.BaseAsset.labels:type_name -> google.protobuf.Struct + 0, // 47: odpf.compass.v1beta1.CompassService.GetAllDiscussions:input_type -> odpf.compass.v1beta1.GetAllDiscussionsRequest + 2, // 48: odpf.compass.v1beta1.CompassService.CreateDiscussion:input_type -> odpf.compass.v1beta1.CreateDiscussionRequest + 4, // 49: odpf.compass.v1beta1.CompassService.GetDiscussion:input_type -> odpf.compass.v1beta1.GetDiscussionRequest + 6, // 50: odpf.compass.v1beta1.CompassService.PatchDiscussion:input_type -> odpf.compass.v1beta1.PatchDiscussionRequest + 7, // 51: odpf.compass.v1beta1.CompassService.CreateComment:input_type -> odpf.compass.v1beta1.CreateCommentRequest + 10, // 52: odpf.compass.v1beta1.CompassService.GetAllComments:input_type -> odpf.compass.v1beta1.GetAllCommentsRequest + 12, // 53: odpf.compass.v1beta1.CompassService.GetComment:input_type -> odpf.compass.v1beta1.GetCommentRequest + 14, // 54: odpf.compass.v1beta1.CompassService.UpdateComment:input_type -> odpf.compass.v1beta1.UpdateCommentRequest + 16, // 55: odpf.compass.v1beta1.CompassService.DeleteComment:input_type -> odpf.compass.v1beta1.DeleteCommentRequest + 18, // 56: odpf.compass.v1beta1.CompassService.SearchAssets:input_type -> odpf.compass.v1beta1.SearchAssetsRequest + 20, // 57: odpf.compass.v1beta1.CompassService.SuggestAssets:input_type -> odpf.compass.v1beta1.SuggestAssetsRequest + 22, // 58: odpf.compass.v1beta1.CompassService.GetGraph:input_type -> odpf.compass.v1beta1.GetGraphRequest + 24, // 59: odpf.compass.v1beta1.CompassService.GetAllAssets:input_type -> odpf.compass.v1beta1.GetAllAssetsRequest + 26, // 60: odpf.compass.v1beta1.CompassService.GetAssetByID:input_type -> odpf.compass.v1beta1.GetAssetByIDRequest + 28, // 61: odpf.compass.v1beta1.CompassService.UpsertAsset:input_type -> odpf.compass.v1beta1.UpsertAssetRequest + 30, // 62: odpf.compass.v1beta1.CompassService.UpsertPatchAsset:input_type -> odpf.compass.v1beta1.UpsertPatchAssetRequest + 32, // 63: odpf.compass.v1beta1.CompassService.DeleteAsset:input_type -> odpf.compass.v1beta1.DeleteAssetRequest + 34, // 64: odpf.compass.v1beta1.CompassService.GetAssetStargazers:input_type -> odpf.compass.v1beta1.GetAssetStargazersRequest + 36, // 65: odpf.compass.v1beta1.CompassService.GetAssetVersionHistory:input_type -> odpf.compass.v1beta1.GetAssetVersionHistoryRequest + 38, // 66: odpf.compass.v1beta1.CompassService.GetAssetByVersion:input_type -> odpf.compass.v1beta1.GetAssetByVersionRequest + 1, // 67: odpf.compass.v1beta1.CompassService.GetAllDiscussions:output_type -> odpf.compass.v1beta1.GetAllDiscussionsResponse + 3, // 68: odpf.compass.v1beta1.CompassService.CreateDiscussion:output_type -> odpf.compass.v1beta1.CreateDiscussionResponse + 5, // 69: odpf.compass.v1beta1.CompassService.GetDiscussion:output_type -> odpf.compass.v1beta1.GetDiscussionResponse + 8, // 70: odpf.compass.v1beta1.CompassService.PatchDiscussion:output_type -> odpf.compass.v1beta1.PatchDiscussionResponse + 9, // 71: odpf.compass.v1beta1.CompassService.CreateComment:output_type -> odpf.compass.v1beta1.CreateCommentResponse + 11, // 72: odpf.compass.v1beta1.CompassService.GetAllComments:output_type -> odpf.compass.v1beta1.GetAllCommentsResponse + 13, // 73: odpf.compass.v1beta1.CompassService.GetComment:output_type -> odpf.compass.v1beta1.GetCommentResponse + 15, // 74: odpf.compass.v1beta1.CompassService.UpdateComment:output_type -> odpf.compass.v1beta1.UpdateCommentResponse + 17, // 75: odpf.compass.v1beta1.CompassService.DeleteComment:output_type -> odpf.compass.v1beta1.DeleteCommentResponse + 19, // 76: odpf.compass.v1beta1.CompassService.SearchAssets:output_type -> odpf.compass.v1beta1.SearchAssetsResponse + 21, // 77: odpf.compass.v1beta1.CompassService.SuggestAssets:output_type -> odpf.compass.v1beta1.SuggestAssetsResponse + 23, // 78: odpf.compass.v1beta1.CompassService.GetGraph:output_type -> odpf.compass.v1beta1.GetGraphResponse + 25, // 79: odpf.compass.v1beta1.CompassService.GetAllAssets:output_type -> odpf.compass.v1beta1.GetAllAssetsResponse + 27, // 80: odpf.compass.v1beta1.CompassService.GetAssetByID:output_type -> odpf.compass.v1beta1.GetAssetByIDResponse + 29, // 81: odpf.compass.v1beta1.CompassService.UpsertAsset:output_type -> odpf.compass.v1beta1.UpsertAssetResponse + 31, // 82: odpf.compass.v1beta1.CompassService.UpsertPatchAsset:output_type -> odpf.compass.v1beta1.UpsertPatchAssetResponse + 33, // 83: odpf.compass.v1beta1.CompassService.DeleteAsset:output_type -> odpf.compass.v1beta1.DeleteAssetResponse + 35, // 84: odpf.compass.v1beta1.CompassService.GetAssetStargazers:output_type -> odpf.compass.v1beta1.GetAssetStargazersResponse + 37, // 85: odpf.compass.v1beta1.CompassService.GetAssetVersionHistory:output_type -> odpf.compass.v1beta1.GetAssetVersionHistoryResponse + 39, // 86: odpf.compass.v1beta1.CompassService.GetAssetByVersion:output_type -> odpf.compass.v1beta1.GetAssetByVersionResponse + 67, // [67:87] is the sub-list for method output_type + 47, // [47:67] is the sub-list for method input_type + 47, // [47:47] is the sub-list for extension type_name + 47, // [47:47] is the sub-list for extension extendee + 0, // [0:47] is the sub-list for field type_name +} + +func init() { file_odpf_compass_v1beta1_service_proto_init() } +func file_odpf_compass_v1beta1_service_proto_init() { + if File_odpf_compass_v1beta1_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_odpf_compass_v1beta1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllDiscussionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllDiscussionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDiscussionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDiscussionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDiscussionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDiscussionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchDiscussionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchDiscussionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllCommentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllCommentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchAssetsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchAssetsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SuggestAssetsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SuggestAssetsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGraphRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGraphResponse); i { case 0: return &v.state case 1: @@ -2172,8 +4573,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllDiscussionsResponse); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllAssetsRequest); i { case 0: return &v.state case 1: @@ -2184,8 +4585,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDiscussionRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllAssetsResponse); i { case 0: return &v.state case 1: @@ -2196,8 +4597,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDiscussionResponse); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetByIDRequest); i { case 0: return &v.state case 1: @@ -2208,8 +4609,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiscussionRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetByIDResponse); i { case 0: return &v.state case 1: @@ -2220,8 +4621,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDiscussionResponse); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertAssetRequest); i { case 0: return &v.state case 1: @@ -2232,8 +4633,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchDiscussionRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertAssetResponse); i { case 0: return &v.state case 1: @@ -2244,8 +4645,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCommentRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertPatchAssetRequest); i { case 0: return &v.state case 1: @@ -2256,8 +4657,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCommentResponse); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertPatchAssetResponse); i { case 0: return &v.state case 1: @@ -2268,8 +4669,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllCommentsRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAssetRequest); i { case 0: return &v.state case 1: @@ -2280,8 +4681,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllCommentsResponse); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAssetResponse); i { case 0: return &v.state case 1: @@ -2292,8 +4693,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommentRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetStargazersRequest); i { case 0: return &v.state case 1: @@ -2304,8 +4705,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommentResponse); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetStargazersResponse); i { case 0: return &v.state case 1: @@ -2316,8 +4717,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateCommentRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetVersionHistoryRequest); i { case 0: return &v.state case 1: @@ -2328,8 +4729,8 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteCommentRequest); i { + file_odpf_compass_v1beta1_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetVersionHistoryResponse); i { case 0: return &v.state case 1: @@ -2340,7 +4741,31 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_odpf_compass_v1beta1_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetByVersionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssetByVersionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*User); i { case 0: return &v.state @@ -2352,7 +4777,7 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_odpf_compass_v1beta1_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Changelog); i { case 0: return &v.state @@ -2364,7 +4789,7 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_odpf_compass_v1beta1_service_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Change); i { case 0: return &v.state @@ -2376,7 +4801,7 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_odpf_compass_v1beta1_service_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Asset); i { case 0: return &v.state @@ -2388,7 +4813,7 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_odpf_compass_v1beta1_service_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Discussion); i { case 0: return &v.state @@ -2400,7 +4825,7 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } - file_odpf_compass_v1beta1_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_odpf_compass_v1beta1_service_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Comment); i { case 0: return &v.state @@ -2412,20 +4837,67 @@ func file_odpf_compass_v1beta1_service_proto_init() { return nil } } + file_odpf_compass_v1beta1_service_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LineageEdge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LineageNode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertAssetRequest_BaseAsset); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_odpf_compass_v1beta1_service_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertPatchAssetRequest_BaseAsset); 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_odpf_compass_v1beta1_service_proto_rawDesc, - NumEnums: 1, - NumMessages: 21, + NumEnums: 0, + NumMessages: 54, NumExtensions: 0, NumServices: 1, }, GoTypes: file_odpf_compass_v1beta1_service_proto_goTypes, DependencyIndexes: file_odpf_compass_v1beta1_service_proto_depIdxs, - EnumInfos: file_odpf_compass_v1beta1_service_proto_enumTypes, MessageInfos: file_odpf_compass_v1beta1_service_proto_msgTypes, }.Build() File_odpf_compass_v1beta1_service_proto = out.File diff --git a/api/proto/odpf/compass/v1beta1/service.pb.gw.go b/api/proto/odpf/compass/v1beta1/service.pb.gw.go index 61e06677..c4391824 100644 --- a/api/proto/odpf/compass/v1beta1/service.pb.gw.go +++ b/api/proto/odpf/compass/v1beta1/service.pb.gw.go @@ -591,24 +591,798 @@ func local_request_CompassService_DeleteComment_0(ctx context.Context, marshaler } +var ( + filter_CompassService_SearchAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CompassService_SearchAssets_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_SearchAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SearchAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_SearchAssets_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_SearchAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SearchAssets(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CompassService_SuggestAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CompassService_SuggestAssets_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SuggestAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_SuggestAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SuggestAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_SuggestAssets_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SuggestAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_SuggestAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SuggestAssets(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CompassService_GetGraph_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetGraphRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["urn"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "urn") + } + + protoReq.Urn, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "urn", err) + } + + msg, err := client.GetGraph(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_GetGraph_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetGraphRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["urn"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "urn") + } + + protoReq.Urn, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "urn", err) + } + + msg, err := server.GetGraph(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CompassService_GetAllAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_CompassService_GetAllAssets_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAllAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_GetAllAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAllAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_GetAllAssets_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAllAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_GetAllAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetAllAssets(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CompassService_GetAssetByID_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetByIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetAssetByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_GetAssetByID_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetByIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetAssetByID(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CompassService_UpsertAsset_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpsertAssetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpsertAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_UpsertAsset_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpsertAssetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpsertAsset(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CompassService_UpsertPatchAsset_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpsertPatchAssetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpsertPatchAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_UpsertPatchAsset_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpsertPatchAssetRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpsertPatchAsset(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CompassService_DeleteAsset_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteAssetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.DeleteAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_DeleteAsset_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteAssetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.DeleteAsset(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CompassService_GetAssetStargazers_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_CompassService_GetAssetStargazers_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetStargazersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_GetAssetStargazers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAssetStargazers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_GetAssetStargazers_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetStargazersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_GetAssetStargazers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetAssetStargazers(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_CompassService_GetAssetVersionHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_CompassService_GetAssetVersionHistory_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetVersionHistoryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_GetAssetVersionHistory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAssetVersionHistory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_GetAssetVersionHistory_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetVersionHistoryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CompassService_GetAssetVersionHistory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetAssetVersionHistory(ctx, &protoReq) + return msg, metadata, err + +} + +func request_CompassService_GetAssetByVersion_0(ctx context.Context, marshaler runtime.Marshaler, client CompassServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetByVersionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + val, ok = pathParams["version"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "version") + } + + protoReq.Version, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "version", err) + } + + msg, err := client.GetAssetByVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_CompassService_GetAssetByVersion_0(ctx context.Context, marshaler runtime.Marshaler, server CompassServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAssetByVersionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + val, ok = pathParams["version"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "version") + } + + protoReq.Version, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "version", err) + } + + msg, err := server.GetAssetByVersion(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterCompassServiceHandlerServer registers the http handlers for service CompassService to "mux". // UnaryRPC :call CompassServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCompassServiceHandlerFromEndpoint instead. func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CompassServiceServer) error { - mux.Handle("GET", pattern_CompassService_GetAllDiscussions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_CompassService_GetAllDiscussions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAllDiscussions", runtime.WithHTTPPathPattern("/v1beta1/discussions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_GetAllDiscussions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAllDiscussions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CompassService_CreateDiscussion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/CreateDiscussion", runtime.WithHTTPPathPattern("/v1beta1/discussions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_CreateDiscussion_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_CreateDiscussion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetDiscussion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetDiscussion", runtime.WithHTTPPathPattern("/v1beta1/discussions/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_GetDiscussion_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetDiscussion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_CompassService_PatchDiscussion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/PatchDiscussion", runtime.WithHTTPPathPattern("/v1beta1/discussions/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_PatchDiscussion_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_PatchDiscussion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_CompassService_CreateComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/CreateComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_CreateComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_CreateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAllComments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAllComments", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_GetAllComments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAllComments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_GetComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_CompassService_UpdateComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/UpdateComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_UpdateComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_UpdateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_CompassService_DeleteComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/DeleteComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_DeleteComment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_DeleteComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_SearchAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/SearchAssets", runtime.WithHTTPPathPattern("/v1beta1/search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_SearchAssets_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_SearchAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_SuggestAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAllDiscussions", runtime.WithHTTPPathPattern("/v1beta1/discussions")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/SuggestAssets", runtime.WithHTTPPathPattern("/v1beta1/search/suggest")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_GetAllDiscussions_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_SuggestAssets_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -616,22 +1390,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_GetAllDiscussions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_SuggestAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_CompassService_CreateDiscussion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_CompassService_GetGraph_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/CreateDiscussion", runtime.WithHTTPPathPattern("/v1beta1/discussions")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetGraph", runtime.WithHTTPPathPattern("/v1beta1/lineage/{urn}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_CreateDiscussion_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_GetGraph_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -639,22 +1413,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_CreateDiscussion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_GetGraph_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_CompassService_GetDiscussion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_CompassService_GetAllAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetDiscussion", runtime.WithHTTPPathPattern("/v1beta1/discussions/{id}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAllAssets", runtime.WithHTTPPathPattern("/v1beta1/assets")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_GetDiscussion_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_GetAllAssets_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -662,22 +1436,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_GetDiscussion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_GetAllAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("PATCH", pattern_CompassService_PatchDiscussion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_CompassService_GetAssetByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/PatchDiscussion", runtime.WithHTTPPathPattern("/v1beta1/discussions/{id}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetByID", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_PatchDiscussion_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_GetAssetByID_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -685,22 +1459,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_PatchDiscussion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_GetAssetByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_CompassService_CreateComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PUT", pattern_CompassService_UpsertAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/CreateComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/UpsertAsset", runtime.WithHTTPPathPattern("/v1beta1/assets")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_CreateComment_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_UpsertAsset_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -708,22 +1482,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_CreateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_UpsertAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_CompassService_GetAllComments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PATCH", pattern_CompassService_UpsertPatchAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAllComments", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/UpsertPatchAsset", runtime.WithHTTPPathPattern("/v1beta1/assets")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_GetAllComments_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_UpsertPatchAsset_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -731,22 +1505,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_GetAllComments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_UpsertPatchAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_CompassService_GetComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_CompassService_DeleteAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments/{id}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/DeleteAsset", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_GetComment_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_DeleteAsset_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -754,22 +1528,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_GetComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_DeleteAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("PUT", pattern_CompassService_UpdateComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_CompassService_GetAssetStargazers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/UpdateComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments/{id}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetStargazers", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}/stargazers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_UpdateComment_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_GetAssetStargazers_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -777,22 +1551,22 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_UpdateComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_GetAssetStargazers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_CompassService_DeleteComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_CompassService_GetAssetVersionHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/DeleteComment", runtime.WithHTTPPathPattern("/v1beta1/discussions/{discussion_id}/comments/{id}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetVersionHistory", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}/versions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_CompassService_DeleteComment_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_CompassService_GetAssetVersionHistory_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -800,7 +1574,30 @@ func RegisterCompassServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_CompassService_DeleteComment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_CompassService_GetAssetVersionHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAssetByVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetByVersion", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}/versions/{version}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_CompassService_GetAssetByVersion_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAssetByVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1025,6 +1822,226 @@ func RegisterCompassServiceHandlerClient(ctx context.Context, mux *runtime.Serve }) + mux.Handle("GET", pattern_CompassService_SearchAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/SearchAssets", runtime.WithHTTPPathPattern("/v1beta1/search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_SearchAssets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_SearchAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_SuggestAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/SuggestAssets", runtime.WithHTTPPathPattern("/v1beta1/search/suggest")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_SuggestAssets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_SuggestAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetGraph_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetGraph", runtime.WithHTTPPathPattern("/v1beta1/lineage/{urn}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_GetGraph_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetGraph_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAllAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAllAssets", runtime.WithHTTPPathPattern("/v1beta1/assets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_GetAllAssets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAllAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAssetByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetByID", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_GetAssetByID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAssetByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_CompassService_UpsertAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/UpsertAsset", runtime.WithHTTPPathPattern("/v1beta1/assets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_UpsertAsset_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_UpsertAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_CompassService_UpsertPatchAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/UpsertPatchAsset", runtime.WithHTTPPathPattern("/v1beta1/assets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_UpsertPatchAsset_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_UpsertPatchAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_CompassService_DeleteAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/DeleteAsset", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_DeleteAsset_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_DeleteAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAssetStargazers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetStargazers", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}/stargazers")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_GetAssetStargazers_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAssetStargazers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAssetVersionHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetVersionHistory", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}/versions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_GetAssetVersionHistory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAssetVersionHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_CompassService_GetAssetByVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/odpf.compass.v1beta1.CompassService/GetAssetByVersion", runtime.WithHTTPPathPattern("/v1beta1/assets/{id}/versions/{version}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CompassService_GetAssetByVersion_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CompassService_GetAssetByVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1046,6 +2063,28 @@ var ( pattern_CompassService_UpdateComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1beta1", "discussions", "discussion_id", "comments", "id"}, "")) pattern_CompassService_DeleteComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1beta1", "discussions", "discussion_id", "comments", "id"}, "")) + + pattern_CompassService_SearchAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1beta1", "search"}, "")) + + pattern_CompassService_SuggestAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1beta1", "search", "suggest"}, "")) + + pattern_CompassService_GetGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1beta1", "lineage", "urn"}, "")) + + pattern_CompassService_GetAllAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1beta1", "assets"}, "")) + + pattern_CompassService_GetAssetByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1beta1", "assets", "id"}, "")) + + pattern_CompassService_UpsertAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1beta1", "assets"}, "")) + + pattern_CompassService_UpsertPatchAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1beta1", "assets"}, "")) + + pattern_CompassService_DeleteAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1beta1", "assets", "id"}, "")) + + pattern_CompassService_GetAssetStargazers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "assets", "id", "stargazers"}, "")) + + pattern_CompassService_GetAssetVersionHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1beta1", "assets", "id", "versions"}, "")) + + pattern_CompassService_GetAssetByVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1beta1", "assets", "id", "versions", "version"}, "")) ) var ( @@ -1066,4 +2105,26 @@ var ( forward_CompassService_UpdateComment_0 = runtime.ForwardResponseMessage forward_CompassService_DeleteComment_0 = runtime.ForwardResponseMessage + + forward_CompassService_SearchAssets_0 = runtime.ForwardResponseMessage + + forward_CompassService_SuggestAssets_0 = runtime.ForwardResponseMessage + + forward_CompassService_GetGraph_0 = runtime.ForwardResponseMessage + + forward_CompassService_GetAllAssets_0 = runtime.ForwardResponseMessage + + forward_CompassService_GetAssetByID_0 = runtime.ForwardResponseMessage + + forward_CompassService_UpsertAsset_0 = runtime.ForwardResponseMessage + + forward_CompassService_UpsertPatchAsset_0 = runtime.ForwardResponseMessage + + forward_CompassService_DeleteAsset_0 = runtime.ForwardResponseMessage + + forward_CompassService_GetAssetStargazers_0 = runtime.ForwardResponseMessage + + forward_CompassService_GetAssetVersionHistory_0 = runtime.ForwardResponseMessage + + forward_CompassService_GetAssetByVersion_0 = runtime.ForwardResponseMessage ) diff --git a/api/proto/odpf/compass/v1beta1/service.pb.validate.go b/api/proto/odpf/compass/v1beta1/service.pb.validate.go index f24cbbca..ca3bb741 100644 --- a/api/proto/odpf/compass/v1beta1/service.pb.validate.go +++ b/api/proto/odpf/compass/v1beta1/service.pb.validate.go @@ -1320,6 +1320,108 @@ var _ interface { ErrorName() string } = CreateCommentRequestValidationError{} +// Validate checks the field values on PatchDiscussionResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *PatchDiscussionResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on PatchDiscussionResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// PatchDiscussionResponseMultiError, or nil if none found. +func (m *PatchDiscussionResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *PatchDiscussionResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return PatchDiscussionResponseMultiError(errors) + } + + return nil +} + +// PatchDiscussionResponseMultiError is an error wrapping multiple validation +// errors returned by PatchDiscussionResponse.ValidateAll() if the designated +// constraints aren't met. +type PatchDiscussionResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m PatchDiscussionResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m PatchDiscussionResponseMultiError) AllErrors() []error { return m } + +// PatchDiscussionResponseValidationError is the validation error returned by +// PatchDiscussionResponse.Validate if the designated constraints aren't met. +type PatchDiscussionResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e PatchDiscussionResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e PatchDiscussionResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e PatchDiscussionResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e PatchDiscussionResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e PatchDiscussionResponseValidationError) ErrorName() string { + return "PatchDiscussionResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e PatchDiscussionResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sPatchDiscussionResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = PatchDiscussionResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = PatchDiscussionResponseValidationError{} + // Validate checks the field values on CreateCommentResponse with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -2088,6 +2190,108 @@ var _ interface { ErrorName() string } = UpdateCommentRequestValidationError{} +// Validate checks the field values on UpdateCommentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpdateCommentResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateCommentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateCommentResponseMultiError, or nil if none found. +func (m *UpdateCommentResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateCommentResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return UpdateCommentResponseMultiError(errors) + } + + return nil +} + +// UpdateCommentResponseMultiError is an error wrapping multiple validation +// errors returned by UpdateCommentResponse.ValidateAll() if the designated +// constraints aren't met. +type UpdateCommentResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateCommentResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateCommentResponseMultiError) AllErrors() []error { return m } + +// UpdateCommentResponseValidationError is the validation error returned by +// UpdateCommentResponse.Validate if the designated constraints aren't met. +type UpdateCommentResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateCommentResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateCommentResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateCommentResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateCommentResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateCommentResponseValidationError) ErrorName() string { + return "UpdateCommentResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateCommentResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateCommentResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateCommentResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateCommentResponseValidationError{} + // Validate checks the field values on DeleteCommentRequest with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -2194,106 +2398,42 @@ var _ interface { ErrorName() string } = DeleteCommentRequestValidationError{} -// Validate checks the field values on User with the rules defined in the proto -// definition for this message. If any rules are violated, the first error -// encountered is returned, or nil if there are no violations. -func (m *User) Validate() error { +// Validate checks the field values on DeleteCommentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteCommentResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on User with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in UserMultiError, or nil if none found. -func (m *User) ValidateAll() error { +// ValidateAll checks the field values on DeleteCommentResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteCommentResponseMultiError, or nil if none found. +func (m *DeleteCommentResponse) ValidateAll() error { return m.validate(true) } -func (m *User) validate(all bool) error { +func (m *DeleteCommentResponse) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Id - - // no validation rules for Uuid - - // no validation rules for Email - - // no validation rules for Provider - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UserValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UserValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UserValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UserValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UserValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UserValidationError{ - field: "UpdatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - if len(errors) > 0 { - return UserMultiError(errors) + return DeleteCommentResponseMultiError(errors) } return nil } -// UserMultiError is an error wrapping multiple validation errors returned by -// User.ValidateAll() if the designated constraints aren't met. -type UserMultiError []error +// DeleteCommentResponseMultiError is an error wrapping multiple validation +// errors returned by DeleteCommentResponse.ValidateAll() if the designated +// constraints aren't met. +type DeleteCommentResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m UserMultiError) Error() string { +func (m DeleteCommentResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -2302,11 +2442,11 @@ func (m UserMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m UserMultiError) AllErrors() []error { return m } +func (m DeleteCommentResponseMultiError) AllErrors() []error { return m } -// UserValidationError is the validation error returned by User.Validate if the -// designated constraints aren't met. -type UserValidationError struct { +// DeleteCommentResponseValidationError is the validation error returned by +// DeleteCommentResponse.Validate if the designated constraints aren't met. +type DeleteCommentResponseValidationError struct { field string reason string cause error @@ -2314,22 +2454,24 @@ type UserValidationError struct { } // Field function returns field value. -func (e UserValidationError) Field() string { return e.field } +func (e DeleteCommentResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e UserValidationError) Reason() string { return e.reason } +func (e DeleteCommentResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e UserValidationError) Cause() error { return e.cause } +func (e DeleteCommentResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e UserValidationError) Key() bool { return e.key } +func (e DeleteCommentResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e UserValidationError) ErrorName() string { return "UserValidationError" } +func (e DeleteCommentResponseValidationError) ErrorName() string { + return "DeleteCommentResponseValidationError" +} // Error satisfies the builtin error interface -func (e UserValidationError) Error() string { +func (e DeleteCommentResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2341,14 +2483,14 @@ func (e UserValidationError) Error() string { } return fmt.Sprintf( - "invalid %sUser.%s: %s%s", + "invalid %sDeleteCommentResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = UserValidationError{} +var _ error = DeleteCommentResponseValidationError{} var _ interface { Field() string @@ -2356,77 +2498,75 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = UserValidationError{} +} = DeleteCommentResponseValidationError{} -// Validate checks the field values on Changelog with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Changelog) Validate() error { +// Validate checks the field values on SearchAssetsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SearchAssetsRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Changelog with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in ChangelogMultiError, or nil -// if none found. -func (m *Changelog) ValidateAll() error { +// ValidateAll checks the field values on SearchAssetsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SearchAssetsRequestMultiError, or nil if none found. +func (m *SearchAssetsRequest) ValidateAll() error { return m.validate(true) } -func (m *Changelog) validate(all bool) error { +func (m *SearchAssetsRequest) validate(all bool) error { if m == nil { return nil } var errors []error - for idx, item := range m.GetChanges() { - _, _ = idx, item + if m.GetText() != "" { - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangelogValidationError{ - field: fmt.Sprintf("Changes[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangelogValidationError{ - field: fmt.Sprintf("Changes[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } + } + + if m.GetRankby() != "" { + + } + + if m.GetSearchby() != "" { + + } + + if m.GetSize() != 0 { + + if m.GetSize() < 0 { + err := SearchAssetsRequestValidationError{ + field: "Size", + reason: "value must be greater than or equal to 0", } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangelogValidationError{ - field: fmt.Sprintf("Changes[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } + if !all { + return err } + errors = append(errors, err) } } + // no validation rules for Filter + + // no validation rules for Query + if len(errors) > 0 { - return ChangelogMultiError(errors) + return SearchAssetsRequestMultiError(errors) } return nil } -// ChangelogMultiError is an error wrapping multiple validation errors returned -// by Changelog.ValidateAll() if the designated constraints aren't met. -type ChangelogMultiError []error +// SearchAssetsRequestMultiError is an error wrapping multiple validation +// errors returned by SearchAssetsRequest.ValidateAll() if the designated +// constraints aren't met. +type SearchAssetsRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ChangelogMultiError) Error() string { +func (m SearchAssetsRequestMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -2435,11 +2575,11 @@ func (m ChangelogMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ChangelogMultiError) AllErrors() []error { return m } +func (m SearchAssetsRequestMultiError) AllErrors() []error { return m } -// ChangelogValidationError is the validation error returned by -// Changelog.Validate if the designated constraints aren't met. -type ChangelogValidationError struct { +// SearchAssetsRequestValidationError is the validation error returned by +// SearchAssetsRequest.Validate if the designated constraints aren't met. +type SearchAssetsRequestValidationError struct { field string reason string cause error @@ -2447,22 +2587,24 @@ type ChangelogValidationError struct { } // Field function returns field value. -func (e ChangelogValidationError) Field() string { return e.field } +func (e SearchAssetsRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ChangelogValidationError) Reason() string { return e.reason } +func (e SearchAssetsRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ChangelogValidationError) Cause() error { return e.cause } +func (e SearchAssetsRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ChangelogValidationError) Key() bool { return e.key } +func (e SearchAssetsRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ChangelogValidationError) ErrorName() string { return "ChangelogValidationError" } +func (e SearchAssetsRequestValidationError) ErrorName() string { + return "SearchAssetsRequestValidationError" +} // Error satisfies the builtin error interface -func (e ChangelogValidationError) Error() string { +func (e SearchAssetsRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2474,14 +2616,14 @@ func (e ChangelogValidationError) Error() string { } return fmt.Sprintf( - "invalid %sChangelog.%s: %s%s", + "invalid %sSearchAssetsRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ChangelogValidationError{} +var _ error = SearchAssetsRequestValidationError{} var _ interface { Field() string @@ -2489,131 +2631,78 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ChangelogValidationError{} +} = SearchAssetsRequestValidationError{} -// Validate checks the field values on Change with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Change) Validate() error { +// Validate checks the field values on SearchAssetsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SearchAssetsResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Change with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in ChangeMultiError, or nil if none found. -func (m *Change) ValidateAll() error { +// ValidateAll checks the field values on SearchAssetsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SearchAssetsResponseMultiError, or nil if none found. +func (m *SearchAssetsResponse) ValidateAll() error { return m.validate(true) } -func (m *Change) validate(all bool) error { +func (m *SearchAssetsResponse) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Type - - if all { - switch v := interface{}(m.GetFrom()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeValidationError{ - field: "From", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeValidationError{ - field: "From", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFrom()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeValidationError{ - field: "From", - reason: "embedded message failed validation", - cause: err, - } - } - } + for idx, item := range m.GetData() { + _, _ = idx, item - if all { - switch v := interface{}(m.GetTo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeValidationError{ - field: "To", - reason: "embedded message failed validation", - cause: err, - }) + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SearchAssetsResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SearchAssetsResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } } - case interface{ Validate() error }: + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - errors = append(errors, ChangeValidationError{ - field: "To", + return SearchAssetsResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), reason: "embedded message failed validation", cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeValidationError{ - field: "To", - reason: "embedded message failed validation", - cause: err, + } } } - } - if all { - switch v := interface{}(m.GetParent()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeValidationError{ - field: "Parent", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeValidationError{ - field: "Parent", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParent()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeValidationError{ - field: "Parent", - reason: "embedded message failed validation", - cause: err, - } - } } if len(errors) > 0 { - return ChangeMultiError(errors) + return SearchAssetsResponseMultiError(errors) } return nil } -// ChangeMultiError is an error wrapping multiple validation errors returned by -// Change.ValidateAll() if the designated constraints aren't met. -type ChangeMultiError []error +// SearchAssetsResponseMultiError is an error wrapping multiple validation +// errors returned by SearchAssetsResponse.ValidateAll() if the designated +// constraints aren't met. +type SearchAssetsResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ChangeMultiError) Error() string { +func (m SearchAssetsResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -2622,11 +2711,11 @@ func (m ChangeMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ChangeMultiError) AllErrors() []error { return m } +func (m SearchAssetsResponseMultiError) AllErrors() []error { return m } -// ChangeValidationError is the validation error returned by Change.Validate if -// the designated constraints aren't met. -type ChangeValidationError struct { +// SearchAssetsResponseValidationError is the validation error returned by +// SearchAssetsResponse.Validate if the designated constraints aren't met. +type SearchAssetsResponseValidationError struct { field string reason string cause error @@ -2634,22 +2723,24 @@ type ChangeValidationError struct { } // Field function returns field value. -func (e ChangeValidationError) Field() string { return e.field } +func (e SearchAssetsResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ChangeValidationError) Reason() string { return e.reason } +func (e SearchAssetsResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ChangeValidationError) Cause() error { return e.cause } +func (e SearchAssetsResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ChangeValidationError) Key() bool { return e.key } +func (e SearchAssetsResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ChangeValidationError) ErrorName() string { return "ChangeValidationError" } +func (e SearchAssetsResponseValidationError) ErrorName() string { + return "SearchAssetsResponseValidationError" +} // Error satisfies the builtin error interface -func (e ChangeValidationError) Error() string { +func (e SearchAssetsResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2661,14 +2752,14 @@ func (e ChangeValidationError) Error() string { } return fmt.Sprintf( - "invalid %sChange.%s: %s%s", + "invalid %sSearchAssetsResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ChangeValidationError{} +var _ error = SearchAssetsResponseValidationError{} var _ interface { Field() string @@ -2676,140 +2767,3621 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ChangeValidationError{} +} = SearchAssetsResponseValidationError{} -// Validate checks the field values on Asset with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Asset) Validate() error { +// Validate checks the field values on SuggestAssetsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SuggestAssetsRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Asset with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in AssetMultiError, or nil if none found. -func (m *Asset) ValidateAll() error { +// ValidateAll checks the field values on SuggestAssetsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SuggestAssetsRequestMultiError, or nil if none found. +func (m *SuggestAssetsRequest) ValidateAll() error { return m.validate(true) } -func (m *Asset) validate(all bool) error { +func (m *SuggestAssetsRequest) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Id + if m.GetText() != "" { - // no validation rules for Urn + } - // no validation rules for Type + if m.GetRankby() != "" { - // no validation rules for Service + } - // no validation rules for Name + if m.GetSearchby() != "" { - // no validation rules for Description + } - if all { - switch v := interface{}(m.GetData()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ - field: "Data", - reason: "embedded message failed validation", - cause: err, - }) + if m.GetSize() != 0 { + + if m.GetSize() < 0 { + err := SuggestAssetsRequestValidationError{ + field: "Size", + reason: "value must be greater than or equal to 0", } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ - field: "Data", - reason: "embedded message failed validation", - cause: err, - }) + if !all { + return err } + errors = append(errors, err) } - } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AssetValidationError{ - field: "Data", - reason: "embedded message failed validation", - cause: err, + + } + + // no validation rules for Filter + + // no validation rules for Query + + if len(errors) > 0 { + return SuggestAssetsRequestMultiError(errors) + } + + return nil +} + +// SuggestAssetsRequestMultiError is an error wrapping multiple validation +// errors returned by SuggestAssetsRequest.ValidateAll() if the designated +// constraints aren't met. +type SuggestAssetsRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SuggestAssetsRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SuggestAssetsRequestMultiError) AllErrors() []error { return m } + +// SuggestAssetsRequestValidationError is the validation error returned by +// SuggestAssetsRequest.Validate if the designated constraints aren't met. +type SuggestAssetsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SuggestAssetsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SuggestAssetsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SuggestAssetsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SuggestAssetsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SuggestAssetsRequestValidationError) ErrorName() string { + return "SuggestAssetsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e SuggestAssetsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSuggestAssetsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SuggestAssetsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SuggestAssetsRequestValidationError{} + +// Validate checks the field values on SuggestAssetsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SuggestAssetsResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SuggestAssetsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SuggestAssetsResponseMultiError, or nil if none found. +func (m *SuggestAssetsResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *SuggestAssetsResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return SuggestAssetsResponseMultiError(errors) + } + + return nil +} + +// SuggestAssetsResponseMultiError is an error wrapping multiple validation +// errors returned by SuggestAssetsResponse.ValidateAll() if the designated +// constraints aren't met. +type SuggestAssetsResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SuggestAssetsResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SuggestAssetsResponseMultiError) AllErrors() []error { return m } + +// SuggestAssetsResponseValidationError is the validation error returned by +// SuggestAssetsResponse.Validate if the designated constraints aren't met. +type SuggestAssetsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SuggestAssetsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SuggestAssetsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SuggestAssetsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SuggestAssetsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SuggestAssetsResponseValidationError) ErrorName() string { + return "SuggestAssetsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e SuggestAssetsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSuggestAssetsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SuggestAssetsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SuggestAssetsResponseValidationError{} + +// Validate checks the field values on GetGraphRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *GetGraphRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetGraphRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetGraphRequestMultiError, or nil if none found. +func (m *GetGraphRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetGraphRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Urn + + if len(errors) > 0 { + return GetGraphRequestMultiError(errors) + } + + return nil +} + +// GetGraphRequestMultiError is an error wrapping multiple validation errors +// returned by GetGraphRequest.ValidateAll() if the designated constraints +// aren't met. +type GetGraphRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetGraphRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetGraphRequestMultiError) AllErrors() []error { return m } + +// GetGraphRequestValidationError is the validation error returned by +// GetGraphRequest.Validate if the designated constraints aren't met. +type GetGraphRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetGraphRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetGraphRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetGraphRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetGraphRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetGraphRequestValidationError) ErrorName() string { return "GetGraphRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetGraphRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetGraphRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetGraphRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetGraphRequestValidationError{} + +// Validate checks the field values on GetGraphResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *GetGraphResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetGraphResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetGraphResponseMultiError, or nil if none found. +func (m *GetGraphResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetGraphResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetData() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetGraphResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetGraphResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetGraphResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GetGraphResponseMultiError(errors) + } + + return nil +} + +// GetGraphResponseMultiError is an error wrapping multiple validation errors +// returned by GetGraphResponse.ValidateAll() if the designated constraints +// aren't met. +type GetGraphResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetGraphResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetGraphResponseMultiError) AllErrors() []error { return m } + +// GetGraphResponseValidationError is the validation error returned by +// GetGraphResponse.Validate if the designated constraints aren't met. +type GetGraphResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetGraphResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetGraphResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetGraphResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetGraphResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetGraphResponseValidationError) ErrorName() string { return "GetGraphResponseValidationError" } + +// Error satisfies the builtin error interface +func (e GetGraphResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetGraphResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetGraphResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetGraphResponseValidationError{} + +// Validate checks the field values on GetAllAssetsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAllAssetsRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAllAssetsRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAllAssetsRequestMultiError, or nil if none found. +func (m *GetAllAssetsRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAllAssetsRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetText() != "" { + + } + + if m.GetType() != "" { + + } + + if m.GetService() != "" { + + } + + if m.GetSize() != 0 { + + if m.GetSize() < 0 { + err := GetAllAssetsRequestValidationError{ + field: "Size", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if m.GetOffset() != 0 { + + if m.GetOffset() < 0 { + err := GetAllAssetsRequestValidationError{ + field: "Offset", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + // no validation rules for WithTotal + + if len(errors) > 0 { + return GetAllAssetsRequestMultiError(errors) + } + + return nil +} + +// GetAllAssetsRequestMultiError is an error wrapping multiple validation +// errors returned by GetAllAssetsRequest.ValidateAll() if the designated +// constraints aren't met. +type GetAllAssetsRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAllAssetsRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAllAssetsRequestMultiError) AllErrors() []error { return m } + +// GetAllAssetsRequestValidationError is the validation error returned by +// GetAllAssetsRequest.Validate if the designated constraints aren't met. +type GetAllAssetsRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAllAssetsRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAllAssetsRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAllAssetsRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAllAssetsRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAllAssetsRequestValidationError) ErrorName() string { + return "GetAllAssetsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAllAssetsRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAllAssetsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAllAssetsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAllAssetsRequestValidationError{} + +// Validate checks the field values on GetAllAssetsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAllAssetsResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAllAssetsResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAllAssetsResponseMultiError, or nil if none found. +func (m *GetAllAssetsResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAllAssetsResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetData() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAllAssetsResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAllAssetsResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAllAssetsResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Total + + if len(errors) > 0 { + return GetAllAssetsResponseMultiError(errors) + } + + return nil +} + +// GetAllAssetsResponseMultiError is an error wrapping multiple validation +// errors returned by GetAllAssetsResponse.ValidateAll() if the designated +// constraints aren't met. +type GetAllAssetsResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAllAssetsResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAllAssetsResponseMultiError) AllErrors() []error { return m } + +// GetAllAssetsResponseValidationError is the validation error returned by +// GetAllAssetsResponse.Validate if the designated constraints aren't met. +type GetAllAssetsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAllAssetsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAllAssetsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAllAssetsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAllAssetsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAllAssetsResponseValidationError) ErrorName() string { + return "GetAllAssetsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAllAssetsResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAllAssetsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAllAssetsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAllAssetsResponseValidationError{} + +// Validate checks the field values on GetAssetByIDRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetByIDRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetByIDRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAssetByIDRequestMultiError, or nil if none found. +func (m *GetAssetByIDRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetByIDRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetAssetByIDRequestMultiError(errors) + } + + return nil +} + +// GetAssetByIDRequestMultiError is an error wrapping multiple validation +// errors returned by GetAssetByIDRequest.ValidateAll() if the designated +// constraints aren't met. +type GetAssetByIDRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetByIDRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetByIDRequestMultiError) AllErrors() []error { return m } + +// GetAssetByIDRequestValidationError is the validation error returned by +// GetAssetByIDRequest.Validate if the designated constraints aren't met. +type GetAssetByIDRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetByIDRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetByIDRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetByIDRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetByIDRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetByIDRequestValidationError) ErrorName() string { + return "GetAssetByIDRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetByIDRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetByIDRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetByIDRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetByIDRequestValidationError{} + +// Validate checks the field values on GetAssetByIDResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetByIDResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetByIDResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAssetByIDResponseMultiError, or nil if none found. +func (m *GetAssetByIDResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetByIDResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetData()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAssetByIDResponseValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAssetByIDResponseValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAssetByIDResponseValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetAssetByIDResponseMultiError(errors) + } + + return nil +} + +// GetAssetByIDResponseMultiError is an error wrapping multiple validation +// errors returned by GetAssetByIDResponse.ValidateAll() if the designated +// constraints aren't met. +type GetAssetByIDResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetByIDResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetByIDResponseMultiError) AllErrors() []error { return m } + +// GetAssetByIDResponseValidationError is the validation error returned by +// GetAssetByIDResponse.Validate if the designated constraints aren't met. +type GetAssetByIDResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetByIDResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetByIDResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetByIDResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetByIDResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetByIDResponseValidationError) ErrorName() string { + return "GetAssetByIDResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetByIDResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetByIDResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetByIDResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetByIDResponseValidationError{} + +// Validate checks the field values on UpsertAssetRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpsertAssetRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpsertAssetRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpsertAssetRequestMultiError, or nil if none found. +func (m *UpsertAssetRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpsertAssetRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetAsset()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertAssetRequestValidationError{ + field: "Asset", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertAssetRequestValidationError{ + field: "Asset", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAsset()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertAssetRequestValidationError{ + field: "Asset", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetUpstreams() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertAssetRequestValidationError{ + field: fmt.Sprintf("Upstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertAssetRequestValidationError{ + field: fmt.Sprintf("Upstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertAssetRequestValidationError{ + field: fmt.Sprintf("Upstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetDownstreams() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertAssetRequestValidationError{ + field: fmt.Sprintf("Downstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertAssetRequestValidationError{ + field: fmt.Sprintf("Downstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertAssetRequestValidationError{ + field: fmt.Sprintf("Downstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return UpsertAssetRequestMultiError(errors) + } + + return nil +} + +// UpsertAssetRequestMultiError is an error wrapping multiple validation errors +// returned by UpsertAssetRequest.ValidateAll() if the designated constraints +// aren't met. +type UpsertAssetRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpsertAssetRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpsertAssetRequestMultiError) AllErrors() []error { return m } + +// UpsertAssetRequestValidationError is the validation error returned by +// UpsertAssetRequest.Validate if the designated constraints aren't met. +type UpsertAssetRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpsertAssetRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpsertAssetRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpsertAssetRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpsertAssetRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpsertAssetRequestValidationError) ErrorName() string { + return "UpsertAssetRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpsertAssetRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpsertAssetRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpsertAssetRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpsertAssetRequestValidationError{} + +// Validate checks the field values on UpsertAssetResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpsertAssetResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpsertAssetResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpsertAssetResponseMultiError, or nil if none found. +func (m *UpsertAssetResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UpsertAssetResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return UpsertAssetResponseMultiError(errors) + } + + return nil +} + +// UpsertAssetResponseMultiError is an error wrapping multiple validation +// errors returned by UpsertAssetResponse.ValidateAll() if the designated +// constraints aren't met. +type UpsertAssetResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpsertAssetResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpsertAssetResponseMultiError) AllErrors() []error { return m } + +// UpsertAssetResponseValidationError is the validation error returned by +// UpsertAssetResponse.Validate if the designated constraints aren't met. +type UpsertAssetResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpsertAssetResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpsertAssetResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpsertAssetResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpsertAssetResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpsertAssetResponseValidationError) ErrorName() string { + return "UpsertAssetResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpsertAssetResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpsertAssetResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpsertAssetResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpsertAssetResponseValidationError{} + +// Validate checks the field values on UpsertPatchAssetRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpsertPatchAssetRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpsertPatchAssetRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpsertPatchAssetRequestMultiError, or nil if none found. +func (m *UpsertPatchAssetRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpsertPatchAssetRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetAsset()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertPatchAssetRequestValidationError{ + field: "Asset", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertPatchAssetRequestValidationError{ + field: "Asset", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAsset()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertPatchAssetRequestValidationError{ + field: "Asset", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetUpstreams() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertPatchAssetRequestValidationError{ + field: fmt.Sprintf("Upstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertPatchAssetRequestValidationError{ + field: fmt.Sprintf("Upstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertPatchAssetRequestValidationError{ + field: fmt.Sprintf("Upstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + for idx, item := range m.GetDownstreams() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpsertPatchAssetRequestValidationError{ + field: fmt.Sprintf("Downstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpsertPatchAssetRequestValidationError{ + field: fmt.Sprintf("Downstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpsertPatchAssetRequestValidationError{ + field: fmt.Sprintf("Downstreams[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return UpsertPatchAssetRequestMultiError(errors) + } + + return nil +} + +// UpsertPatchAssetRequestMultiError is an error wrapping multiple validation +// errors returned by UpsertPatchAssetRequest.ValidateAll() if the designated +// constraints aren't met. +type UpsertPatchAssetRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpsertPatchAssetRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpsertPatchAssetRequestMultiError) AllErrors() []error { return m } + +// UpsertPatchAssetRequestValidationError is the validation error returned by +// UpsertPatchAssetRequest.Validate if the designated constraints aren't met. +type UpsertPatchAssetRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpsertPatchAssetRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpsertPatchAssetRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpsertPatchAssetRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpsertPatchAssetRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpsertPatchAssetRequestValidationError) ErrorName() string { + return "UpsertPatchAssetRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpsertPatchAssetRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpsertPatchAssetRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpsertPatchAssetRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpsertPatchAssetRequestValidationError{} + +// Validate checks the field values on UpsertPatchAssetResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpsertPatchAssetResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpsertPatchAssetResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpsertPatchAssetResponseMultiError, or nil if none found. +func (m *UpsertPatchAssetResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UpsertPatchAssetResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return UpsertPatchAssetResponseMultiError(errors) + } + + return nil +} + +// UpsertPatchAssetResponseMultiError is an error wrapping multiple validation +// errors returned by UpsertPatchAssetResponse.ValidateAll() if the designated +// constraints aren't met. +type UpsertPatchAssetResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpsertPatchAssetResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpsertPatchAssetResponseMultiError) AllErrors() []error { return m } + +// UpsertPatchAssetResponseValidationError is the validation error returned by +// UpsertPatchAssetResponse.Validate if the designated constraints aren't met. +type UpsertPatchAssetResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpsertPatchAssetResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpsertPatchAssetResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpsertPatchAssetResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpsertPatchAssetResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpsertPatchAssetResponseValidationError) ErrorName() string { + return "UpsertPatchAssetResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpsertPatchAssetResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpsertPatchAssetResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpsertPatchAssetResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpsertPatchAssetResponseValidationError{} + +// Validate checks the field values on DeleteAssetRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteAssetRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteAssetRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteAssetRequestMultiError, or nil if none found. +func (m *DeleteAssetRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteAssetRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return DeleteAssetRequestMultiError(errors) + } + + return nil +} + +// DeleteAssetRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteAssetRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteAssetRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteAssetRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteAssetRequestMultiError) AllErrors() []error { return m } + +// DeleteAssetRequestValidationError is the validation error returned by +// DeleteAssetRequest.Validate if the designated constraints aren't met. +type DeleteAssetRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteAssetRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteAssetRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteAssetRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteAssetRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteAssetRequestValidationError) ErrorName() string { + return "DeleteAssetRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteAssetRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteAssetRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteAssetRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteAssetRequestValidationError{} + +// Validate checks the field values on DeleteAssetResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteAssetResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteAssetResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteAssetResponseMultiError, or nil if none found. +func (m *DeleteAssetResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteAssetResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return DeleteAssetResponseMultiError(errors) + } + + return nil +} + +// DeleteAssetResponseMultiError is an error wrapping multiple validation +// errors returned by DeleteAssetResponse.ValidateAll() if the designated +// constraints aren't met. +type DeleteAssetResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteAssetResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteAssetResponseMultiError) AllErrors() []error { return m } + +// DeleteAssetResponseValidationError is the validation error returned by +// DeleteAssetResponse.Validate if the designated constraints aren't met. +type DeleteAssetResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteAssetResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteAssetResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteAssetResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteAssetResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteAssetResponseValidationError) ErrorName() string { + return "DeleteAssetResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteAssetResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteAssetResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteAssetResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteAssetResponseValidationError{} + +// Validate checks the field values on GetAssetStargazersRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetStargazersRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetStargazersRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAssetStargazersRequestMultiError, or nil if none found. +func (m *GetAssetStargazersRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetStargazersRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.GetSize() != 0 { + + if m.GetSize() < 0 { + err := GetAssetStargazersRequestValidationError{ + field: "Size", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if m.GetOffset() != 0 { + + if m.GetOffset() < 0 { + err := GetAssetStargazersRequestValidationError{ + field: "Offset", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if len(errors) > 0 { + return GetAssetStargazersRequestMultiError(errors) + } + + return nil +} + +// GetAssetStargazersRequestMultiError is an error wrapping multiple validation +// errors returned by GetAssetStargazersRequest.ValidateAll() if the +// designated constraints aren't met. +type GetAssetStargazersRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetStargazersRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetStargazersRequestMultiError) AllErrors() []error { return m } + +// GetAssetStargazersRequestValidationError is the validation error returned by +// GetAssetStargazersRequest.Validate if the designated constraints aren't met. +type GetAssetStargazersRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetStargazersRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetStargazersRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetStargazersRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetStargazersRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetStargazersRequestValidationError) ErrorName() string { + return "GetAssetStargazersRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetStargazersRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetStargazersRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetStargazersRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetStargazersRequestValidationError{} + +// Validate checks the field values on GetAssetStargazersResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetStargazersResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetStargazersResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAssetStargazersResponseMultiError, or nil if none found. +func (m *GetAssetStargazersResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetStargazersResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetData() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAssetStargazersResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAssetStargazersResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAssetStargazersResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GetAssetStargazersResponseMultiError(errors) + } + + return nil +} + +// GetAssetStargazersResponseMultiError is an error wrapping multiple +// validation errors returned by GetAssetStargazersResponse.ValidateAll() if +// the designated constraints aren't met. +type GetAssetStargazersResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetStargazersResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetStargazersResponseMultiError) AllErrors() []error { return m } + +// GetAssetStargazersResponseValidationError is the validation error returned +// by GetAssetStargazersResponse.Validate if the designated constraints aren't met. +type GetAssetStargazersResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetStargazersResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetStargazersResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetStargazersResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetStargazersResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetStargazersResponseValidationError) ErrorName() string { + return "GetAssetStargazersResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetStargazersResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetStargazersResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetStargazersResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetStargazersResponseValidationError{} + +// Validate checks the field values on GetAssetVersionHistoryRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetVersionHistoryRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetVersionHistoryRequest with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// GetAssetVersionHistoryRequestMultiError, or nil if none found. +func (m *GetAssetVersionHistoryRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetVersionHistoryRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if m.GetSize() != 0 { + + if m.GetSize() < 0 { + err := GetAssetVersionHistoryRequestValidationError{ + field: "Size", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if m.GetOffset() != 0 { + + if m.GetOffset() < 0 { + err := GetAssetVersionHistoryRequestValidationError{ + field: "Offset", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if len(errors) > 0 { + return GetAssetVersionHistoryRequestMultiError(errors) + } + + return nil +} + +// GetAssetVersionHistoryRequestMultiError is an error wrapping multiple +// validation errors returned by GetAssetVersionHistoryRequest.ValidateAll() +// if the designated constraints aren't met. +type GetAssetVersionHistoryRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetVersionHistoryRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetVersionHistoryRequestMultiError) AllErrors() []error { return m } + +// GetAssetVersionHistoryRequestValidationError is the validation error +// returned by GetAssetVersionHistoryRequest.Validate if the designated +// constraints aren't met. +type GetAssetVersionHistoryRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetVersionHistoryRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetVersionHistoryRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetVersionHistoryRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetVersionHistoryRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetVersionHistoryRequestValidationError) ErrorName() string { + return "GetAssetVersionHistoryRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetVersionHistoryRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetVersionHistoryRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetVersionHistoryRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetVersionHistoryRequestValidationError{} + +// Validate checks the field values on GetAssetVersionHistoryResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetVersionHistoryResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetVersionHistoryResponse with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// GetAssetVersionHistoryResponseMultiError, or nil if none found. +func (m *GetAssetVersionHistoryResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetVersionHistoryResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetData() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAssetVersionHistoryResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAssetVersionHistoryResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAssetVersionHistoryResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GetAssetVersionHistoryResponseMultiError(errors) + } + + return nil +} + +// GetAssetVersionHistoryResponseMultiError is an error wrapping multiple +// validation errors returned by GetAssetVersionHistoryResponse.ValidateAll() +// if the designated constraints aren't met. +type GetAssetVersionHistoryResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetVersionHistoryResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetVersionHistoryResponseMultiError) AllErrors() []error { return m } + +// GetAssetVersionHistoryResponseValidationError is the validation error +// returned by GetAssetVersionHistoryResponse.Validate if the designated +// constraints aren't met. +type GetAssetVersionHistoryResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetVersionHistoryResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetVersionHistoryResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetVersionHistoryResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetVersionHistoryResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetVersionHistoryResponseValidationError) ErrorName() string { + return "GetAssetVersionHistoryResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetVersionHistoryResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetVersionHistoryResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetVersionHistoryResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetVersionHistoryResponseValidationError{} + +// Validate checks the field values on GetAssetByVersionRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetByVersionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetByVersionRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAssetByVersionRequestMultiError, or nil if none found. +func (m *GetAssetByVersionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetByVersionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for Version + + if len(errors) > 0 { + return GetAssetByVersionRequestMultiError(errors) + } + + return nil +} + +// GetAssetByVersionRequestMultiError is an error wrapping multiple validation +// errors returned by GetAssetByVersionRequest.ValidateAll() if the designated +// constraints aren't met. +type GetAssetByVersionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetByVersionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetByVersionRequestMultiError) AllErrors() []error { return m } + +// GetAssetByVersionRequestValidationError is the validation error returned by +// GetAssetByVersionRequest.Validate if the designated constraints aren't met. +type GetAssetByVersionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetByVersionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetByVersionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetByVersionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetByVersionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetByVersionRequestValidationError) ErrorName() string { + return "GetAssetByVersionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetByVersionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetByVersionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetByVersionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetByVersionRequestValidationError{} + +// Validate checks the field values on GetAssetByVersionResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAssetByVersionResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAssetByVersionResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAssetByVersionResponseMultiError, or nil if none found. +func (m *GetAssetByVersionResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAssetByVersionResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetData()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAssetByVersionResponseValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAssetByVersionResponseValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAssetByVersionResponseValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetAssetByVersionResponseMultiError(errors) + } + + return nil +} + +// GetAssetByVersionResponseMultiError is an error wrapping multiple validation +// errors returned by GetAssetByVersionResponse.ValidateAll() if the +// designated constraints aren't met. +type GetAssetByVersionResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAssetByVersionResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAssetByVersionResponseMultiError) AllErrors() []error { return m } + +// GetAssetByVersionResponseValidationError is the validation error returned by +// GetAssetByVersionResponse.Validate if the designated constraints aren't met. +type GetAssetByVersionResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAssetByVersionResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAssetByVersionResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAssetByVersionResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAssetByVersionResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAssetByVersionResponseValidationError) ErrorName() string { + return "GetAssetByVersionResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAssetByVersionResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAssetByVersionResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAssetByVersionResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAssetByVersionResponseValidationError{} + +// Validate checks the field values on User with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *User) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on User with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in UserMultiError, or nil if none found. +func (m *User) ValidateAll() error { + return m.validate(true) +} + +func (m *User) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for Uuid + + // no validation rules for Email + + // no validation rules for Provider + + if all { + switch v := interface{}(m.GetCreatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UserValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UserValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UserValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetUpdatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UserValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UserValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UserValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UserMultiError(errors) + } + + return nil +} + +// UserMultiError is an error wrapping multiple validation errors returned by +// User.ValidateAll() if the designated constraints aren't met. +type UserMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UserMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UserMultiError) AllErrors() []error { return m } + +// UserValidationError is the validation error returned by User.Validate if the +// designated constraints aren't met. +type UserValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UserValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UserValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UserValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UserValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UserValidationError) ErrorName() string { return "UserValidationError" } + +// Error satisfies the builtin error interface +func (e UserValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUser.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UserValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UserValidationError{} + +// Validate checks the field values on Changelog with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Changelog) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Changelog with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ChangelogMultiError, or nil +// if none found. +func (m *Changelog) ValidateAll() error { + return m.validate(true) +} + +func (m *Changelog) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetChanges() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ChangelogValidationError{ + field: fmt.Sprintf("Changes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ChangelogValidationError{ + field: fmt.Sprintf("Changes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ChangelogValidationError{ + field: fmt.Sprintf("Changes[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ChangelogMultiError(errors) + } + + return nil +} + +// ChangelogMultiError is an error wrapping multiple validation errors returned +// by Changelog.ValidateAll() if the designated constraints aren't met. +type ChangelogMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ChangelogMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ChangelogMultiError) AllErrors() []error { return m } + +// ChangelogValidationError is the validation error returned by +// Changelog.Validate if the designated constraints aren't met. +type ChangelogValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ChangelogValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ChangelogValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ChangelogValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ChangelogValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ChangelogValidationError) ErrorName() string { return "ChangelogValidationError" } + +// Error satisfies the builtin error interface +func (e ChangelogValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sChangelog.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ChangelogValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ChangelogValidationError{} + +// Validate checks the field values on Change with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Change) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Change with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ChangeMultiError, or nil if none found. +func (m *Change) ValidateAll() error { + return m.validate(true) +} + +func (m *Change) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Type + + if all { + switch v := interface{}(m.GetFrom()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ChangeValidationError{ + field: "From", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ChangeValidationError{ + field: "From", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetFrom()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ChangeValidationError{ + field: "From", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetTo()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ChangeValidationError{ + field: "To", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ChangeValidationError{ + field: "To", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ChangeValidationError{ + field: "To", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return ChangeMultiError(errors) + } + + return nil +} + +// ChangeMultiError is an error wrapping multiple validation errors returned by +// Change.ValidateAll() if the designated constraints aren't met. +type ChangeMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ChangeMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ChangeMultiError) AllErrors() []error { return m } + +// ChangeValidationError is the validation error returned by Change.Validate if +// the designated constraints aren't met. +type ChangeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ChangeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ChangeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ChangeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ChangeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ChangeValidationError) ErrorName() string { return "ChangeValidationError" } + +// Error satisfies the builtin error interface +func (e ChangeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sChange.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ChangeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ChangeValidationError{} + +// Validate checks the field values on Asset with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Asset) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Asset with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in AssetMultiError, or nil if none found. +func (m *Asset) ValidateAll() error { + return m.validate(true) +} + +func (m *Asset) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for Urn + + // no validation rules for Type + + // no validation rules for Service + + // no validation rules for Name + + // no validation rules for Description + + if all { + switch v := interface{}(m.GetData()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: "Data", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetLabels()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: "Labels", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: "Labels", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLabels()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: "Labels", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetOwners() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: fmt.Sprintf("Owners[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: fmt.Sprintf("Owners[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: fmt.Sprintf("Owners[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for Version + + if all { + switch v := interface{}(m.GetUpdatedBy()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: "UpdatedBy", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: "UpdatedBy", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdatedBy()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: "UpdatedBy", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetChangelog()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: "Changelog", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: "Changelog", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetChangelog()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: "Changelog", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCreatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetUpdatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AssetValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AssetValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AssetValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return AssetMultiError(errors) + } + + return nil +} + +// AssetMultiError is an error wrapping multiple validation errors returned by +// Asset.ValidateAll() if the designated constraints aren't met. +type AssetMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AssetMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AssetMultiError) AllErrors() []error { return m } + +// AssetValidationError is the validation error returned by Asset.Validate if +// the designated constraints aren't met. +type AssetValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AssetValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AssetValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AssetValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AssetValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AssetValidationError) ErrorName() string { return "AssetValidationError" } + +// Error satisfies the builtin error interface +func (e AssetValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAsset.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AssetValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AssetValidationError{} + +// Validate checks the field values on Discussion with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Discussion) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Discussion with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in DiscussionMultiError, or +// nil if none found. +func (m *Discussion) ValidateAll() error { + return m.validate(true) +} + +func (m *Discussion) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for Title + + // no validation rules for Body + + // no validation rules for Type + + // no validation rules for State + + if all { + switch v := interface{}(m.GetOwner()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DiscussionValidationError{ + field: "Owner", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DiscussionValidationError{ + field: "Owner", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOwner()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DiscussionValidationError{ + field: "Owner", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCreatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DiscussionValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DiscussionValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DiscussionValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, } } } if all { - switch v := interface{}(m.GetLabels()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DiscussionValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DiscussionValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DiscussionValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return DiscussionMultiError(errors) + } + + return nil +} + +// DiscussionMultiError is an error wrapping multiple validation errors +// returned by Discussion.ValidateAll() if the designated constraints aren't met. +type DiscussionMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DiscussionMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DiscussionMultiError) AllErrors() []error { return m } + +// DiscussionValidationError is the validation error returned by +// Discussion.Validate if the designated constraints aren't met. +type DiscussionValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DiscussionValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DiscussionValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DiscussionValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DiscussionValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DiscussionValidationError) ErrorName() string { return "DiscussionValidationError" } + +// Error satisfies the builtin error interface +func (e DiscussionValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDiscussion.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DiscussionValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DiscussionValidationError{} + +// Validate checks the field values on Comment with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Comment) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Comment with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in CommentMultiError, or nil if none found. +func (m *Comment) ValidateAll() error { + return m.validate(true) +} + +func (m *Comment) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for DiscussionId + + // no validation rules for Body + + if all { + switch v := interface{}(m.GetOwner()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ - field: "Labels", + errors = append(errors, CommentValidationError{ + field: "Owner", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ - field: "Labels", + errors = append(errors, CommentValidationError{ + field: "Owner", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetLabels()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetOwner()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AssetValidationError{ - field: "Labels", + return CommentValidationError{ + field: "Owner", reason: "embedded message failed validation", cause: err, } } } - for idx, item := range m.GetOwners() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ - field: fmt.Sprintf("Owners[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ - field: fmt.Sprintf("Owners[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AssetValidationError{ - field: fmt.Sprintf("Owners[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - // no validation rules for Version - if all { switch v := interface{}(m.GetUpdatedBy()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ + errors = append(errors, CommentValidationError{ field: "UpdatedBy", reason: "embedded message failed validation", cause: err, @@ -2817,7 +6389,7 @@ func (m *Asset) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ + errors = append(errors, CommentValidationError{ field: "UpdatedBy", reason: "embedded message failed validation", cause: err, @@ -2826,7 +6398,7 @@ func (m *Asset) validate(all bool) error { } } else if v, ok := interface{}(m.GetUpdatedBy()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AssetValidationError{ + return CommentValidationError{ field: "UpdatedBy", reason: "embedded message failed validation", cause: err, @@ -2835,28 +6407,28 @@ func (m *Asset) validate(all bool) error { } if all { - switch v := interface{}(m.GetChangelog()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ - field: "Changelog", + errors = append(errors, CommentValidationError{ + field: "CreatedAt", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ - field: "Changelog", + errors = append(errors, CommentValidationError{ + field: "CreatedAt", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetChangelog()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AssetValidationError{ - field: "Changelog", + return CommentValidationError{ + field: "CreatedAt", reason: "embedded message failed validation", cause: err, } @@ -2864,57 +6436,160 @@ func (m *Asset) validate(all bool) error { } if all { - switch v := interface{}(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ - field: "CreatedAt", + errors = append(errors, CommentValidationError{ + field: "UpdatedAt", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ - field: "CreatedAt", + errors = append(errors, CommentValidationError{ + field: "UpdatedAt", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AssetValidationError{ - field: "CreatedAt", + return CommentValidationError{ + field: "UpdatedAt", reason: "embedded message failed validation", cause: err, } } } + if len(errors) > 0 { + return CommentMultiError(errors) + } + + return nil +} + +// CommentMultiError is an error wrapping multiple validation errors returned +// by Comment.ValidateAll() if the designated constraints aren't met. +type CommentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CommentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CommentMultiError) AllErrors() []error { return m } + +// CommentValidationError is the validation error returned by Comment.Validate +// if the designated constraints aren't met. +type CommentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CommentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CommentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CommentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CommentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CommentValidationError) ErrorName() string { return "CommentValidationError" } + +// Error satisfies the builtin error interface +func (e CommentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sComment.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CommentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CommentValidationError{} + +// Validate checks the field values on LineageEdge with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *LineageEdge) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LineageEdge with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in LineageEdgeMultiError, or +// nil if none found. +func (m *LineageEdge) ValidateAll() error { + return m.validate(true) +} + +func (m *LineageEdge) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Source + + // no validation rules for Target + if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetProp()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, AssetValidationError{ - field: "UpdatedAt", + errors = append(errors, LineageEdgeValidationError{ + field: "Prop", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, AssetValidationError{ - field: "UpdatedAt", + errors = append(errors, LineageEdgeValidationError{ + field: "Prop", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetProp()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return AssetValidationError{ - field: "UpdatedAt", + return LineageEdgeValidationError{ + field: "Prop", reason: "embedded message failed validation", cause: err, } @@ -2922,18 +6597,123 @@ func (m *Asset) validate(all bool) error { } if len(errors) > 0 { - return AssetMultiError(errors) + return LineageEdgeMultiError(errors) + } + + return nil +} + +// LineageEdgeMultiError is an error wrapping multiple validation errors +// returned by LineageEdge.ValidateAll() if the designated constraints aren't met. +type LineageEdgeMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LineageEdgeMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LineageEdgeMultiError) AllErrors() []error { return m } + +// LineageEdgeValidationError is the validation error returned by +// LineageEdge.Validate if the designated constraints aren't met. +type LineageEdgeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LineageEdgeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LineageEdgeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LineageEdgeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LineageEdgeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LineageEdgeValidationError) ErrorName() string { return "LineageEdgeValidationError" } + +// Error satisfies the builtin error interface +func (e LineageEdgeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLineageEdge.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LineageEdgeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LineageEdgeValidationError{} + +// Validate checks the field values on LineageNode with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *LineageNode) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on LineageNode with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in LineageNodeMultiError, or +// nil if none found. +func (m *LineageNode) ValidateAll() error { + return m.validate(true) +} + +func (m *LineageNode) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Urn + + // no validation rules for Type + + // no validation rules for Service + + if len(errors) > 0 { + return LineageNodeMultiError(errors) } return nil } -// AssetMultiError is an error wrapping multiple validation errors returned by -// Asset.ValidateAll() if the designated constraints aren't met. -type AssetMultiError []error +// LineageNodeMultiError is an error wrapping multiple validation errors +// returned by LineageNode.ValidateAll() if the designated constraints aren't met. +type LineageNodeMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m AssetMultiError) Error() string { +func (m LineageNodeMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -2942,11 +6722,11 @@ func (m AssetMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m AssetMultiError) AllErrors() []error { return m } +func (m LineageNodeMultiError) AllErrors() []error { return m } -// AssetValidationError is the validation error returned by Asset.Validate if -// the designated constraints aren't met. -type AssetValidationError struct { +// LineageNodeValidationError is the validation error returned by +// LineageNode.Validate if the designated constraints aren't met. +type LineageNodeValidationError struct { field string reason string cause error @@ -2954,22 +6734,22 @@ type AssetValidationError struct { } // Field function returns field value. -func (e AssetValidationError) Field() string { return e.field } +func (e LineageNodeValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e AssetValidationError) Reason() string { return e.reason } +func (e LineageNodeValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e AssetValidationError) Cause() error { return e.cause } +func (e LineageNodeValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e AssetValidationError) Key() bool { return e.key } +func (e LineageNodeValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e AssetValidationError) ErrorName() string { return "AssetValidationError" } +func (e LineageNodeValidationError) ErrorName() string { return "LineageNodeValidationError" } // Error satisfies the builtin error interface -func (e AssetValidationError) Error() string { +func (e LineageNodeValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2981,14 +6761,14 @@ func (e AssetValidationError) Error() string { } return fmt.Sprintf( - "invalid %sAsset.%s: %s%s", + "invalid %sLineageNode.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = AssetValidationError{} +var _ error = LineageNodeValidationError{} var _ interface { Field() string @@ -2996,92 +6776,65 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = AssetValidationError{} +} = LineageNodeValidationError{} -// Validate checks the field values on Discussion with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Discussion) Validate() error { +// Validate checks the field values on UpsertAssetRequest_BaseAsset with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpsertAssetRequest_BaseAsset) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Discussion with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in DiscussionMultiError, or -// nil if none found. -func (m *Discussion) ValidateAll() error { +// ValidateAll checks the field values on UpsertAssetRequest_BaseAsset with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpsertAssetRequest_BaseAssetMultiError, or nil if none found. +func (m *UpsertAssetRequest_BaseAsset) ValidateAll() error { return m.validate(true) } -func (m *Discussion) validate(all bool) error { +func (m *UpsertAssetRequest_BaseAsset) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Id + // no validation rules for Urn - // no validation rules for Title + // no validation rules for Type - // no validation rules for Body + // no validation rules for Name - // no validation rules for Type + // no validation rules for Service - // no validation rules for State + if m.GetDescription() != "" { - if all { - switch v := interface{}(m.GetOwner()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, DiscussionValidationError{ - field: "Owner", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, DiscussionValidationError{ - field: "Owner", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetOwner()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return DiscussionValidationError{ - field: "Owner", - reason: "embedded message failed validation", - cause: err, - } - } } if all { - switch v := interface{}(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetData()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, DiscussionValidationError{ - field: "CreatedAt", + errors = append(errors, UpsertAssetRequest_BaseAssetValidationError{ + field: "Data", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, DiscussionValidationError{ - field: "CreatedAt", + errors = append(errors, UpsertAssetRequest_BaseAssetValidationError{ + field: "Data", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return DiscussionValidationError{ - field: "CreatedAt", + return UpsertAssetRequest_BaseAssetValidationError{ + field: "Data", reason: "embedded message failed validation", cause: err, } @@ -3089,28 +6842,28 @@ func (m *Discussion) validate(all bool) error { } if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetLabels()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, DiscussionValidationError{ - field: "UpdatedAt", + errors = append(errors, UpsertAssetRequest_BaseAssetValidationError{ + field: "Labels", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, DiscussionValidationError{ - field: "UpdatedAt", + errors = append(errors, UpsertAssetRequest_BaseAssetValidationError{ + field: "Labels", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetLabels()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return DiscussionValidationError{ - field: "UpdatedAt", + return UpsertAssetRequest_BaseAssetValidationError{ + field: "Labels", reason: "embedded message failed validation", cause: err, } @@ -3118,18 +6871,19 @@ func (m *Discussion) validate(all bool) error { } if len(errors) > 0 { - return DiscussionMultiError(errors) + return UpsertAssetRequest_BaseAssetMultiError(errors) } return nil } -// DiscussionMultiError is an error wrapping multiple validation errors -// returned by Discussion.ValidateAll() if the designated constraints aren't met. -type DiscussionMultiError []error +// UpsertAssetRequest_BaseAssetMultiError is an error wrapping multiple +// validation errors returned by UpsertAssetRequest_BaseAsset.ValidateAll() if +// the designated constraints aren't met. +type UpsertAssetRequest_BaseAssetMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m DiscussionMultiError) Error() string { +func (m UpsertAssetRequest_BaseAssetMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -3138,11 +6892,12 @@ func (m DiscussionMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m DiscussionMultiError) AllErrors() []error { return m } +func (m UpsertAssetRequest_BaseAssetMultiError) AllErrors() []error { return m } -// DiscussionValidationError is the validation error returned by -// Discussion.Validate if the designated constraints aren't met. -type DiscussionValidationError struct { +// UpsertAssetRequest_BaseAssetValidationError is the validation error returned +// by UpsertAssetRequest_BaseAsset.Validate if the designated constraints +// aren't met. +type UpsertAssetRequest_BaseAssetValidationError struct { field string reason string cause error @@ -3150,22 +6905,24 @@ type DiscussionValidationError struct { } // Field function returns field value. -func (e DiscussionValidationError) Field() string { return e.field } +func (e UpsertAssetRequest_BaseAssetValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e DiscussionValidationError) Reason() string { return e.reason } +func (e UpsertAssetRequest_BaseAssetValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e DiscussionValidationError) Cause() error { return e.cause } +func (e UpsertAssetRequest_BaseAssetValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e DiscussionValidationError) Key() bool { return e.key } +func (e UpsertAssetRequest_BaseAssetValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e DiscussionValidationError) ErrorName() string { return "DiscussionValidationError" } +func (e UpsertAssetRequest_BaseAssetValidationError) ErrorName() string { + return "UpsertAssetRequest_BaseAssetValidationError" +} // Error satisfies the builtin error interface -func (e DiscussionValidationError) Error() string { +func (e UpsertAssetRequest_BaseAssetValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3177,14 +6934,14 @@ func (e DiscussionValidationError) Error() string { } return fmt.Sprintf( - "invalid %sDiscussion.%s: %s%s", + "invalid %sUpsertAssetRequest_BaseAsset.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = DiscussionValidationError{} +var _ error = UpsertAssetRequest_BaseAssetValidationError{} var _ interface { Field() string @@ -3192,116 +6949,76 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = DiscussionValidationError{} +} = UpsertAssetRequest_BaseAssetValidationError{} -// Validate checks the field values on Comment with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Comment) Validate() error { +// Validate checks the field values on UpsertPatchAssetRequest_BaseAsset with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *UpsertPatchAssetRequest_BaseAsset) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Comment with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in CommentMultiError, or nil if none found. -func (m *Comment) ValidateAll() error { +// ValidateAll checks the field values on UpsertPatchAssetRequest_BaseAsset +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// UpsertPatchAssetRequest_BaseAssetMultiError, or nil if none found. +func (m *UpsertPatchAssetRequest_BaseAsset) ValidateAll() error { return m.validate(true) } -func (m *Comment) validate(all bool) error { +func (m *UpsertPatchAssetRequest_BaseAsset) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Id + // no validation rules for Urn - // no validation rules for DiscussionId + // no validation rules for Type - // no validation rules for Body + if wrapper := m.GetName(); wrapper != nil { + + if wrapper.GetValue() != "" { - if all { - switch v := interface{}(m.GetOwner()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CommentValidationError{ - field: "Owner", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CommentValidationError{ - field: "Owner", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetOwner()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CommentValidationError{ - field: "Owner", - reason: "embedded message failed validation", - cause: err, - } } + } - if all { - switch v := interface{}(m.GetUpdatedBy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CommentValidationError{ - field: "UpdatedBy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CommentValidationError{ - field: "UpdatedBy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetUpdatedBy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CommentValidationError{ - field: "UpdatedBy", - reason: "embedded message failed validation", - cause: err, - } + // no validation rules for Service + + if wrapper := m.GetDescription(); wrapper != nil { + + if wrapper.GetValue() != "" { + } + } if all { - switch v := interface{}(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetData()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CommentValidationError{ - field: "CreatedAt", + errors = append(errors, UpsertPatchAssetRequest_BaseAssetValidationError{ + field: "Data", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CommentValidationError{ - field: "CreatedAt", + errors = append(errors, UpsertPatchAssetRequest_BaseAssetValidationError{ + field: "Data", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CommentValidationError{ - field: "CreatedAt", + return UpsertPatchAssetRequest_BaseAssetValidationError{ + field: "Data", reason: "embedded message failed validation", cause: err, } @@ -3309,28 +7026,28 @@ func (m *Comment) validate(all bool) error { } if all { - switch v := interface{}(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetLabels()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, CommentValidationError{ - field: "UpdatedAt", + errors = append(errors, UpsertPatchAssetRequest_BaseAssetValidationError{ + field: "Labels", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, CommentValidationError{ - field: "UpdatedAt", + errors = append(errors, UpsertPatchAssetRequest_BaseAssetValidationError{ + field: "Labels", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetLabels()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return CommentValidationError{ - field: "UpdatedAt", + return UpsertPatchAssetRequest_BaseAssetValidationError{ + field: "Labels", reason: "embedded message failed validation", cause: err, } @@ -3338,18 +7055,20 @@ func (m *Comment) validate(all bool) error { } if len(errors) > 0 { - return CommentMultiError(errors) + return UpsertPatchAssetRequest_BaseAssetMultiError(errors) } return nil } -// CommentMultiError is an error wrapping multiple validation errors returned -// by Comment.ValidateAll() if the designated constraints aren't met. -type CommentMultiError []error +// UpsertPatchAssetRequest_BaseAssetMultiError is an error wrapping multiple +// validation errors returned by +// UpsertPatchAssetRequest_BaseAsset.ValidateAll() if the designated +// constraints aren't met. +type UpsertPatchAssetRequest_BaseAssetMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m CommentMultiError) Error() string { +func (m UpsertPatchAssetRequest_BaseAssetMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -3358,11 +7077,12 @@ func (m CommentMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m CommentMultiError) AllErrors() []error { return m } +func (m UpsertPatchAssetRequest_BaseAssetMultiError) AllErrors() []error { return m } -// CommentValidationError is the validation error returned by Comment.Validate -// if the designated constraints aren't met. -type CommentValidationError struct { +// UpsertPatchAssetRequest_BaseAssetValidationError is the validation error +// returned by UpsertPatchAssetRequest_BaseAsset.Validate if the designated +// constraints aren't met. +type UpsertPatchAssetRequest_BaseAssetValidationError struct { field string reason string cause error @@ -3370,22 +7090,24 @@ type CommentValidationError struct { } // Field function returns field value. -func (e CommentValidationError) Field() string { return e.field } +func (e UpsertPatchAssetRequest_BaseAssetValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e CommentValidationError) Reason() string { return e.reason } +func (e UpsertPatchAssetRequest_BaseAssetValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e CommentValidationError) Cause() error { return e.cause } +func (e UpsertPatchAssetRequest_BaseAssetValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e CommentValidationError) Key() bool { return e.key } +func (e UpsertPatchAssetRequest_BaseAssetValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e CommentValidationError) ErrorName() string { return "CommentValidationError" } +func (e UpsertPatchAssetRequest_BaseAssetValidationError) ErrorName() string { + return "UpsertPatchAssetRequest_BaseAssetValidationError" +} // Error satisfies the builtin error interface -func (e CommentValidationError) Error() string { +func (e UpsertPatchAssetRequest_BaseAssetValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3397,14 +7119,14 @@ func (e CommentValidationError) Error() string { } return fmt.Sprintf( - "invalid %sComment.%s: %s%s", + "invalid %sUpsertPatchAssetRequest_BaseAsset.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = CommentValidationError{} +var _ error = UpsertPatchAssetRequest_BaseAssetValidationError{} var _ interface { Field() string @@ -3412,4 +7134,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = CommentValidationError{} +} = UpsertPatchAssetRequest_BaseAssetValidationError{} diff --git a/api/proto/odpf/compass/v1beta1/service_grpc.pb.go b/api/proto/odpf/compass/v1beta1/service_grpc.pb.go index 006e1941..39e3e0e0 100644 --- a/api/proto/odpf/compass/v1beta1/service_grpc.pb.go +++ b/api/proto/odpf/compass/v1beta1/service_grpc.pb.go @@ -11,7 +11,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file @@ -27,12 +26,23 @@ type CompassServiceClient interface { GetAllDiscussions(ctx context.Context, in *GetAllDiscussionsRequest, opts ...grpc.CallOption) (*GetAllDiscussionsResponse, error) CreateDiscussion(ctx context.Context, in *CreateDiscussionRequest, opts ...grpc.CallOption) (*CreateDiscussionResponse, error) GetDiscussion(ctx context.Context, in *GetDiscussionRequest, opts ...grpc.CallOption) (*GetDiscussionResponse, error) - PatchDiscussion(ctx context.Context, in *PatchDiscussionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + PatchDiscussion(ctx context.Context, in *PatchDiscussionRequest, opts ...grpc.CallOption) (*PatchDiscussionResponse, error) CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error) GetAllComments(ctx context.Context, in *GetAllCommentsRequest, opts ...grpc.CallOption) (*GetAllCommentsResponse, error) GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*GetCommentResponse, error) - UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error) + DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error) + SearchAssets(ctx context.Context, in *SearchAssetsRequest, opts ...grpc.CallOption) (*SearchAssetsResponse, error) + SuggestAssets(ctx context.Context, in *SuggestAssetsRequest, opts ...grpc.CallOption) (*SuggestAssetsResponse, error) + GetGraph(ctx context.Context, in *GetGraphRequest, opts ...grpc.CallOption) (*GetGraphResponse, error) + GetAllAssets(ctx context.Context, in *GetAllAssetsRequest, opts ...grpc.CallOption) (*GetAllAssetsResponse, error) + GetAssetByID(ctx context.Context, in *GetAssetByIDRequest, opts ...grpc.CallOption) (*GetAssetByIDResponse, error) + UpsertAsset(ctx context.Context, in *UpsertAssetRequest, opts ...grpc.CallOption) (*UpsertAssetResponse, error) + UpsertPatchAsset(ctx context.Context, in *UpsertPatchAssetRequest, opts ...grpc.CallOption) (*UpsertPatchAssetResponse, error) + DeleteAsset(ctx context.Context, in *DeleteAssetRequest, opts ...grpc.CallOption) (*DeleteAssetResponse, error) + GetAssetStargazers(ctx context.Context, in *GetAssetStargazersRequest, opts ...grpc.CallOption) (*GetAssetStargazersResponse, error) + GetAssetVersionHistory(ctx context.Context, in *GetAssetVersionHistoryRequest, opts ...grpc.CallOption) (*GetAssetVersionHistoryResponse, error) + GetAssetByVersion(ctx context.Context, in *GetAssetByVersionRequest, opts ...grpc.CallOption) (*GetAssetByVersionResponse, error) } type compassServiceClient struct { @@ -70,8 +80,8 @@ func (c *compassServiceClient) GetDiscussion(ctx context.Context, in *GetDiscuss return out, nil } -func (c *compassServiceClient) PatchDiscussion(ctx context.Context, in *PatchDiscussionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *compassServiceClient) PatchDiscussion(ctx context.Context, in *PatchDiscussionRequest, opts ...grpc.CallOption) (*PatchDiscussionResponse, error) { + out := new(PatchDiscussionResponse) err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/PatchDiscussion", in, out, opts...) if err != nil { return nil, err @@ -106,8 +116,8 @@ func (c *compassServiceClient) GetComment(ctx context.Context, in *GetCommentReq return out, nil } -func (c *compassServiceClient) UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *compassServiceClient) UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error) { + out := new(UpdateCommentResponse) err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/UpdateComment", in, out, opts...) if err != nil { return nil, err @@ -115,8 +125,8 @@ func (c *compassServiceClient) UpdateComment(ctx context.Context, in *UpdateComm return out, nil } -func (c *compassServiceClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *compassServiceClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error) { + out := new(DeleteCommentResponse) err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/DeleteComment", in, out, opts...) if err != nil { return nil, err @@ -124,6 +134,105 @@ func (c *compassServiceClient) DeleteComment(ctx context.Context, in *DeleteComm return out, nil } +func (c *compassServiceClient) SearchAssets(ctx context.Context, in *SearchAssetsRequest, opts ...grpc.CallOption) (*SearchAssetsResponse, error) { + out := new(SearchAssetsResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/SearchAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) SuggestAssets(ctx context.Context, in *SuggestAssetsRequest, opts ...grpc.CallOption) (*SuggestAssetsResponse, error) { + out := new(SuggestAssetsResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/SuggestAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) GetGraph(ctx context.Context, in *GetGraphRequest, opts ...grpc.CallOption) (*GetGraphResponse, error) { + out := new(GetGraphResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/GetGraph", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) GetAllAssets(ctx context.Context, in *GetAllAssetsRequest, opts ...grpc.CallOption) (*GetAllAssetsResponse, error) { + out := new(GetAllAssetsResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/GetAllAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) GetAssetByID(ctx context.Context, in *GetAssetByIDRequest, opts ...grpc.CallOption) (*GetAssetByIDResponse, error) { + out := new(GetAssetByIDResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/GetAssetByID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) UpsertAsset(ctx context.Context, in *UpsertAssetRequest, opts ...grpc.CallOption) (*UpsertAssetResponse, error) { + out := new(UpsertAssetResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/UpsertAsset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) UpsertPatchAsset(ctx context.Context, in *UpsertPatchAssetRequest, opts ...grpc.CallOption) (*UpsertPatchAssetResponse, error) { + out := new(UpsertPatchAssetResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/UpsertPatchAsset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) DeleteAsset(ctx context.Context, in *DeleteAssetRequest, opts ...grpc.CallOption) (*DeleteAssetResponse, error) { + out := new(DeleteAssetResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/DeleteAsset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) GetAssetStargazers(ctx context.Context, in *GetAssetStargazersRequest, opts ...grpc.CallOption) (*GetAssetStargazersResponse, error) { + out := new(GetAssetStargazersResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/GetAssetStargazers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) GetAssetVersionHistory(ctx context.Context, in *GetAssetVersionHistoryRequest, opts ...grpc.CallOption) (*GetAssetVersionHistoryResponse, error) { + out := new(GetAssetVersionHistoryResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/GetAssetVersionHistory", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compassServiceClient) GetAssetByVersion(ctx context.Context, in *GetAssetByVersionRequest, opts ...grpc.CallOption) (*GetAssetByVersionResponse, error) { + out := new(GetAssetByVersionResponse) + err := c.cc.Invoke(ctx, "/odpf.compass.v1beta1.CompassService/GetAssetByVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // CompassServiceServer is the server API for CompassService service. // All implementations must embed UnimplementedCompassServiceServer // for forward compatibility @@ -132,12 +241,23 @@ type CompassServiceServer interface { GetAllDiscussions(context.Context, *GetAllDiscussionsRequest) (*GetAllDiscussionsResponse, error) CreateDiscussion(context.Context, *CreateDiscussionRequest) (*CreateDiscussionResponse, error) GetDiscussion(context.Context, *GetDiscussionRequest) (*GetDiscussionResponse, error) - PatchDiscussion(context.Context, *PatchDiscussionRequest) (*emptypb.Empty, error) + PatchDiscussion(context.Context, *PatchDiscussionRequest) (*PatchDiscussionResponse, error) CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error) GetAllComments(context.Context, *GetAllCommentsRequest) (*GetAllCommentsResponse, error) GetComment(context.Context, *GetCommentRequest) (*GetCommentResponse, error) - UpdateComment(context.Context, *UpdateCommentRequest) (*emptypb.Empty, error) - DeleteComment(context.Context, *DeleteCommentRequest) (*emptypb.Empty, error) + UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error) + DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error) + SearchAssets(context.Context, *SearchAssetsRequest) (*SearchAssetsResponse, error) + SuggestAssets(context.Context, *SuggestAssetsRequest) (*SuggestAssetsResponse, error) + GetGraph(context.Context, *GetGraphRequest) (*GetGraphResponse, error) + GetAllAssets(context.Context, *GetAllAssetsRequest) (*GetAllAssetsResponse, error) + GetAssetByID(context.Context, *GetAssetByIDRequest) (*GetAssetByIDResponse, error) + UpsertAsset(context.Context, *UpsertAssetRequest) (*UpsertAssetResponse, error) + UpsertPatchAsset(context.Context, *UpsertPatchAssetRequest) (*UpsertPatchAssetResponse, error) + DeleteAsset(context.Context, *DeleteAssetRequest) (*DeleteAssetResponse, error) + GetAssetStargazers(context.Context, *GetAssetStargazersRequest) (*GetAssetStargazersResponse, error) + GetAssetVersionHistory(context.Context, *GetAssetVersionHistoryRequest) (*GetAssetVersionHistoryResponse, error) + GetAssetByVersion(context.Context, *GetAssetByVersionRequest) (*GetAssetByVersionResponse, error) mustEmbedUnimplementedCompassServiceServer() } @@ -154,7 +274,7 @@ func (UnimplementedCompassServiceServer) CreateDiscussion(context.Context, *Crea func (UnimplementedCompassServiceServer) GetDiscussion(context.Context, *GetDiscussionRequest) (*GetDiscussionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDiscussion not implemented") } -func (UnimplementedCompassServiceServer) PatchDiscussion(context.Context, *PatchDiscussionRequest) (*emptypb.Empty, error) { +func (UnimplementedCompassServiceServer) PatchDiscussion(context.Context, *PatchDiscussionRequest) (*PatchDiscussionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PatchDiscussion not implemented") } func (UnimplementedCompassServiceServer) CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error) { @@ -166,12 +286,45 @@ func (UnimplementedCompassServiceServer) GetAllComments(context.Context, *GetAll func (UnimplementedCompassServiceServer) GetComment(context.Context, *GetCommentRequest) (*GetCommentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetComment not implemented") } -func (UnimplementedCompassServiceServer) UpdateComment(context.Context, *UpdateCommentRequest) (*emptypb.Empty, error) { +func (UnimplementedCompassServiceServer) UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateComment not implemented") } -func (UnimplementedCompassServiceServer) DeleteComment(context.Context, *DeleteCommentRequest) (*emptypb.Empty, error) { +func (UnimplementedCompassServiceServer) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented") } +func (UnimplementedCompassServiceServer) SearchAssets(context.Context, *SearchAssetsRequest) (*SearchAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchAssets not implemented") +} +func (UnimplementedCompassServiceServer) SuggestAssets(context.Context, *SuggestAssetsRequest) (*SuggestAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SuggestAssets not implemented") +} +func (UnimplementedCompassServiceServer) GetGraph(context.Context, *GetGraphRequest) (*GetGraphResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGraph not implemented") +} +func (UnimplementedCompassServiceServer) GetAllAssets(context.Context, *GetAllAssetsRequest) (*GetAllAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllAssets not implemented") +} +func (UnimplementedCompassServiceServer) GetAssetByID(context.Context, *GetAssetByIDRequest) (*GetAssetByIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAssetByID not implemented") +} +func (UnimplementedCompassServiceServer) UpsertAsset(context.Context, *UpsertAssetRequest) (*UpsertAssetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpsertAsset not implemented") +} +func (UnimplementedCompassServiceServer) UpsertPatchAsset(context.Context, *UpsertPatchAssetRequest) (*UpsertPatchAssetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpsertPatchAsset not implemented") +} +func (UnimplementedCompassServiceServer) DeleteAsset(context.Context, *DeleteAssetRequest) (*DeleteAssetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAsset not implemented") +} +func (UnimplementedCompassServiceServer) GetAssetStargazers(context.Context, *GetAssetStargazersRequest) (*GetAssetStargazersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAssetStargazers not implemented") +} +func (UnimplementedCompassServiceServer) GetAssetVersionHistory(context.Context, *GetAssetVersionHistoryRequest) (*GetAssetVersionHistoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAssetVersionHistory not implemented") +} +func (UnimplementedCompassServiceServer) GetAssetByVersion(context.Context, *GetAssetByVersionRequest) (*GetAssetByVersionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAssetByVersion not implemented") +} func (UnimplementedCompassServiceServer) mustEmbedUnimplementedCompassServiceServer() {} // UnsafeCompassServiceServer may be embedded to opt out of forward compatibility for this service. @@ -347,6 +500,204 @@ func _CompassService_DeleteComment_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _CompassService_SearchAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchAssetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).SearchAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/SearchAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).SearchAssets(ctx, req.(*SearchAssetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_SuggestAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SuggestAssetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).SuggestAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/SuggestAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).SuggestAssets(ctx, req.(*SuggestAssetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_GetGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGraphRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).GetGraph(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/GetGraph", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).GetGraph(ctx, req.(*GetGraphRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_GetAllAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllAssetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).GetAllAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/GetAllAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).GetAllAssets(ctx, req.(*GetAllAssetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_GetAssetByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAssetByIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).GetAssetByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/GetAssetByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).GetAssetByID(ctx, req.(*GetAssetByIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_UpsertAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpsertAssetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).UpsertAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/UpsertAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).UpsertAsset(ctx, req.(*UpsertAssetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_UpsertPatchAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpsertPatchAssetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).UpsertPatchAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/UpsertPatchAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).UpsertPatchAsset(ctx, req.(*UpsertPatchAssetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_DeleteAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAssetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).DeleteAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/DeleteAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).DeleteAsset(ctx, req.(*DeleteAssetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_GetAssetStargazers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAssetStargazersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).GetAssetStargazers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/GetAssetStargazers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).GetAssetStargazers(ctx, req.(*GetAssetStargazersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_GetAssetVersionHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAssetVersionHistoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).GetAssetVersionHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/GetAssetVersionHistory", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).GetAssetVersionHistory(ctx, req.(*GetAssetVersionHistoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CompassService_GetAssetByVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAssetByVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompassServiceServer).GetAssetByVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/odpf.compass.v1beta1.CompassService/GetAssetByVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompassServiceServer).GetAssetByVersion(ctx, req.(*GetAssetByVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + // CompassService_ServiceDesc is the grpc.ServiceDesc for CompassService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -390,6 +741,50 @@ var CompassService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteComment", Handler: _CompassService_DeleteComment_Handler, }, + { + MethodName: "SearchAssets", + Handler: _CompassService_SearchAssets_Handler, + }, + { + MethodName: "SuggestAssets", + Handler: _CompassService_SuggestAssets_Handler, + }, + { + MethodName: "GetGraph", + Handler: _CompassService_GetGraph_Handler, + }, + { + MethodName: "GetAllAssets", + Handler: _CompassService_GetAllAssets_Handler, + }, + { + MethodName: "GetAssetByID", + Handler: _CompassService_GetAssetByID_Handler, + }, + { + MethodName: "UpsertAsset", + Handler: _CompassService_UpsertAsset_Handler, + }, + { + MethodName: "UpsertPatchAsset", + Handler: _CompassService_UpsertPatchAsset_Handler, + }, + { + MethodName: "DeleteAsset", + Handler: _CompassService_DeleteAsset_Handler, + }, + { + MethodName: "GetAssetStargazers", + Handler: _CompassService_GetAssetStargazers_Handler, + }, + { + MethodName: "GetAssetVersionHistory", + Handler: _CompassService_GetAssetVersionHistory_Handler, + }, + { + MethodName: "GetAssetByVersion", + Handler: _CompassService_GetAssetByVersion_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "odpf/compass/v1beta1/service.proto", diff --git a/api/v1beta1/asset.go b/api/v1beta1/asset.go new file mode 100644 index 00000000..52617fbb --- /dev/null +++ b/api/v1beta1/asset.go @@ -0,0 +1,370 @@ +package v1beta1 + +import ( + "context" + "errors" + "fmt" + + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/asset" + "github.com/odpf/columbus/lineage" + "github.com/odpf/columbus/star" + "github.com/odpf/columbus/user" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (h *Handler) GetAllAssets(ctx context.Context, req *compassv1beta1.GetAllAssetsRequest) (*compassv1beta1.GetAllAssetsResponse, error) { + config := asset.Config{ + Text: req.GetText(), + Type: asset.Type(req.GetType()), + Service: req.GetService(), + Size: int(req.GetSize()), + Offset: int(req.GetOffset()), + } + + assets, err := h.AssetRepository.GetAll(ctx, config) + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + assetsProto := []*compassv1beta1.Asset{} + for _, a := range assets { + ap, err := a.ToProto() + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + assetsProto = append(assetsProto, ap) + } + + response := &compassv1beta1.GetAllAssetsResponse{ + Data: assetsProto, + } + + if req.GetWithTotal() { + total, err := h.AssetRepository.GetCount(ctx, asset.Config{ + Type: config.Type, + Service: config.Service, + Text: config.Text, + }) + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + response.Total = uint32(total) + } + + return response, nil +} + +func (h *Handler) GetAssetByID(ctx context.Context, req *compassv1beta1.GetAssetByIDRequest) (*compassv1beta1.GetAssetByIDResponse, error) { + ast, err := h.AssetRepository.GetByID(ctx, req.GetId()) + if err != nil { + if errors.As(err, new(asset.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if errors.As(err, new(asset.NotFoundError)) { + return nil, status.Error(codes.NotFound, err.Error()) + } + return nil, internalServerError(h.Logger, err.Error()) + } + + astProto, err := ast.ToProto() + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + return &compassv1beta1.GetAssetByIDResponse{ + Data: astProto, + }, nil +} + +func (h *Handler) UpsertAsset(ctx context.Context, req *compassv1beta1.UpsertAssetRequest) (*compassv1beta1.UpsertAssetResponse, error) { + userID := user.FromContext(ctx) + if userID == "" { + return nil, status.Error(codes.InvalidArgument, errMissingUserInfo.Error()) + } + + baseAsset := req.GetAsset() + if baseAsset == nil { + return nil, status.Error(codes.InvalidArgument, "asset cannot be empty") + } + + ast := asset.Asset{ + URN: baseAsset.GetUrn(), + Type: asset.Type(baseAsset.GetType()), + Name: baseAsset.GetName(), + Service: baseAsset.GetService(), + Description: baseAsset.GetDescription(), + } + ast.AssignDataFromProto(baseAsset.GetData()) + ast.AssignLabelsFromProto(baseAsset.GetLabels()) + + if err := h.validateAsset(ast); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ast.UpdatedBy.ID = userID + assetID, err := h.AssetRepository.Upsert(ctx, &ast) + if errors.As(err, new(asset.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + ast.ID = assetID + if err := h.DiscoveryRepository.Upsert(ctx, ast); err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + if err := h.saveLineage(ctx, ast, req.GetUpstreams(), req.GetDownstreams()); err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + return &compassv1beta1.UpsertAssetResponse{ + Id: assetID, + }, nil +} +func (h *Handler) UpsertPatchAsset(ctx context.Context, req *compassv1beta1.UpsertPatchAssetRequest) (*compassv1beta1.UpsertPatchAssetResponse, error) { + userID := user.FromContext(ctx) + if userID == "" { + return nil, status.Error(codes.InvalidArgument, errMissingUserInfo.Error()) + } + + baseAsset := req.GetAsset() + if baseAsset == nil { + return nil, status.Error(codes.InvalidArgument, "asset cannot be empty") + } + + urn, typ, service, err := h.validatePatchAsset(baseAsset) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ast, err := h.AssetRepository.Find(ctx, urn, asset.Type(typ), service) + if err != nil && !errors.As(err, &asset.NotFoundError{}) { + return nil, internalServerError(h.Logger, err.Error()) + } + + patchAssetMap := decodePatchAssetToMap(baseAsset) + ast.Patch(patchAssetMap) + + if err := h.validateAsset(ast); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ast.UpdatedBy.ID = userID + assetID, err := h.AssetRepository.Upsert(ctx, &ast) + if errors.As(err, new(asset.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + ast.ID = assetID + if err := h.DiscoveryRepository.Upsert(ctx, ast); err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + if err := h.saveLineage(ctx, ast, req.GetUpstreams(), req.GetDownstreams()); err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + return &compassv1beta1.UpsertPatchAssetResponse{ + Id: ast.ID, + }, nil +} + +func (h *Handler) DeleteAsset(ctx context.Context, req *compassv1beta1.DeleteAssetRequest) (*compassv1beta1.DeleteAssetResponse, error) { + userID := user.FromContext(ctx) + if userID == "" { + return nil, status.Error(codes.InvalidArgument, errMissingUserInfo.Error()) + } + + if err := h.AssetRepository.Delete(ctx, req.GetId()); err != nil { + if errors.As(err, new(asset.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if errors.As(err, new(asset.NotFoundError)) { + return nil, status.Error(codes.NotFound, err.Error()) + } + return nil, internalServerError(h.Logger, err.Error()) + } + + if err := h.DiscoveryRepository.Delete(ctx, req.GetId()); err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + return &compassv1beta1.DeleteAssetResponse{}, nil +} + +func (h *Handler) GetAssetStargazers(ctx context.Context, req *compassv1beta1.GetAssetStargazersRequest) (*compassv1beta1.GetAssetStargazersResponse, error) { + + users, err := h.StarRepository.GetStargazers(ctx, star.Config{ + Size: int(req.GetSize()), + Offset: int(req.GetOffset()), + }, req.GetId()) + if err != nil { + if errors.Is(err, star.ErrEmptyUserID) || errors.Is(err, star.ErrEmptyAssetID) || errors.As(err, new(star.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if errors.As(err, new(star.NotFoundError)) { + return nil, status.Error(codes.NotFound, err.Error()) + } + return nil, internalServerError(h.Logger, err.Error()) + } + + usersPB := []*compassv1beta1.User{} + for _, us := range users { + usersPB = append(usersPB, us.ToProto()) + } + + return &compassv1beta1.GetAssetStargazersResponse{ + Data: usersPB, + }, nil +} + +func (h *Handler) GetAssetVersionHistory(ctx context.Context, req *compassv1beta1.GetAssetVersionHistoryRequest) (*compassv1beta1.GetAssetVersionHistoryResponse, error) { + assetVersions, err := h.AssetRepository.GetVersionHistory(ctx, asset.Config{ + Size: int(req.GetSize()), + Offset: int(req.GetOffset()), + }, req.GetId()) + if err != nil { + if errors.As(err, new(asset.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if errors.As(err, new(asset.NotFoundError)) { + return nil, status.Error(codes.NotFound, err.Error()) + } + return nil, internalServerError(h.Logger, err.Error()) + } + + assetsPB := []*compassv1beta1.Asset{} + for _, av := range assetVersions { + avPB, err := av.ToProto() + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + assetsPB = append(assetsPB, avPB) + } + + return &compassv1beta1.GetAssetVersionHistoryResponse{ + Data: assetsPB, + }, nil +} + +func (h *Handler) GetAssetByVersion(ctx context.Context, req *compassv1beta1.GetAssetByVersionRequest) (*compassv1beta1.GetAssetByVersionResponse, error) { + if _, err := asset.ParseVersion(req.GetVersion()); err != nil { + return nil, status.Error(codes.NotFound, err.Error()) + } + + ast, err := h.AssetRepository.GetByVersion(ctx, req.GetId(), req.GetVersion()) + if err != nil { + if errors.As(err, new(asset.InvalidError)) { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + if errors.As(err, new(asset.NotFoundError)) { + return nil, status.Error(codes.NotFound, err.Error()) + } + return nil, internalServerError(h.Logger, err.Error()) + } + + assetPB, err := ast.ToProto() + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + return &compassv1beta1.GetAssetByVersionResponse{ + Data: assetPB, + }, nil +} + +func (h *Handler) validateAsset(ast asset.Asset) error { + if ast.URN == "" { + return fmt.Errorf("urn is required") + } + if ast.Type == "" { + return fmt.Errorf("type is required") + } + if !ast.Type.IsValid() { + return fmt.Errorf("type is invalid") + } + if ast.Name == "" { + return fmt.Errorf("name is required") + } + if ast.Data == nil { + return fmt.Errorf("data is required") + } + if ast.Service == "" { + return fmt.Errorf("service is required") + } + + return nil +} + +func (h *Handler) validatePatchAsset(ast *compassv1beta1.UpsertPatchAssetRequest_BaseAsset) (urn, typ, service string, err error) { + if urn = ast.GetUrn(); urn == "" { + err = fmt.Errorf("urn is required and can't be empty") + return + } + + if typ = ast.GetType(); typ == "" { + err = fmt.Errorf("type is required and can't be empty") + return + } + + if !asset.Type(typ).IsValid() { + err = fmt.Errorf("type is invalid") + return + } + + if service = ast.GetService(); service == "" { + err = fmt.Errorf("service is required and can't be empty") + return + } + + return +} + +func (h *Handler) saveLineage(ctx context.Context, ast asset.Asset, upstreamsPB, downstreamsPB []*compassv1beta1.LineageNode) error { + upstreams := []lineage.Node{} + for _, pb := range upstreamsPB { + upstreams = append(upstreams, lineage.NewNodeFromProto(pb)) + } + downstreams := []lineage.Node{} + for _, pb := range downstreamsPB { + downstreams = append(downstreams, lineage.NewNodeFromProto(pb)) + } + node := lineage.Node{ + URN: ast.URN, + Type: ast.Type, + Service: ast.Service, + } + + return h.LineageRepository.Upsert(ctx, node, upstreams, downstreams) +} + +func decodePatchAssetToMap(pb *compassv1beta1.UpsertPatchAssetRequest_BaseAsset) map[string]interface{} { + if pb == nil { + return nil + } + m := map[string]interface{}{} + m["urn"] = pb.GetUrn() + m["type"] = pb.GetType() + m["service"] = pb.GetService() + if pb.GetName() != nil { + m["name"] = pb.GetName().Value + } + if pb.GetDescription() != nil { + m["description"] = pb.GetDescription().Value + } + if pb.GetData() != nil { + m["data"] = pb.GetData().AsMap() + } + if pb.GetLabels() != nil { + m["labels"] = pb.GetLabels().AsMap() + } + + return m +} diff --git a/api/v1beta1/asset_test.go b/api/v1beta1/asset_test.go new file mode 100644 index 00000000..edd201f7 --- /dev/null +++ b/api/v1beta1/asset_test.go @@ -0,0 +1,1138 @@ +package v1beta1_test + +import ( + "context" + "errors" + "fmt" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/odpf/columbus/api" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/asset" + "github.com/odpf/columbus/lib/mocks" + "github.com/odpf/columbus/lineage" + "github.com/odpf/columbus/star" + "github.com/odpf/columbus/user" + "github.com/odpf/salt/log" + "github.com/stretchr/testify/mock" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/wrapperspb" +) + +func TestGetAllAssets(t *testing.T) { + var userID = uuid.NewString() + type testCase struct { + Description string + Request *compassv1beta1.GetAllAssetsRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.AssetRepository) + PostCheck func(resp *compassv1beta1.GetAllAssetsResponse) error + } + + var testCases = []testCase{ + { + Description: `should return internal server error if fetching fails`, + ExpectStatus: codes.Internal, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetAll", ctx, asset.Config{}).Return([]asset.Asset{}, errors.New("unknown error")) + }, + }, + { + Description: `should return internal server error if fetching total fails`, + Request: &compassv1beta1.GetAllAssetsRequest{ + WithTotal: true, + }, + ExpectStatus: codes.Internal, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetAll", ctx, asset.Config{}).Return([]asset.Asset{}, nil, nil) + ar.On("GetCount", ctx, asset.Config{}).Return(0, errors.New("unknown error")) + }, + }, + { + Description: `should successfully get config from request`, + Request: &compassv1beta1.GetAllAssetsRequest{ + Text: "asd", + Type: "table", + Service: "bigquery", + Size: 30, + Offset: 50, + }, + ExpectStatus: codes.OK, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetAll", ctx, asset.Config{ + Text: "asd", + Type: "table", + Service: "bigquery", + Size: 30, + Offset: 50, + }).Return([]asset.Asset{}, nil, nil) + }, + }, + { + Description: "should return status OK along with list of assets", + ExpectStatus: codes.OK, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetAll", ctx, asset.Config{}).Return([]asset.Asset{ + {ID: "testid-1"}, + {ID: "testid-2"}, + }, nil, nil) + }, + PostCheck: func(resp *compassv1beta1.GetAllAssetsResponse) error { + expected := &compassv1beta1.GetAllAssetsResponse{ + Data: []*compassv1beta1.Asset{ + {Id: "testid-1"}, + {Id: "testid-2"}, + }, + } + + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + { + Description: "should return total in the payload if with_total flag is given", + ExpectStatus: codes.OK, + Request: &compassv1beta1.GetAllAssetsRequest{ + Text: "dsa", + Type: "job", + Service: "kafka", + Size: 10, + Offset: 5, + WithTotal: true, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetAll", ctx, asset.Config{ + Text: "dsa", + Type: "job", + Service: "kafka", + Size: 10, + Offset: 5, + }).Return([]asset.Asset{ + {ID: "testid-1"}, + {ID: "testid-2"}, + {ID: "testid-3"}, + }, nil, nil) + ar.On("GetCount", ctx, asset.Config{ + Text: "dsa", + Type: "job", + Service: "kafka", + }).Return(150, nil, nil) + }, + PostCheck: func(resp *compassv1beta1.GetAllAssetsResponse) error { + expected := &compassv1beta1.GetAllAssetsResponse{ + Total: 150, + Data: []*compassv1beta1.Asset{ + {Id: "testid-1"}, + {Id: "testid-2"}, + {Id: "testid-3"}, + }, + } + + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo) + } + defer mockAssetRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + }) + + got, err := handler.GetAllAssets(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestGetAssetByID(t *testing.T) { + var ( + userID = uuid.NewString() + assetID = uuid.NewString() + ast = asset.Asset{ + ID: assetID, + } + ) + + type testCase struct { + Description string + ExpectStatus codes.Code + Setup func(context.Context, *mocks.AssetRepository) + PostCheck func(resp *compassv1beta1.GetAssetByIDResponse) error + } + + var testCases = []testCase{ + { + Description: `should return invalid argument if asset id is not uuid`, + ExpectStatus: codes.InvalidArgument, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetByID", ctx, assetID).Return(asset.Asset{}, asset.InvalidError{AssetID: assetID}) + }, + }, + { + Description: `should return not found if asset doesn't exist`, + ExpectStatus: codes.NotFound, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetByID", ctx, assetID).Return(asset.Asset{}, asset.NotFoundError{AssetID: assetID}) + }, + }, + { + Description: `should return internal server error if fetching fails`, + ExpectStatus: codes.Internal, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetByID", ctx, assetID).Return(asset.Asset{}, errors.New("unknown error")) + }, + }, + { + Description: "should return http 200 status along with the asset, if found", + ExpectStatus: codes.OK, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.On("GetByID", ctx, assetID).Return(ast, nil, nil) + }, + PostCheck: func(resp *compassv1beta1.GetAssetByIDResponse) error { + expected := &compassv1beta1.GetAssetByIDResponse{ + Data: &compassv1beta1.Asset{ + Id: assetID, + }, + } + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo) + } + defer mockAssetRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + }) + + got, err := handler.GetAssetByID(ctx, &compassv1beta1.GetAssetByIDRequest{Id: assetID}) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestUpsertAsset(t *testing.T) { + var ( + userID = uuid.NewString() + assetID = uuid.NewString() + validPayload = &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "test dagger", + Type: "table", + Name: "de-dagger-test", + Service: "kafka", + Data: &structpb.Struct{}, + }, + Upstreams: []*compassv1beta1.LineageNode{ + { + Urn: "upstream-1", + Type: "job", + Service: "optimus", + }, + }, + Downstreams: []*compassv1beta1.LineageNode{ + { + Urn: "downstream-1", + Type: "dashboard", + Service: "metabase", + }, + { + Urn: "downstream-2", + Type: "dashboard", + Service: "tableau", + }, + }, + } + ) + type testCase struct { + Description string + Request *compassv1beta1.UpsertAssetRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.AssetRepository, *mocks.DiscoveryRepository, *mocks.LineageRepository) + PostCheck func(resp *compassv1beta1.UpsertAssetResponse) error + } + + var testCases = []testCase{ + { + Description: "empty object asset will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{}, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty urn will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "", + Name: "some-name", + Data: &structpb.Struct{}, + Service: "some-service", + Type: "table", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty name will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: "", + Data: &structpb.Struct{}, + Service: "some-service", + Type: "table", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "nil data will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: "some-name", + Service: "some-service", + Type: "table", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty service will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: "some-name", + Data: &structpb.Struct{}, + Service: "", + Type: "table", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty type will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: "some-name", + Data: &structpb.Struct{}, + Service: "some-service", + Type: "", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "invalid type will return invalid argument", + Request: &compassv1beta1.UpsertAssetRequest{ + Asset: &compassv1beta1.UpsertAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: "some-name", + Data: &structpb.Struct{}, + Service: "some-service", + Type: "invalid type", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "should return internal server error when the asset repository fails", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.On("Upsert", ctx, mock.AnythingOfType("*asset.Asset")).Return("1234-5678", expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return internal server error when the discovery repository fails", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.On("Upsert", ctx, mock.AnythingOfType("*asset.Asset")).Return("1234-5678", nil, nil) + dr.On("Upsert", ctx, mock.AnythingOfType("asset.Asset")).Return(expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return internal server error when the lineage repository fails", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.EXPECT().Upsert(ctx, mock.AnythingOfType("*asset.Asset")).Return("1234-5678", nil) + dr.EXPECT().Upsert(ctx, mock.AnythingOfType("asset.Asset")).Return(nil) + lr.EXPECT().Upsert(ctx, + mock.AnythingOfType("lineage.Node"), + mock.AnythingOfType("[]lineage.Node"), + mock.AnythingOfType("[]lineage.Node"), + ).Return(expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return OK and asset's ID if the asset is successfully created/updated", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + ast := asset.Asset{ + URN: "test dagger", + Type: asset.TypeTable, + Name: "de-dagger-test", + Service: "kafka", + UpdatedBy: user.User{ID: userID}, + Data: map[string]interface{}{}, + } + upstreams := []lineage.Node{ + {URN: "upstream-1", Type: asset.TypeJob, Service: "optimus"}, + } + downstreams := []lineage.Node{ + {URN: "downstream-1", Type: asset.TypeDashboard, Service: "metabase"}, + {URN: "downstream-2", Type: asset.TypeDashboard, Service: "tableau"}, + } + assetWithID := ast + assetWithID.ID = assetID + + ar.EXPECT().Upsert(ctx, &ast).Return(assetWithID.ID, nil).Run(func(ctx context.Context, ast *asset.Asset) { + ast.ID = assetWithID.ID + }) + dr.EXPECT().Upsert(ctx, assetWithID).Return(nil) + lr.EXPECT().Upsert(ctx, + lineage.Node{ + URN: ast.URN, + Type: ast.Type, + Service: ast.Service, + }, + upstreams, + downstreams, + ).Return(nil) + }, + Request: validPayload, + ExpectStatus: codes.OK, + PostCheck: func(resp *compassv1beta1.UpsertAssetResponse) error { + expected := &compassv1beta1.UpsertAssetResponse{ + Id: assetID, + } + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + mockDiscoveryRepo := new(mocks.DiscoveryRepository) + mockLineageRepo := new(mocks.LineageRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo, mockDiscoveryRepo, mockLineageRepo) + } + defer mockAssetRepo.AssertExpectations(t) + defer mockDiscoveryRepo.AssertExpectations(t) + defer mockLineageRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + DiscoveryRepository: mockDiscoveryRepo, + LineageRepository: mockLineageRepo, + }) + + got, err := handler.UpsertAsset(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestUpsertPatchAsset(t *testing.T) { + var ( + userID = uuid.NewString() + assetID = uuid.NewString() + validPayload = &compassv1beta1.UpsertPatchAssetRequest{ + Asset: &compassv1beta1.UpsertPatchAssetRequest_BaseAsset{ + Urn: "test dagger", + Type: "table", + Name: wrapperspb.String("new-name"), + Service: "kafka", + Data: &structpb.Struct{}, + }, + Upstreams: []*compassv1beta1.LineageNode{ + { + Urn: "upstream-1", + Type: "job", + Service: "optimus", + }, + }, + Downstreams: []*compassv1beta1.LineageNode{ + { + Urn: "downstream-1", + Type: "dashboard", + Service: "metabase", + }, + { + Urn: "downstream-2", + Type: "dashboard", + Service: "tableau", + }, + }, + } + currentAsset = asset.Asset{ + URN: "test dagger", + Type: asset.TypeTable, + Name: "old-name", // this value will be updated + Service: "kafka", + UpdatedBy: user.User{ID: userID}, + Data: map[string]interface{}{}, + } + ) + type testCase struct { + Description string + Request *compassv1beta1.UpsertPatchAssetRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.AssetRepository, *mocks.DiscoveryRepository, *mocks.LineageRepository) + PostCheck func(resp *compassv1beta1.UpsertPatchAssetResponse) error + } + + var testCases = []testCase{ + { + Description: "empty payload will return invalid argument", + Request: &compassv1beta1.UpsertPatchAssetRequest{}, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty asset will return invalid argument", + Request: &compassv1beta1.UpsertPatchAssetRequest{Asset: &compassv1beta1.UpsertPatchAssetRequest_BaseAsset{}}, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty urn will return invalid argument", + Request: &compassv1beta1.UpsertPatchAssetRequest{ + Asset: &compassv1beta1.UpsertPatchAssetRequest_BaseAsset{ + Urn: "", + Name: wrapperspb.String("some-name"), + Data: &structpb.Struct{}, + Service: "some-service", + Type: "table", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty service will return invalid argument", + Request: &compassv1beta1.UpsertPatchAssetRequest{ + Asset: &compassv1beta1.UpsertPatchAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: wrapperspb.String("some-name"), + Data: &structpb.Struct{}, + Service: "", + Type: "table", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "empty type will return invalid argument", + Request: &compassv1beta1.UpsertPatchAssetRequest{ + Asset: &compassv1beta1.UpsertPatchAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: wrapperspb.String("some-name"), + Data: &structpb.Struct{}, + Service: "some-service", + Type: "", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "invalid type will return invalid argument", + Request: &compassv1beta1.UpsertPatchAssetRequest{ + Asset: &compassv1beta1.UpsertPatchAssetRequest_BaseAsset{ + Urn: "some-urn", + Name: wrapperspb.String("some-name"), + Data: &structpb.Struct{}, + Service: "some-service", + Type: "invalid type", + }, + }, + ExpectStatus: codes.InvalidArgument, + }, + { + Description: "should return internal server error when finding asset failed", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.EXPECT().Find(ctx, "test dagger", asset.TypeTable, "kafka").Return(currentAsset, expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return internal server error when upserting asset repository failed", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.EXPECT().Find(ctx, "test dagger", asset.TypeTable, "kafka").Return(currentAsset, nil) + ar.EXPECT().Upsert(ctx, mock.AnythingOfType("*asset.Asset")).Return("1234-5678", expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return internal server error when the discovery repository fails", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.EXPECT().Find(ctx, "test dagger", asset.TypeTable, "kafka").Return(currentAsset, nil) + ar.EXPECT().Upsert(ctx, mock.AnythingOfType("*asset.Asset")).Return("1234-5678", nil) + dr.EXPECT().Upsert(ctx, mock.AnythingOfType("asset.Asset")).Return(expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return internal server error when the lineage repository fails", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + expectedErr := errors.New("unknown error") + ar.EXPECT().Find(ctx, "test dagger", asset.TypeTable, "kafka").Return(currentAsset, nil) + ar.EXPECT().Upsert(ctx, mock.AnythingOfType("*asset.Asset")).Return("1234-5678", nil) + dr.EXPECT().Upsert(ctx, mock.AnythingOfType("asset.Asset")).Return(nil) + lr.EXPECT().Upsert(ctx, + mock.AnythingOfType("lineage.Node"), + mock.AnythingOfType("[]lineage.Node"), + mock.AnythingOfType("[]lineage.Node"), + ).Return(expectedErr) + }, + Request: validPayload, + ExpectStatus: codes.Internal, + }, + { + Description: "should return OK and asset's ID if the asset is successfully created/patched", + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, lr *mocks.LineageRepository) { + patchedAsset := asset.Asset{ + URN: "test dagger", + Type: asset.TypeTable, + Name: "new-name", + Service: "kafka", + UpdatedBy: user.User{ID: userID}, + Data: map[string]interface{}{}, + } + upstreams := []lineage.Node{ + {URN: "upstream-1", Type: asset.TypeJob, Service: "optimus"}, + } + downstreams := []lineage.Node{ + {URN: "downstream-1", Type: asset.TypeDashboard, Service: "metabase"}, + {URN: "downstream-2", Type: asset.TypeDashboard, Service: "tableau"}, + } + + assetWithID := patchedAsset + assetWithID.ID = assetID + + ar.EXPECT().Find(ctx, "test dagger", asset.TypeTable, "kafka").Return(currentAsset, nil) + ar.EXPECT().Upsert(ctx, &patchedAsset).Return(assetWithID.ID, nil).Run(func(ctx context.Context, ast *asset.Asset) { + patchedAsset.ID = assetWithID.ID + }) + dr.EXPECT().Upsert(ctx, assetWithID).Return(nil) + lr.EXPECT().Upsert(ctx, + lineage.Node{ + URN: patchedAsset.URN, + Type: patchedAsset.Type, + Service: patchedAsset.Service, + }, + upstreams, + downstreams, + ).Return(nil) + }, + Request: validPayload, + ExpectStatus: codes.OK, + PostCheck: func(resp *compassv1beta1.UpsertPatchAssetResponse) error { + expected := &compassv1beta1.UpsertPatchAssetResponse{ + Id: assetID, + } + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + mockDiscoveryRepo := new(mocks.DiscoveryRepository) + mockLineageRepo := new(mocks.LineageRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo, mockDiscoveryRepo, mockLineageRepo) + } + defer mockAssetRepo.AssertExpectations(t) + defer mockDiscoveryRepo.AssertExpectations(t) + defer mockLineageRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + DiscoveryRepository: mockDiscoveryRepo, + LineageRepository: mockLineageRepo, + }) + + got, err := handler.UpsertPatchAsset(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestDeleteAsset(t *testing.T) { + var ( + userID = uuid.NewString() + ) + + type TestCase struct { + Description string + AssetID string + ExpectStatus codes.Code + Setup func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, astID string) + } + + var testCases = []TestCase{ + { + Description: "should return invalid argument when asset id is not uuid", + AssetID: "not-uuid", + ExpectStatus: codes.InvalidArgument, + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, astID string) { + ar.EXPECT().Delete(ctx, astID).Return(asset.InvalidError{AssetID: astID}) + }, + }, + { + Description: "should return not found when asset cannot be found", + AssetID: uuid.NewString(), + ExpectStatus: codes.NotFound, + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, astID string) { + ar.On("Delete", ctx, astID).Return(asset.NotFoundError{AssetID: astID}) + }, + }, + { + Description: "should return 500 on error deleting asset", + AssetID: uuid.NewString(), + ExpectStatus: codes.Internal, + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, astID string) { + ar.On("Delete", ctx, astID).Return(errors.New("error deleting asset")) + }, + }, + { + Description: "should return internal server error on error deleting asset from discovery", + AssetID: uuid.NewString(), + ExpectStatus: codes.Internal, + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, astID string) { + ar.On("Delete", ctx, astID).Return(nil) + dr.On("Delete", ctx, astID).Return(asset.NotFoundError{AssetID: astID}) + }, + }, + { + Description: "should return OK on success", + AssetID: uuid.NewString(), + ExpectStatus: codes.OK, + Setup: func(ctx context.Context, ar *mocks.AssetRepository, dr *mocks.DiscoveryRepository, astID string) { + ar.On("Delete", ctx, astID).Return(nil) + dr.On("Delete", ctx, astID).Return(nil) + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + mockDiscoveryRepo := new(mocks.DiscoveryRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo, mockDiscoveryRepo, tc.AssetID) + } + defer mockAssetRepo.AssertExpectations(t) + defer mockDiscoveryRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + DiscoveryRepository: mockDiscoveryRepo, + }) + + _, err := handler.DeleteAsset(ctx, &compassv1beta1.DeleteAssetRequest{Id: tc.AssetID}) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + }) + } +} + +func TestGetAssetStargazers(t *testing.T) { + + var ( + offset = 10 + size = 20 + defaultStarCfg = star.Config{Offset: offset, Size: size} + assetID = uuid.NewString() + userID = uuid.NewString() + ) + + type TestCase struct { + Description string + Request *compassv1beta1.GetAssetStargazersRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.StarRepository) + PostCheck func(resp *compassv1beta1.GetAssetStargazersResponse) error + } + + var testCases = []TestCase{ + { + Description: "should return internal server error if failed to fetch star repository", + ExpectStatus: codes.Internal, + Request: &compassv1beta1.GetAssetStargazersRequest{ + Id: assetID, + Size: uint32(size), + Offset: uint32(offset), + }, + Setup: func(ctx context.Context, sr *mocks.StarRepository) { + sr.EXPECT().GetStargazers(ctx, defaultStarCfg, assetID).Return(nil, errors.New("some error")) + }, + }, + { + Description: "should return not found if star repository return not found error", + ExpectStatus: codes.NotFound, + Request: &compassv1beta1.GetAssetStargazersRequest{ + Id: assetID, + Size: uint32(size), + Offset: uint32(offset), + }, + Setup: func(ctx context.Context, sr *mocks.StarRepository) { + sr.EXPECT().GetStargazers(ctx, defaultStarCfg, assetID).Return(nil, star.NotFoundError{}) + }, + }, + { + Description: "should return OK if star repository return nil error", + ExpectStatus: codes.OK, + Request: &compassv1beta1.GetAssetStargazersRequest{ + Id: assetID, + Size: uint32(size), + Offset: uint32(offset), + }, + Setup: func(ctx context.Context, sr *mocks.StarRepository) { + sr.EXPECT().GetStargazers(ctx, defaultStarCfg, assetID).Return([]user.User{{ID: "1"}, {ID: "2"}, {ID: "3"}}, nil) + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockStarRepo := new(mocks.StarRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockStarRepo) + } + defer mockStarRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + StarRepository: mockStarRepo, + }) + + got, err := handler.GetAssetStargazers(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestGetAssetVersionHistory(t *testing.T) { + + var assetID = uuid.NewString() + + type TestCase struct { + Description string + Request *compassv1beta1.GetAssetVersionHistoryRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.AssetRepository) + PostCheck func(resp *compassv1beta1.GetAssetVersionHistoryResponse) error + } + + var testCases = []TestCase{ + { + Description: `should return invalid argument if asset id is not uuid`, + ExpectStatus: codes.InvalidArgument, + Request: &compassv1beta1.GetAssetVersionHistoryRequest{ + Id: assetID, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetVersionHistory(ctx, asset.Config{}, assetID).Return([]asset.Asset{}, asset.InvalidError{AssetID: assetID}) + }, + }, + { + Description: `should return internal server error if fetching fails`, + ExpectStatus: codes.Internal, + Request: &compassv1beta1.GetAssetVersionHistoryRequest{ + Id: assetID, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetVersionHistory(ctx, asset.Config{}, assetID).Return([]asset.Asset{}, errors.New("unknown error")) + }, + }, + { + Description: `should parse querystring to get config`, + Request: &compassv1beta1.GetAssetVersionHistoryRequest{ + Id: assetID, + Size: 30, + Offset: 50, + }, + ExpectStatus: codes.OK, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetVersionHistory(ctx, asset.Config{ + Size: 30, + Offset: 50, + }, assetID).Return([]asset.Asset{}, nil) + }, + }, + { + Description: "should return status OK along with list of asset versions", + ExpectStatus: codes.OK, + Request: &compassv1beta1.GetAssetVersionHistoryRequest{ + Id: assetID, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetVersionHistory(ctx, asset.Config{}, assetID).Return([]asset.Asset{ + {ID: "testid-1"}, + {ID: "testid-2"}, + }, nil) + }, + PostCheck: func(resp *compassv1beta1.GetAssetVersionHistoryResponse) error { + expected := &compassv1beta1.GetAssetVersionHistoryResponse{ + Data: []*compassv1beta1.Asset{ + { + Id: "testid-1", + }, + { + Id: "testid-2", + }, + }, + } + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := context.Background() + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo) + } + defer mockAssetRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + }) + + got, err := handler.GetAssetVersionHistory(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestGetAssetByVersion(t *testing.T) { + + var ( + assetID = uuid.NewString() + version = "0.2" + ast = asset.Asset{ + ID: assetID, + Version: version, + } + ) + + type TestCase struct { + Description string + Request *compassv1beta1.GetAssetByVersionRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.AssetRepository) + PostCheck func(resp *compassv1beta1.GetAssetByVersionResponse) error + } + + var testCases = []TestCase{ + { + Description: `should return invalid argument if asset id is not uuid`, + Request: &compassv1beta1.GetAssetByVersionRequest{ + Id: assetID, + Version: version, + }, + ExpectStatus: codes.InvalidArgument, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetByVersion(ctx, assetID, version).Return(asset.Asset{}, asset.InvalidError{AssetID: assetID}) + }, + }, + { + Description: `should return not found if asset doesn't exist`, + ExpectStatus: codes.NotFound, + Request: &compassv1beta1.GetAssetByVersionRequest{ + Id: assetID, + Version: version, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetByVersion(ctx, assetID, version).Return(asset.Asset{}, asset.NotFoundError{AssetID: assetID}) + }, + }, + { + Description: `should return internal server error if fetching fails`, + ExpectStatus: codes.Internal, + Request: &compassv1beta1.GetAssetByVersionRequest{ + Id: assetID, + Version: version, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetByVersion(ctx, assetID, version).Return(asset.Asset{}, errors.New("unknown error")) + }, + }, + { + Description: "should return status OK along with the asset if found", + ExpectStatus: codes.OK, + Request: &compassv1beta1.GetAssetByVersionRequest{ + Id: assetID, + Version: version, + }, + Setup: func(ctx context.Context, ar *mocks.AssetRepository) { + ar.EXPECT().GetByVersion(ctx, assetID, version).Return(ast, nil) + }, + PostCheck: func(resp *compassv1beta1.GetAssetByVersionResponse) error { + expected := &compassv1beta1.GetAssetByVersionResponse{ + Data: &compassv1beta1.Asset{ + Id: assetID, + Version: version, + }, + } + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := context.Background() + logger := log.NewNoop() + mockAssetRepo := new(mocks.AssetRepository) + if tc.Setup != nil { + tc.Setup(ctx, mockAssetRepo) + } + defer mockAssetRepo.AssertExpectations(t) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + AssetRepository: mockAssetRepo, + }) + + got, err := handler.GetAssetByVersion(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} diff --git a/api/v1beta1/comment.go b/api/v1beta1/comment.go index 26e809cd..cbe0fabd 100644 --- a/api/v1beta1/comment.go +++ b/api/v1beta1/comment.go @@ -10,7 +10,6 @@ import ( "github.com/odpf/columbus/user" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/emptypb" ) // CreateComment will create a new comment of a discussion @@ -111,7 +110,7 @@ func (h *Handler) GetComment(ctx context.Context, req *compassv1beta1.GetComment } // UpdateComment is an api to update a comment by discussion id -func (h *Handler) UpdateComment(ctx context.Context, req *compassv1beta1.UpdateCommentRequest) (*emptypb.Empty, error) { +func (h *Handler) UpdateComment(ctx context.Context, req *compassv1beta1.UpdateCommentRequest) (*compassv1beta1.UpdateCommentResponse, error) { userID := user.FromContext(ctx) if userID == "" { return nil, status.Error(codes.InvalidArgument, errMissingUserInfo.Error()) @@ -148,11 +147,11 @@ func (h *Handler) UpdateComment(ctx context.Context, req *compassv1beta1.UpdateC return nil, status.Error(codes.Internal, err.Error()) } - return &emptypb.Empty{}, nil + return &compassv1beta1.UpdateCommentResponse{}, nil } // DeleteComment is an api to delete a comment by discussion id -func (h *Handler) DeleteComment(ctx context.Context, req *compassv1beta1.DeleteCommentRequest) (*emptypb.Empty, error) { +func (h *Handler) DeleteComment(ctx context.Context, req *compassv1beta1.DeleteCommentRequest) (*compassv1beta1.DeleteCommentResponse, error) { userID := user.FromContext(ctx) if userID == "" { return nil, status.Error(codes.InvalidArgument, errMissingUserInfo.Error()) @@ -178,7 +177,7 @@ func (h *Handler) DeleteComment(ctx context.Context, req *compassv1beta1.DeleteC return nil, status.Error(codes.Internal, err.Error()) } - return &emptypb.Empty{}, nil + return &compassv1beta1.DeleteCommentResponse{}, nil } func (h *Handler) buildGetAllDiscussionsFilter(req *compassv1beta1.GetAllDiscussionsRequest) (discussion.Filter, error) { diff --git a/api/v1beta1/comment_test.go b/api/v1beta1/comment_test.go index bca7b68d..d2a14799 100644 --- a/api/v1beta1/comment_test.go +++ b/api/v1beta1/comment_test.go @@ -4,9 +4,9 @@ import ( "context" "errors" "fmt" - "reflect" "testing" + "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/odpf/columbus/api" compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" @@ -17,6 +17,7 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/testing/protocmp" ) func TestCreateComment(t *testing.T) { @@ -30,11 +31,11 @@ func TestCreateComment(t *testing.T) { ) type TestCase struct { - Description string - Request *compassv1beta1.CreateCommentRequest - StatusCode codes.Code - Result string - Setup func(context.Context, *mocks.DiscussionRepository) + Description string + Request *compassv1beta1.CreateCommentRequest + ExpectStatus codes.Code + Result string + Setup func(context.Context, *mocks.DiscussionRepository) } var testCases = []TestCase{ @@ -43,7 +44,7 @@ func TestCreateComment(t *testing.T) { Request: &compassv1beta1.CreateCommentRequest{ DiscussionId: discussionID, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid request if discussion_id is not integer", @@ -51,7 +52,7 @@ func TestCreateComment(t *testing.T) { DiscussionId: "test", Body: validRequest.Body, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid request if discussion_id is < 1", @@ -59,7 +60,7 @@ func TestCreateComment(t *testing.T) { DiscussionId: "0", Body: validRequest.Body, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return internal server error if the comment creation failed", @@ -67,7 +68,7 @@ func TestCreateComment(t *testing.T) { DiscussionId: validRequest.GetDiscussionId(), Body: validRequest.GetBody(), }, - StatusCode: codes.Internal, + ExpectStatus: codes.Internal, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { expectedErr := errors.New("unknown error") dr.EXPECT().CreateComment(ctx, mock.AnythingOfType("*discussion.Comment")).Return("", expectedErr) @@ -79,7 +80,7 @@ func TestCreateComment(t *testing.T) { DiscussionId: validRequest.GetDiscussionId(), Body: validRequest.GetBody(), }, - StatusCode: codes.OK, + ExpectStatus: codes.OK, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().CreateComment(ctx, mock.AnythingOfType("*discussion.Comment")).Return("", nil) }, @@ -103,8 +104,8 @@ func TestCreateComment(t *testing.T) { got, err := handler.CreateComment(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode.String(), code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) return } if got.GetId() != tc.Result { @@ -121,11 +122,11 @@ func TestGetAllComments(t *testing.T) { discussionID = "11111" ) type testCase struct { - Description string - Request *compassv1beta1.GetAllCommentsRequest - StatusCode codes.Code - Setup func(context.Context, *mocks.DiscussionRepository) - PostCheck func(resp *compassv1beta1.GetAllCommentsResponse) error + Description string + Request *compassv1beta1.GetAllCommentsRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscussionRepository) + PostCheck func(resp *compassv1beta1.GetAllCommentsResponse) error } var testCases = []testCase{ { @@ -133,21 +134,21 @@ func TestGetAllComments(t *testing.T) { Request: &compassv1beta1.GetAllCommentsRequest{ DiscussionId: "test", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: `should return invalid argument if discussion_id is < 1`, Request: &compassv1beta1.GetAllCommentsRequest{ DiscussionId: "0", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: `should return internal server error if fetching fails`, Request: &compassv1beta1.GetAllCommentsRequest{ DiscussionId: discussionID, }, - StatusCode: codes.Internal, + ExpectStatus: codes.Internal, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().GetAllComments(ctx, discussionID, discussion.Filter{ Type: "all", @@ -166,7 +167,7 @@ func TestGetAllComments(t *testing.T) { Size: 30, Offset: 50, }, - StatusCode: codes.OK, + ExpectStatus: codes.OK, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().GetAllComments(ctx, discussionID, discussion.Filter{ Type: "all", @@ -183,7 +184,7 @@ func TestGetAllComments(t *testing.T) { Request: &compassv1beta1.GetAllCommentsRequest{ DiscussionId: discussionID, }, - StatusCode: codes.OK, + ExpectStatus: codes.OK, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().GetAllComments(ctx, discussionID, discussion.Filter{ Type: "all", @@ -196,17 +197,15 @@ func TestGetAllComments(t *testing.T) { }, nil) }, PostCheck: func(resp *compassv1beta1.GetAllCommentsResponse) error { - expected := []discussion.Comment{ - {ID: "1122"}, - {ID: "2233"}, + expected := &compassv1beta1.GetAllCommentsResponse{ + Data: []*compassv1beta1.Comment{ + {Id: "1122"}, + {Id: "2233"}, + }, } - var actual []discussion.Comment - for _, cmt := range resp.GetData() { - actual = append(actual, discussion.NewCommentFromProto(cmt)) - } - if reflect.DeepEqual(actual, expected) == false { - return fmt.Errorf("expected payload to be to be %+v, was %+v", expected, actual) + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) } return nil }, @@ -229,8 +228,8 @@ func TestGetAllComments(t *testing.T) { got, err := handler.GetAllComments(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode.String(), code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) return } if tc.PostCheck != nil { @@ -250,16 +249,16 @@ func TestGetComment(t *testing.T) { commentID = "11" ) type testCase struct { - Description string - Request *compassv1beta1.GetCommentRequest - StatusCode codes.Code - Setup func(context.Context, *mocks.DiscussionRepository) - PostCheck func(resp *compassv1beta1.GetCommentResponse) error + Description string + Request *compassv1beta1.GetCommentRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscussionRepository) + PostCheck func(resp *compassv1beta1.GetCommentResponse) error } var testCases = []testCase{ { - Description: `should return internal server error if fetching fails`, - StatusCode: codes.Internal, + Description: `should return internal server error if fetching fails`, + ExpectStatus: codes.Internal, Request: &compassv1beta1.GetCommentRequest{ Id: commentID, DiscussionId: discussionID, @@ -269,40 +268,40 @@ func TestGetComment(t *testing.T) { }, }, { - Description: `should return invalid argument if discussion id not integer`, - StatusCode: codes.InvalidArgument, + Description: `should return invalid argument if discussion id not integer`, + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.GetCommentRequest{ Id: commentID, DiscussionId: "random", }, }, { - Description: `should return invalid argument if discussion id < 0`, - StatusCode: codes.InvalidArgument, + Description: `should return invalid argument if discussion id < 0`, + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.GetCommentRequest{ Id: commentID, DiscussionId: "-1", }, }, { - Description: `should return invalid argument if comment id not integer`, - StatusCode: codes.InvalidArgument, + Description: `should return invalid argument if comment id not integer`, + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.GetCommentRequest{ Id: "random", DiscussionId: discussionID, }, }, { - Description: `should return invalid argument if comment id < 0`, - StatusCode: codes.InvalidArgument, + Description: `should return invalid argument if comment id < 0`, + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.GetCommentRequest{ Id: "-1", DiscussionId: discussionID, }, }, { - Description: `should return Not Found if comment or discussion not found`, - StatusCode: codes.NotFound, + Description: `should return Not Found if comment or discussion not found`, + ExpectStatus: codes.NotFound, Request: &compassv1beta1.GetCommentRequest{ Id: commentID, DiscussionId: discussionID, @@ -312,8 +311,8 @@ func TestGetComment(t *testing.T) { }, }, { - Description: "should return status OK along with comment of a discussion", - StatusCode: codes.OK, + Description: "should return status OK along with comment of a discussion", + ExpectStatus: codes.OK, Request: &compassv1beta1.GetCommentRequest{ Id: commentID, DiscussionId: discussionID, @@ -321,15 +320,16 @@ func TestGetComment(t *testing.T) { Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().GetComment(ctx, commentID, discussionID).Return(discussion.Comment{ID: commentID, DiscussionID: discussionID}, nil) }, - PostCheck: func(r *compassv1beta1.GetCommentResponse) error { - expected := discussion.Comment{ - ID: commentID, - DiscussionID: discussionID, + PostCheck: func(resp *compassv1beta1.GetCommentResponse) error { + expected := &compassv1beta1.GetCommentResponse{ + Data: &compassv1beta1.Comment{ + Id: commentID, + DiscussionId: discussionID, + }, } - actual := discussion.NewCommentFromProto(r.GetData()) - if reflect.DeepEqual(actual, expected) == false { - return fmt.Errorf("expected payload to be to be %+v, was %+v", expected, actual) + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) } return nil }, @@ -352,8 +352,8 @@ func TestGetComment(t *testing.T) { got, err := handler.GetComment(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode.String(), code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) return } if tc.PostCheck != nil { @@ -378,10 +378,10 @@ func TestUpdateComment(t *testing.T) { Body: "lorem ipsum", } testCases := []struct { - Description string - Request *compassv1beta1.UpdateCommentRequest - StatusCode codes.Code - Setup func(context.Context, *mocks.DiscussionRepository) + Description string + Request *compassv1beta1.UpdateCommentRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscussionRepository) }{ { Description: "discussion id is not integer return bad request", @@ -389,7 +389,7 @@ func TestUpdateComment(t *testing.T) { Id: commentID, DiscussionId: "random", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "discussion id is < 0 return bad request", @@ -397,7 +397,7 @@ func TestUpdateComment(t *testing.T) { Id: commentID, DiscussionId: "-1", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "comment id is not integer return bad request", @@ -405,7 +405,7 @@ func TestUpdateComment(t *testing.T) { Id: "random", DiscussionId: discussionID, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "comment id is < 0 return bad request", @@ -413,7 +413,7 @@ func TestUpdateComment(t *testing.T) { Id: "-1", DiscussionId: discussionID, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "empty object return bad request", @@ -421,7 +421,7 @@ func TestUpdateComment(t *testing.T) { Id: commentID, DiscussionId: discussionID, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "empty body return bad request", @@ -430,12 +430,12 @@ func TestUpdateComment(t *testing.T) { DiscussionId: discussionID, Body: "", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { - Description: "should return internal server error if the update comment failed", - Request: validRequest, - StatusCode: codes.Internal, + Description: "should return internal server error if the update comment failed", + Request: validRequest, + ExpectStatus: codes.Internal, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { cmt := &discussion.Comment{ ID: validRequest.Id, @@ -448,9 +448,9 @@ func TestUpdateComment(t *testing.T) { }, }, { - Description: "should return Not Found if the discussion id or comment id not found", - Request: validRequest, - StatusCode: codes.NotFound, + Description: "should return Not Found if the discussion id or comment id not found", + Request: validRequest, + ExpectStatus: codes.NotFound, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { cmt := &discussion.Comment{ ID: validRequest.Id, @@ -463,9 +463,9 @@ func TestUpdateComment(t *testing.T) { }, }, { - Description: "should return status OK if the comment is successfully updated", - Request: validRequest, - StatusCode: codes.OK, + Description: "should return status OK if the comment is successfully updated", + Request: validRequest, + ExpectStatus: codes.OK, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { cmt := &discussion.Comment{ ID: validRequest.Id, @@ -495,8 +495,8 @@ func TestUpdateComment(t *testing.T) { _, err := handler.UpdateComment(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode, code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus, code.String()) return } }) @@ -511,46 +511,46 @@ func TestDeleteComment(t *testing.T) { ) testCases := []struct { - Description string - Request *compassv1beta1.DeleteCommentRequest - StatusCode codes.Code - Setup func(context.Context, *mocks.DiscussionRepository) + Description string + Request *compassv1beta1.DeleteCommentRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscussionRepository) }{ { - Description: "discussion id is not integer return bad request", - StatusCode: codes.InvalidArgument, + Description: "discussion id is not integer return bad request", + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.DeleteCommentRequest{ Id: commentID, DiscussionId: "random", }, }, { - Description: "discussion id is < 0 return bad request", - StatusCode: codes.InvalidArgument, + Description: "discussion id is < 0 return bad request", + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.DeleteCommentRequest{ Id: commentID, DiscussionId: "-1", }, }, { - Description: "comment id is not integer return bad request", - StatusCode: codes.InvalidArgument, + Description: "comment id is not integer return bad request", + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.DeleteCommentRequest{ Id: "random", DiscussionId: discussionID, }, }, { - Description: "comment id is < 0 return bad request", - StatusCode: codes.InvalidArgument, + Description: "comment id is < 0 return bad request", + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.DeleteCommentRequest{ Id: "-1", DiscussionId: discussionID, }, }, { - Description: "should return internal server error if the delete comment failed", - StatusCode: codes.Internal, + Description: "should return internal server error if the delete comment failed", + ExpectStatus: codes.Internal, Request: &compassv1beta1.DeleteCommentRequest{ Id: commentID, DiscussionId: discussionID, @@ -561,8 +561,8 @@ func TestDeleteComment(t *testing.T) { }, }, { - Description: "should return invalid argument if the discussion id or comment id not found", - StatusCode: codes.NotFound, + Description: "should return invalid argument if the discussion id or comment id not found", + ExpectStatus: codes.NotFound, Request: &compassv1beta1.DeleteCommentRequest{ Id: commentID, DiscussionId: discussionID, @@ -573,8 +573,8 @@ func TestDeleteComment(t *testing.T) { }, }, { - Description: "should return OK if the comment is successfully deleted", - StatusCode: codes.OK, + Description: "should return OK if the comment is successfully deleted", + ExpectStatus: codes.OK, Request: &compassv1beta1.DeleteCommentRequest{ Id: commentID, DiscussionId: discussionID, @@ -602,8 +602,8 @@ func TestDeleteComment(t *testing.T) { _, err := handler.DeleteComment(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode.String(), code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) return } }) diff --git a/api/v1beta1/discussion.go b/api/v1beta1/discussion.go index 58d2b540..d69fc89c 100644 --- a/api/v1beta1/discussion.go +++ b/api/v1beta1/discussion.go @@ -10,7 +10,6 @@ import ( "github.com/odpf/columbus/user" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/emptypb" ) // GetAll returns all discussion based on filter in query params @@ -108,7 +107,7 @@ func (h *Handler) GetDiscussion(ctx context.Context, req *compassv1beta1.GetDisc // Patch updates a specific field in discussion // empty array in assets,labels,assignees will be considered // and clear all assets,labels,assignees from the discussion -func (h *Handler) PatchDiscussion(ctx context.Context, req *compassv1beta1.PatchDiscussionRequest) (*emptypb.Empty, error) { +func (h *Handler) PatchDiscussion(ctx context.Context, req *compassv1beta1.PatchDiscussionRequest) (*compassv1beta1.PatchDiscussionResponse, error) { userID := user.FromContext(ctx) if userID == "" { return nil, status.Error(codes.InvalidArgument, errMissingUserInfo.Error()) @@ -128,9 +127,9 @@ func (h *Handler) PatchDiscussion(ctx context.Context, req *compassv1beta1.Patch Body: req.GetBody(), Type: discussion.Type(req.GetType()), State: discussion.State(req.GetState()), - Labels: req.Labels, - Assets: req.Assets, - Assignees: req.Assignees, + Labels: req.GetLabels(), + Assets: req.GetAssets(), + Assignees: req.GetAssignees(), } if isEmpty := dsc.IsEmpty(); isEmpty { @@ -153,7 +152,7 @@ func (h *Handler) PatchDiscussion(ctx context.Context, req *compassv1beta1.Patch return nil, status.Error(codes.Internal, err.Error()) } - return &emptypb.Empty{}, nil + return &compassv1beta1.PatchDiscussionResponse{}, nil } func (h *Handler) validateIDInteger(id string) error { diff --git a/api/v1beta1/discussion_test.go b/api/v1beta1/discussion_test.go index ff4ec096..4adaa511 100644 --- a/api/v1beta1/discussion_test.go +++ b/api/v1beta1/discussion_test.go @@ -4,9 +4,9 @@ import ( "context" "errors" "fmt" - "reflect" "testing" + "github.com/google/go-cmp/cmp" "github.com/google/uuid" "github.com/odpf/columbus/api" compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" @@ -18,16 +18,17 @@ import ( "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/testing/protocmp" ) func TestGetAllDiscussions(t *testing.T) { var userID = uuid.NewString() type testCase struct { - Description string - Request *compassv1beta1.GetAllDiscussionsRequest - Setup func(context.Context, *mocks.DiscussionRepository) - StatusCode codes.Code - PostCheck func(resp *compassv1beta1.GetAllDiscussionsResponse) error + Description string + Request *compassv1beta1.GetAllDiscussionsRequest + Setup func(context.Context, *mocks.DiscussionRepository) + ExpectStatus codes.Code + PostCheck func(resp *compassv1beta1.GetAllDiscussionsResponse) error } var testCases = []testCase{ @@ -41,7 +42,7 @@ func TestGetAllDiscussions(t *testing.T) { SortDirection: "desc", }).Return([]discussion.Discussion{}, errors.New("unknown error")) }, - StatusCode: codes.Internal, + ExpectStatus: codes.Internal, }, { Description: `should parse querystring to get filter`, @@ -71,7 +72,7 @@ func TestGetAllDiscussions(t *testing.T) { Offset: 50, }).Return([]discussion.Discussion{}, nil) }, - StatusCode: codes.OK, + ExpectStatus: codes.OK, }, { Description: "should return status OK along with list of discussions", @@ -87,22 +88,19 @@ func TestGetAllDiscussions(t *testing.T) { }, nil) }, PostCheck: func(resp *compassv1beta1.GetAllDiscussionsResponse) error { - expected := []discussion.Discussion{ - {ID: "1122"}, - {ID: "2233"}, - } - - actual := []discussion.Discussion{} - for _, dsc := range resp.GetData() { - actual = append(actual, discussion.NewFromProto(dsc)) + expected := &compassv1beta1.GetAllDiscussionsResponse{ + Data: []*compassv1beta1.Discussion{ + {Id: "1122"}, + {Id: "2233"}, + }, } - if reflect.DeepEqual(actual, expected) == false { - return fmt.Errorf("expected payload to be to be %+v, was %+v", expected, actual) + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) } return nil }, - StatusCode: codes.OK, + ExpectStatus: codes.OK, }, } @@ -119,8 +117,8 @@ func TestGetAllDiscussions(t *testing.T) { }) got, err := handler.GetAllDiscussions(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", code.String(), tc.StatusCode.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", code.String(), tc.ExpectStatus.String()) return } if tc.PostCheck != nil { @@ -142,18 +140,18 @@ func TestCreateDiscussion(t *testing.T) { } type testCase struct { - Description string - Request *compassv1beta1.CreateDiscussionRequest - Setup func(context.Context, *mocks.DiscussionRepository) - StatusCode codes.Code + Description string + Request *compassv1beta1.CreateDiscussionRequest + Setup func(context.Context, *mocks.DiscussionRepository) + ExpectStatus codes.Code } var testCases = []testCase{ { - Description: "should return Invalid Argument if empty object", - Request: &compassv1beta1.CreateDiscussionRequest{}, - StatusCode: codes.InvalidArgument, + Description: "should return Invalid Argument if empty object", + Request: &compassv1beta1.CreateDiscussionRequest{}, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return Invalid Argument if empty title", @@ -161,7 +159,7 @@ func TestCreateDiscussion(t *testing.T) { Body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", Type: discussion.TypeQAndA.String(), }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return Invalid Argument if no body", @@ -169,7 +167,7 @@ func TestCreateDiscussion(t *testing.T) { Title: "Lorem Ipsum", Type: discussion.TypeQAndA.String(), }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return Invalid Argument if empty body", @@ -178,7 +176,7 @@ func TestCreateDiscussion(t *testing.T) { Body: "", Type: discussion.TypeQAndA.String(), }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return Invalid Argument if empty type", @@ -187,7 +185,7 @@ func TestCreateDiscussion(t *testing.T) { Body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", Type: "", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return Invalid Argument if wrong type", @@ -196,20 +194,20 @@ func TestCreateDiscussion(t *testing.T) { Body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", Type: "wrongtype", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { - Description: "should return internal server error if the discussion creation fails", - Request: validRequest, - StatusCode: codes.Internal, + Description: "should return internal server error if the discussion creation fails", + Request: validRequest, + ExpectStatus: codes.Internal, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().Create(ctx, mock.AnythingOfType("*discussion.Discussion")).Return("", errors.New("some error")) }, }, { - Description: "should return OK and discussion ID if the discussion is successfully created", - Request: validRequest, - StatusCode: codes.OK, + Description: "should return OK and discussion ID if the discussion is successfully created", + Request: validRequest, + ExpectStatus: codes.OK, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dsc := discussion.Discussion{ Title: "Lorem Ipsum", @@ -244,8 +242,8 @@ func TestCreateDiscussion(t *testing.T) { _, err := handler.CreateDiscussion(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode.String(), code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) return } }) @@ -259,17 +257,17 @@ func TestGetDiscussion(t *testing.T) { ) type TestCase struct { - Description string - Request *compassv1beta1.GetDiscussionRequest - Setup func(context.Context, *mocks.DiscussionRepository) - StatusCode codes.Code - PostCheck func(resp *compassv1beta1.GetDiscussionResponse) error + Description string + Request *compassv1beta1.GetDiscussionRequest + Setup func(context.Context, *mocks.DiscussionRepository) + ExpectStatus codes.Code + PostCheck func(resp *compassv1beta1.GetDiscussionResponse) error } var testCases = []TestCase{ { - Description: `should return internal server error if fetching fails`, - StatusCode: codes.Internal, + Description: `should return internal server error if fetching fails`, + ExpectStatus: codes.Internal, Request: &compassv1beta1.GetDiscussionRequest{ Id: discussionID, }, @@ -278,22 +276,22 @@ func TestGetDiscussion(t *testing.T) { }, }, { - Description: `should return invalid argument if discussion id not integer`, - StatusCode: codes.InvalidArgument, + Description: `should return invalid argument if discussion id not integer`, + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.GetDiscussionRequest{ Id: "random", }, }, { - Description: `should return invalid argument if discussion id < 0`, - StatusCode: codes.InvalidArgument, + Description: `should return invalid argument if discussion id < 0`, + ExpectStatus: codes.InvalidArgument, Request: &compassv1beta1.GetDiscussionRequest{ Id: "-1", }, }, { - Description: `should return not found if discussion not found`, - StatusCode: codes.NotFound, + Description: `should return not found if discussion not found`, + ExpectStatus: codes.NotFound, Request: &compassv1beta1.GetDiscussionRequest{ Id: discussionID, }, @@ -302,21 +300,23 @@ func TestGetDiscussion(t *testing.T) { }, }, { - Description: "should return status OK along with discussions", - StatusCode: codes.OK, + Description: "should return status OK along with discussions", + ExpectStatus: codes.OK, Request: &compassv1beta1.GetDiscussionRequest{ Id: discussionID, }, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().Get(ctx, discussionID).Return(discussion.Discussion{ID: discussionID}, nil) }, - PostCheck: func(r *compassv1beta1.GetDiscussionResponse) error { - expected := discussion.Discussion{ - ID: discussionID, + PostCheck: func(resp *compassv1beta1.GetDiscussionResponse) error { + expected := &compassv1beta1.GetDiscussionResponse{ + Data: &compassv1beta1.Discussion{ + Id: discussionID, + }, } - actual := discussion.NewFromProto(r.GetData()) - if reflect.DeepEqual(actual, expected) == false { - return fmt.Errorf("expected payload to be to be %+v, was %+v", expected, actual) + + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) } return nil }, @@ -339,8 +339,8 @@ func TestGetDiscussion(t *testing.T) { }) got, err := handler.GetDiscussion(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", code.String(), tc.StatusCode.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", code.String(), tc.ExpectStatus.String()) return } if tc.PostCheck != nil { @@ -362,10 +362,10 @@ func TestPatchDiscussion(t *testing.T) { var validRequest = &compassv1beta1.PatchDiscussionRequest{Id: discussionID, Title: "lorem ipsum"} type TestCase struct { - Description string - Request *compassv1beta1.PatchDiscussionRequest - StatusCode codes.Code - Setup func(context.Context, *mocks.DiscussionRepository) + Description string + Request *compassv1beta1.PatchDiscussionRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscussionRepository) } testCases := []TestCase{ @@ -374,21 +374,21 @@ func TestPatchDiscussion(t *testing.T) { Request: &compassv1beta1.PatchDiscussionRequest{ Id: "random", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if discussion id is < 0 return invalid argument", Request: &compassv1beta1.PatchDiscussionRequest{ Id: "-1", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if empty object return invalid argument", Request: &compassv1beta1.PatchDiscussionRequest{ Id: discussionID, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if invalid type return invalid argument", @@ -396,7 +396,7 @@ func TestPatchDiscussion(t *testing.T) { Id: discussionID, Type: "random", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if invalid state return invalid argument", @@ -404,7 +404,7 @@ func TestPatchDiscussion(t *testing.T) { Id: discussionID, State: "random", }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if assignees more than limit should return invalid argument", @@ -412,7 +412,7 @@ func TestPatchDiscussion(t *testing.T) { Id: discussionID, Assignees: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if assets more than limit should return invalid argument", @@ -420,7 +420,7 @@ func TestPatchDiscussion(t *testing.T) { Id: discussionID, Assets: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { Description: "should return invalid argument if labels more than limit should return invalid argument", @@ -428,30 +428,30 @@ func TestPatchDiscussion(t *testing.T) { Id: discussionID, Labels: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, }, - StatusCode: codes.InvalidArgument, + ExpectStatus: codes.InvalidArgument, }, { - Description: "should return internal server error if the discussion patch fails", - Request: validRequest, - StatusCode: codes.Internal, + Description: "should return internal server error if the discussion patch fails", + Request: validRequest, + ExpectStatus: codes.Internal, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { expectedErr := errors.New("unknown error") dr.EXPECT().Patch(ctx, mock.AnythingOfType("*discussion.Discussion")).Return(expectedErr) }, }, { - Description: "should return Not Found if the discussion id is invalid", - Request: validRequest, - StatusCode: codes.NotFound, + Description: "should return Not Found if the discussion id is invalid", + Request: validRequest, + ExpectStatus: codes.NotFound, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { expectedErr := discussion.NotFoundError{DiscussionID: discussionID} dr.EXPECT().Patch(ctx, mock.AnythingOfType("*discussion.Discussion")).Return(expectedErr) }, }, { - Description: "should return OK if the discussion is successfully patched", - Request: validRequest, - StatusCode: codes.OK, + Description: "should return OK if the discussion is successfully patched", + Request: validRequest, + ExpectStatus: codes.OK, Setup: func(ctx context.Context, dr *mocks.DiscussionRepository) { dr.EXPECT().Patch(ctx, mock.AnythingOfType("*discussion.Discussion")).Return(nil) }, @@ -475,8 +475,8 @@ func TestPatchDiscussion(t *testing.T) { _, err := handler.PatchDiscussion(ctx, tc.Request) code := status.Code(err) - if code != tc.StatusCode { - t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.StatusCode.String(), code.String()) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) return } }) diff --git a/api/v1beta1/handler.go b/api/v1beta1/handler.go index d426f39f..7ecef7be 100644 --- a/api/v1beta1/handler.go +++ b/api/v1beta1/handler.go @@ -1,6 +1,10 @@ package v1beta1 import ( + "fmt" + "net/http" + "time" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" "github.com/odpf/columbus/asset" "github.com/odpf/columbus/discovery" @@ -10,17 +14,33 @@ import ( "github.com/odpf/columbus/tag" "github.com/odpf/columbus/user" "github.com/odpf/salt/log" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) type Handler struct { compassv1beta1.UnimplementedCompassServiceServer Logger log.Logger AssetRepository asset.Repository - DiscoveryRepository discovery.Repository TagService *tag.Service TagTemplateService *tag.TemplateService UserService *user.Service StarRepository star.Repository LineageRepository lineage.Repository DiscussionRepository discussion.Repository + DiscoveryRepository discovery.Repository + + // deprecated + DiscoveryService *discovery.Service +} + +func internalServerError(logger log.Logger, msg string) error { + ref := time.Now().Unix() + + logger.Error(msg, "ref", ref) + return status.Error(codes.Internal, fmt.Sprintf( + "%s - ref (%d)", + http.StatusText(http.StatusInternalServerError), + ref, + )) } diff --git a/api/v1beta1/handler_test.go b/api/v1beta1/handler_test.go index d540e894..046438fe 100644 --- a/api/v1beta1/handler_test.go +++ b/api/v1beta1/handler_test.go @@ -1 +1,41 @@ -package v1beta1 +package v1beta1_test + +// import ( +// "github.com/grpc-ecosystem/grpc-gateway/runtime" +// "github.com/odpf/columbus/api" +// "github.com/odpf/columbus/asset" +// "github.com/odpf/columbus/discovery" +// "github.com/odpf/columbus/discussion" +// "github.com/odpf/columbus/lib/mocks" +// "github.com/odpf/columbus/lineage" +// "github.com/odpf/salt/log" +// ) + +// type MockDependencies struct { +// AssetRepository asset.Repository +// DiscoveryRepository discovery.Repository +// LineageRepository lineage.Repository +// DiscussionRepository discussion.Repository +// } + +// func setup() { +// mockDeps := &MockDependencies{ +// AssetRepository: &mocks.AssetRepository{}, +// DiscoveryRepository: &mocks.DiscoveryRepository{}, +// LineageRepository: &mocks.LineageRepository{}, +// DiscussionRepository: &mocks.DiscussionRepository{}, +// } +// handlers := api.NewHandlers(log.NewNoop(), &api.Dependencies{ +// Logger: log.NewNoop(), +// AssetRepository: mockDeps.AssetRepository, +// DiscoveryRepository: mockDeps.DiscoveryRepository, +// LineageRepository: mockDeps.LineageRepository, +// DiscussionRepository: mockDeps.DiscussionRepository, +// }) +// mux := runtime.NewServeMux() +// mux.RegisterService( +// &compassv1beta1.CompassService_ServiceDesc, +// handlers.GRPCHandler, +// ) + +// } diff --git a/api/v1beta1/lineage.go b/api/v1beta1/lineage.go new file mode 100644 index 00000000..e28ca0c9 --- /dev/null +++ b/api/v1beta1/lineage.go @@ -0,0 +1,28 @@ +package v1beta1 + +import ( + "context" + + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/lineage" +) + +func (h *Handler) GetGraph(ctx context.Context, req *compassv1beta1.GetGraphRequest) (*compassv1beta1.GetGraphResponse, error) { + graph, err := h.LineageRepository.GetGraph(ctx, lineage.Node{URN: req.GetUrn()}) + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + + graphPB := []*compassv1beta1.LineageEdge{} + for _, edge := range graph { + edgePB, err := edge.ToProto() + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + graphPB = append(graphPB, edgePB) + } + + return &compassv1beta1.GetGraphResponse{ + Data: graphPB, + }, nil +} diff --git a/api/v1beta1/lineage_test.go b/api/v1beta1/lineage_test.go new file mode 100644 index 00000000..eea5957f --- /dev/null +++ b/api/v1beta1/lineage_test.go @@ -0,0 +1,70 @@ +package v1beta1_test + +import ( + "context" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/odpf/columbus/api" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/lib/mocks" + "github.com/odpf/columbus/lineage" + "github.com/odpf/salt/log" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/testing/protocmp" +) + +func TestGetLineageGraph(t *testing.T) { + + t.Run("get Lineage", func(t *testing.T) { + t.Run("should return a graph containing the requested resource, along with it's related resources", func(t *testing.T) { + ctx := context.Background() + logger := log.NewNoop() + node := lineage.Node{ + URN: "job-1", + } + var graph = lineage.Graph{ + {Source: "job-1", Target: "table-2"}, + {Source: "table-2", Target: "table-31"}, + {Source: "table-31", Target: "dashboard-30"}, + } + lr := new(mocks.LineageRepository) + lr.EXPECT().GetGraph(ctx, node).Return(graph, nil) + + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + LineageRepository: lr, + }) + + got, err := handler.GetGraph(ctx, &compassv1beta1.GetGraphRequest{ + Urn: node.URN, + }) + code := status.Code(err) + if code != codes.OK { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", codes.OK, code.String()) + return + } + + expected := &compassv1beta1.GetGraphResponse{ + Data: []*compassv1beta1.LineageEdge{ + { + Source: "job-1", + Target: "table-2", + }, + { + Source: "table-2", + Target: "table-31", + }, + { + Source: "table-31", + Target: "dashboard-30", + }, + }, + } + if diff := cmp.Diff(got, expected, protocmp.Transform()); diff != "" { + t.Errorf("expected response to be %+v, was %+v", expected, got) + } + }) + + }) +} diff --git a/api/v1beta1/search.go b/api/v1beta1/search.go new file mode 100644 index 00000000..be5bc805 --- /dev/null +++ b/api/v1beta1/search.go @@ -0,0 +1,106 @@ +package v1beta1 + +import ( + "context" + "strings" + + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/discovery" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +const ( + whiteListQueryParamKey = "type" +) + +func (h *Handler) SearchAssets(ctx context.Context, req *compassv1beta1.SearchAssetsRequest) (*compassv1beta1.SearchAssetsResponse, error) { + text := strings.TrimSpace(req.GetText()) + if text == "" { + return nil, status.Error(codes.InvalidArgument, "'text' must be specified") + } + + cfg := discovery.SearchConfig{ + Text: text, + MaxResults: int(req.GetSize()), + Filters: filterConfigFromValues(req.GetFilter()), + RankBy: req.GetRankby(), + Queries: req.GetQuery(), + TypeWhiteList: parseTypeWhiteList(req.GetFilter()), + } + + results, err := h.DiscoveryService.Search(ctx, cfg) + if err != nil { + return nil, internalServerError(h.Logger, "error searching records") + } + + assetsPB := []*compassv1beta1.Asset{} + for _, sr := range results { + assetPB, err := sr.ToAsset().ToProto() + if err != nil { + return nil, internalServerError(h.Logger, err.Error()) + } + assetsPB = append(assetsPB, assetPB) + } + + return &compassv1beta1.SearchAssetsResponse{ + Data: assetsPB, + }, nil +} + +func (h *Handler) SuggestAssets(ctx context.Context, req *compassv1beta1.SuggestAssetsRequest) (*compassv1beta1.SuggestAssetsResponse, error) { + text := strings.TrimSpace(req.GetText()) + if text == "" { + return nil, status.Error(codes.InvalidArgument, "'text' must be specified") + } + + cfg := discovery.SearchConfig{ + Text: text, + MaxResults: int(req.GetSize()), + Filters: filterConfigFromValues(req.GetFilter()), + RankBy: req.GetRankby(), + Queries: queryConfigFromValues(req.GetQuery()), + TypeWhiteList: parseTypeWhiteList(req.GetFilter()), + } + + suggestions, err := h.DiscoveryService.Suggest(ctx, cfg) + if err != nil { + return nil, internalServerError(h.Logger, "error building suggestions") + } + + return &compassv1beta1.SuggestAssetsResponse{ + Data: suggestions, + }, nil +} + +func filterConfigFromValues(fltMap map[string]string) map[string][]string { + var filter = make(map[string][]string) + for key, value := range fltMap { + // filters are of form "filter[{field}]", apart from "filter[type]", which is used + // for building the type whitelist. + if key == whiteListQueryParamKey { + continue + } + + var filterValues []string + filterValues = append(filterValues, strings.Split(value, ",")...) + + filter[key] = filterValues + } + return filter +} + +func queryConfigFromValues(queryMap map[string]string) map[string]string { + var query = make(map[string]string) + if len(queryMap) > 0 { + query = queryMap + } + return query +} + +func parseTypeWhiteList(fltMap map[string]string) (types []string) { + if val, ok := fltMap[whiteListQueryParamKey]; ok { + types = append(types, strings.Split(val, ",")...) + } + return +} diff --git a/api/v1beta1/search_test.go b/api/v1beta1/search_test.go new file mode 100644 index 00000000..6f38aa1a --- /dev/null +++ b/api/v1beta1/search_test.go @@ -0,0 +1,365 @@ +package v1beta1_test + +import ( + "context" + "fmt" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/google/uuid" + "github.com/odpf/columbus/api" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/discovery" + "github.com/odpf/columbus/lib/mocks" + "github.com/odpf/columbus/user" + "github.com/odpf/salt/log" + "github.com/stretchr/testify/mock" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/structpb" +) + +func TestSearch(t *testing.T) { + var userID = uuid.NewString() + type testCase struct { + Description string + Request *compassv1beta1.SearchAssetsRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscoveryRecordSearcher) + PostCheck func(resp *compassv1beta1.SearchAssetsResponse) error + } + + var testCases = []testCase{ + { + Description: "should return invalid argument if 'text' parameter is empty or missing", + ExpectStatus: codes.InvalidArgument, + Request: &compassv1beta1.SearchAssetsRequest{}, + }, + { + Description: "should report internal serverif record searcher fails", + Request: &compassv1beta1.SearchAssetsRequest{ + Text: "test", + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + err := fmt.Errorf("service unavailable") + drs.EXPECT().Search(ctx, mock.AnythingOfType("discovery.SearchConfig")). + Return([]discovery.SearchResult{}, err) + }, + ExpectStatus: codes.Internal, + }, + { + Description: "should pass filter to search config format", + Request: &compassv1beta1.SearchAssetsRequest{ + Text: "resource", + Filter: map[string]string{ + "data.landscape": "th", + "type": "topic", + "service": "kafka,rabbitmq", + }, + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + + cfg := discovery.SearchConfig{ + Text: "resource", + TypeWhiteList: []string{"topic"}, + Filters: map[string][]string{ + "service": {"kafka", "rabbitmq"}, + "data.landscape": {"th"}, + }, + } + + drs.EXPECT().Search(ctx, cfg).Return([]discovery.SearchResult{}, nil) + }, + }, + { + Description: "should pass queries to search config format", + Request: &compassv1beta1.SearchAssetsRequest{ + Text: "resource", + Filter: map[string]string{ + "data.landscape": "th", + "type": "topic", + "service": "kafka,rabbitmq", + }, + Query: map[string]string{ + "data.columns.name": "timestamp", + "owners.email": "john.doe@email.com", + }, + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + + cfg := discovery.SearchConfig{ + Text: "resource", + TypeWhiteList: []string{"topic"}, + Filters: map[string][]string{ + "service": {"kafka", "rabbitmq"}, + "data.landscape": {"th"}, + }, + Queries: map[string]string{ + "data.columns.name": "timestamp", + "owners.email": "john.doe@email.com", + }, + } + + drs.EXPECT().Search(ctx, cfg).Return([]discovery.SearchResult{}, nil) + }, + }, + { + Description: "should return the matched documents", + Request: &compassv1beta1.SearchAssetsRequest{ + Text: "test", + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + + cfg := discovery.SearchConfig{ + Text: "test", + Filters: make(map[string][]string), + Queries: map[string]string(nil), + } + response := []discovery.SearchResult{ + { + Type: "test", + ID: "test-resource", + Description: "some description", + Service: "test-service", + Labels: map[string]string{ + "entity": "odpf", + "landscape": "id", + }, + }, + } + drs.EXPECT().Search(ctx, cfg).Return(response, nil) + }, + PostCheck: func(resp *compassv1beta1.SearchAssetsResponse) error { + expectedLabels, err := structpb.NewStruct( + map[string]interface{}{ + "entity": "odpf", + "landscape": "id", + }, + ) + if err != nil { + return err + } + expected := &compassv1beta1.SearchAssetsResponse{ + Data: []*compassv1beta1.Asset{ + { + Id: "test-resource", + Description: "some description", + Service: "test-service", + Type: "test", + Labels: expectedLabels, + }, + }, + } + + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + { + Description: "should return the requested number of assets", + Request: &compassv1beta1.SearchAssetsRequest{ + Text: "resource", + Size: 10, + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + + cfg := discovery.SearchConfig{ + Text: "resource", + MaxResults: 10, + Filters: make(map[string][]string), + Queries: map[string]string(nil), + } + + var results []discovery.SearchResult + for i := 0; i < cfg.MaxResults; i++ { + urn := fmt.Sprintf("resource-%d", i+1) + name := fmt.Sprintf("resource %d", i+1) + r := discovery.SearchResult{ + ID: urn, + Type: "table", + Description: name, + Service: "kafka", + Labels: map[string]string{ + "landscape": "id", + "entity": "odpf", + }, + } + + results = append(results, r) + } + + drs.EXPECT().Search(ctx, cfg).Return(results, nil) + }, + PostCheck: func(resp *compassv1beta1.SearchAssetsResponse) error { + expectedSize := 10 + actualSize := len(resp.Data) + if expectedSize != actualSize { + return fmt.Errorf("expected search request to return %d results, returned %d results instead", expectedSize, actualSize) + } + return nil + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockDiscovery := new(mocks.DiscoveryRecordSearcher) + if tc.Setup != nil { + tc.Setup(ctx, mockDiscovery) + } + defer mockDiscovery.AssertExpectations(t) + + discoveryService := discovery.NewService(nil, mockDiscovery) + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + DiscoveryService: discoveryService, + }) + + got, err := handler.SearchAssets(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} + +func TestSuggest(t *testing.T) { + var userID = uuid.NewString() + type testCase struct { + Description string + Request *compassv1beta1.SuggestAssetsRequest + ExpectStatus codes.Code + Setup func(context.Context, *mocks.DiscoveryRecordSearcher) + PostCheck func(resp *compassv1beta1.SuggestAssetsResponse) error + } + + var testCases = []testCase{ + { + Description: "should return invalid arguments if 'text' parameter is empty or missing", + ExpectStatus: codes.InvalidArgument, + Request: &compassv1beta1.SuggestAssetsRequest{}, + }, + { + Description: "should report internal server error if searcher fails", + Request: &compassv1beta1.SuggestAssetsRequest{ + Text: "test", + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + cfg := discovery.SearchConfig{ + Text: "test", + Filters: map[string][]string{}, + Queries: make(map[string]string), + } + drs.EXPECT().Suggest(ctx, cfg).Return([]string{}, fmt.Errorf("service unavailable")) + }, + ExpectStatus: codes.Internal, + }, + { + Description: "should pass filter to search config format", + Request: &compassv1beta1.SuggestAssetsRequest{ + Text: "resource", + Query: map[string]string{ + "description": "this is my dashboard", + }, + Filter: map[string]string{ + "data.landscape": "th", + "type": "topic", + "service": "kafka,rabbitmq", + }, + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + + cfg := discovery.SearchConfig{ + Text: "resource", + TypeWhiteList: []string{"topic"}, + Filters: map[string][]string{ + "service": {"kafka", "rabbitmq"}, + "data.landscape": {"th"}, + }, + Queries: map[string]string{ + "description": "this is my dashboard", + }, + } + drs.EXPECT().Suggest(ctx, cfg).Return([]string{}, nil) + }, + }, + { + Description: "should return suggestions", + Request: &compassv1beta1.SuggestAssetsRequest{ + Text: "test", + }, + Setup: func(ctx context.Context, drs *mocks.DiscoveryRecordSearcher) { + + cfg := discovery.SearchConfig{ + Text: "test", + Filters: make(map[string][]string), + Queries: make(map[string]string), + } + response := []string{ + "test", + "test2", + "t est", + "t_est", + } + + drs.EXPECT().Suggest(ctx, cfg).Return(response, nil) + }, + PostCheck: func(resp *compassv1beta1.SuggestAssetsResponse) error { + expected := &compassv1beta1.SuggestAssetsResponse{ + Data: []string{ + "test", + "test2", + "t est", + "t_est", + }, + } + if diff := cmp.Diff(resp, expected, protocmp.Transform()); diff != "" { + return fmt.Errorf("expected response to be %+v, was %+v", expected, resp) + } + return nil + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Description, func(t *testing.T) { + ctx := user.NewContext(context.Background(), userID) + + logger := log.NewNoop() + mockDiscovery := new(mocks.DiscoveryRecordSearcher) + if tc.Setup != nil { + tc.Setup(ctx, mockDiscovery) + } + defer mockDiscovery.AssertExpectations(t) + + discoveryService := discovery.NewService(nil, mockDiscovery) + handler := api.NewGRPCHandler(logger, &api.Dependencies{ + DiscoveryService: discoveryService, + }) + + got, err := handler.SuggestAssets(ctx, tc.Request) + code := status.Code(err) + if code != tc.ExpectStatus { + t.Errorf("expected handler to return Code %s, returned Code %sinstead", tc.ExpectStatus.String(), code.String()) + return + } + if tc.PostCheck != nil { + if err := tc.PostCheck(got); err != nil { + t.Error(err) + return + } + } + }) + } +} diff --git a/asset/asset.go b/asset/asset.go index 619618dd..00549534 100644 --- a/asset/asset.go +++ b/asset/asset.go @@ -1,13 +1,16 @@ package asset -//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --structname AssetRepository --filename asset_repository.go +//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname AssetRepository --filename asset_repository.go import ( "context" + "fmt" "time" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" "github.com/odpf/columbus/user" - "github.com/r3labs/diff/v2" + "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" ) type Config struct { @@ -23,7 +26,7 @@ type Repository interface { GetCount(context.Context, Config) (int, error) GetByID(ctx context.Context, id string) (Asset, error) Find(ctx context.Context, urn string, typ Type, service string) (Asset, error) - GetVersionHistory(ctx context.Context, cfg Config, id string) ([]AssetVersion, error) + GetVersionHistory(ctx context.Context, cfg Config, id string) ([]Asset, error) GetByVersion(ctx context.Context, id string, version string) (Asset, error) Upsert(ctx context.Context, ast *Asset) (string, error) Delete(ctx context.Context, id string) error @@ -47,6 +50,158 @@ type Asset struct { Changelog diff.Changelog `json:"changelog,omitempty" diff:"-"` } +// ToProto transforms struct to proto +func (a Asset) ToProto() (assetPB *compassv1beta1.Asset, err error) { + var data *structpb.Struct + if len(a.Data) > 0 { + data, err = structpb.NewStruct(a.Data) + if err != nil { + return + } + } + + var labels *structpb.Struct + if len(a.Labels) > 0 { + labelsMapInterface := make(map[string]interface{}, len(a.Labels)) + for k, v := range a.Labels { + labelsMapInterface[k] = v + } + labels, err = structpb.NewStruct(labelsMapInterface) + if err != nil { + return + } + } + + owners := []*compassv1beta1.User{} + for _, o := range a.Owners { + owners = append(owners, o.ToProto()) + } + + changelogProto, err := changelogToProto(a.Changelog) + if err != nil { + return nil, err + } + + var createdAtPB *timestamppb.Timestamp + if !a.CreatedAt.IsZero() { + createdAtPB = timestamppb.New(a.CreatedAt) + } + + var updatedAtPB *timestamppb.Timestamp + if !a.UpdatedAt.IsZero() { + updatedAtPB = timestamppb.New(a.UpdatedAt) + } + + assetPB = &compassv1beta1.Asset{ + Id: a.ID, + Urn: a.URN, + Type: string(a.Type), + Service: a.Service, + Name: a.Name, + Description: a.Description, + Data: data, + Labels: labels, + Owners: owners, + Version: a.Version, + UpdatedBy: a.UpdatedBy.ToProto(), + Changelog: changelogProto, + CreatedAt: createdAtPB, + UpdatedAt: updatedAtPB, + } + return +} + +// NewFromProto transforms proto to struct +// changelog is not populated by user, it should always be processed and coming from the server +func NewFromProto(pb *compassv1beta1.Asset) Asset { + var assetOwners []user.User + for _, op := range pb.GetOwners() { + if op == nil { + continue + } + assetOwners = append(assetOwners, user.NewFromProto(op)) + } + + var labels map[string]string + if pb.GetLabels() != nil { + labels = make(map[string]string) + for key, value := range pb.GetLabels().AsMap() { + strKey := fmt.Sprintf("%v", key) + strValue := fmt.Sprintf("%v", value) + labels[strKey] = strValue + } + } + + var dataValue map[string]interface{} + if pb.GetData() != nil { + dataValue = pb.GetData().AsMap() + } + + var createdAt time.Time + if pb.GetCreatedAt() != nil { + createdAt = pb.GetCreatedAt().AsTime() + } + + var updatedAt time.Time + if pb.GetUpdatedAt() != nil { + updatedAt = pb.GetUpdatedAt().AsTime() + } + + var updatedBy user.User + if pb.GetUpdatedBy() != nil { + updatedBy = user.NewFromProto(pb.GetUpdatedBy()) + } + + var clog diff.Changelog + if pb.GetChangelog() != nil { + for _, cg := range pb.GetChangelog().GetChanges() { + if cg == nil { + continue + } + clog = append(clog, newDiffChangeFromProto(cg)) + } + } + + return Asset{ + ID: pb.GetId(), + URN: pb.GetUrn(), + Type: Type(pb.GetType()), + Service: pb.GetService(), + Name: pb.GetName(), + Description: pb.GetDescription(), + Data: dataValue, + Labels: labels, + Owners: assetOwners, + CreatedAt: createdAt, + UpdatedAt: updatedAt, + Version: pb.GetVersion(), + Changelog: clog, + UpdatedBy: updatedBy, + } +} + +// AssignDataFromProto populates asset.Data from *structpb.Struct data +func (a *Asset) AssignDataFromProto(pb *structpb.Struct) { + if pb != nil { + a.Data = pb.AsMap() + } +} + +// AssignLabelsFromProto populates asset.Labels from *structpb.Struct data +func (a *Asset) AssignLabelsFromProto(pb *structpb.Struct) { + if pb != nil { + pbMap := pb.AsMap() + if len(pbMap) > 0 { + a.Labels = make(map[string]string) + for key, value := range pb.AsMap() { + strKey := fmt.Sprintf("%v", key) + strValue := fmt.Sprintf("%v", value) + a.Labels[strKey] = strValue + } + } + } +} + // Diff returns nil changelog with nil error if equal // returns wrapped r3labs/diff Changelog struct with nil error if not equal func (a *Asset) Diff(otherAsset *Asset) (diff.Changelog, error) { diff --git a/asset/asset_test.go b/asset/asset_test.go index 9544523f..dde99284 100644 --- a/asset/asset_test.go +++ b/asset/asset_test.go @@ -2,13 +2,20 @@ package asset_test import ( "encoding/json" + "reflect" "testing" + "time" + "github.com/google/go-cmp/cmp" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" "github.com/odpf/columbus/asset" "github.com/odpf/columbus/user" "github.com/r3labs/diff/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" ) func TestDiffTopLevel(t *testing.T) { @@ -400,3 +407,184 @@ func TestAssetPatch(t *testing.T) { }) } } + +func TestToProto(t *testing.T) { + timeDummy := time.Date(2000, time.January, 7, 0, 0, 0, 0, time.UTC) + dataPB, err := structpb.NewStruct(map[string]interface{}{ + "data1": "datavalue1", + }) + if err != nil { + t.Fatal(err) + } + + labelPB, err := structpb.NewStruct(map[string]interface{}{ + "label1": "labelvalue1", + }) + if err != nil { + t.Fatal(err) + } + + type testCase struct { + Title string + Asset asset.Asset + ExpectProto *compassv1beta1.Asset + } + + var testCases = []testCase{ + { + Title: "should return nil data pb, label pb, empty owners pb, nil changelog pb, no timestamp pb if data is empty", + Asset: asset.Asset{ID: "id1", URN: "urn1"}, + ExpectProto: &compassv1beta1.Asset{Id: "id1", Urn: "urn1"}, + }, + { + Title: "should return full pb if all fileds are not zero", + Asset: asset.Asset{ + ID: "id1", + URN: "urn1", + Data: map[string]interface{}{ + "data1": "datavalue1", + }, + Labels: map[string]string{ + "label1": "labelvalue1", + }, + Changelog: diff.Changelog{ + diff.Change{ + From: "1", + To: "2", + Path: []string{"path1/path2"}, + }, + }, + CreatedAt: timeDummy, + UpdatedAt: timeDummy, + }, + ExpectProto: &compassv1beta1.Asset{ + Id: "id1", + Urn: "urn1", + Data: dataPB, + Labels: labelPB, + Changelog: &compassv1beta1.Changelog{ + Changes: []*compassv1beta1.Change{ + { + + From: structpb.NewStringValue("1"), + To: structpb.NewStringValue("2"), + Path: []string{"path1/path2"}, + }, + }, + }, + CreatedAt: timestamppb.New(timeDummy), + UpdatedAt: timestamppb.New(timeDummy), + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Title, func(t *testing.T) { + + got, err := tc.Asset.ToProto() + if err != nil { + t.Error(err) + } + if diff := cmp.Diff(got, tc.ExpectProto, protocmp.Transform()); diff != "" { + t.Errorf("expected response to be %+v, was %+v", tc.ExpectProto, got) + } + }) + } +} + +func TestNewFromProto(t *testing.T) { + timeDummy := time.Date(2000, time.January, 7, 0, 0, 0, 0, time.UTC) + dataPB, err := structpb.NewStruct(map[string]interface{}{ + "data1": "datavalue1", + }) + if err != nil { + t.Fatal(err) + } + + labelPB, err := structpb.NewStruct(map[string]interface{}{ + "label1": "labelvalue1", + }) + if err != nil { + t.Fatal(err) + } + + type testCase struct { + Title string + AssetPB *compassv1beta1.Asset + ExpectAsset asset.Asset + } + + var testCases = []testCase{ + { + Title: "should return empty labels, data, and owners if all pb empty", + AssetPB: &compassv1beta1.Asset{Id: "id1"}, + ExpectAsset: asset.Asset{ID: "id1"}, + }, + { + Title: "should return non empty labels, data, and owners if all pb is not empty", + AssetPB: &compassv1beta1.Asset{ + Id: "id1", + Urn: "urn1", + Name: "name1", + Data: dataPB, + Labels: labelPB, + Owners: []*compassv1beta1.User{ + { + Id: "uid1", + }, + { + Id: "uid2", + }, + }, + Changelog: &compassv1beta1.Changelog{ + Changes: []*compassv1beta1.Change{ + { + + From: structpb.NewStringValue("1"), + To: structpb.NewStringValue("2"), + Path: []string{"path1/path2"}, + }, + }, + }, + CreatedAt: timestamppb.New(timeDummy), + UpdatedAt: timestamppb.New(timeDummy), + }, + ExpectAsset: asset.Asset{ + ID: "id1", + URN: "urn1", + Name: "name1", + Data: map[string]interface{}{ + "data1": "datavalue1", + }, + Labels: map[string]string{ + "label1": "labelvalue1", + }, + Owners: []user.User{ + { + ID: "uid1", + }, + { + ID: "uid2", + }, + }, + Changelog: diff.Changelog{ + diff.Change{ + From: "1", + To: "2", + Path: []string{"path1/path2"}, + }, + }, + CreatedAt: timeDummy, + UpdatedAt: timeDummy, + }, + }, + } + for _, tc := range testCases { + t.Run(tc.Title, func(t *testing.T) { + + got := asset.NewFromProto(tc.AssetPB) + if reflect.DeepEqual(got, tc.ExpectAsset) == false { + t.Errorf("expected returned asset to be to be %+v, was %+v", tc.ExpectAsset, got) + } + }) + } +} diff --git a/asset/version.go b/asset/version.go index ec29d212..e6e02cb3 100644 --- a/asset/version.go +++ b/asset/version.go @@ -2,28 +2,15 @@ package asset import ( "fmt" - "time" "github.com/Masterminds/semver/v3" - "github.com/odpf/columbus/user" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" "github.com/r3labs/diff/v2" + "google.golang.org/protobuf/types/known/structpb" ) const BaseVersion = "0.1" -// AssetVersion is the changes summary of asset versions -type AssetVersion struct { - ID string `json:"id" db:"id"` - URN string `json:"urn" db:"urn"` - Type string `json:"type" db:"type"` - Service string `json:"service" db:"service"` - Version string `json:"version" db:"version"` - Changelog diff.Changelog `json:"changelog" db:"changelog"` - UpdatedBy user.User `json:"updated_by" db:"updated_by"` - CreatedAt time.Time `json:"created_at" db:"created_at"` - UpdatedAt time.Time `json:"updated_at" db:"updated_at"` -} - // ParseVersion returns error if version string is not in MAJOR.MINOR format func ParseVersion(v string) (*semver.Version, error) { semverVersion, err := semver.NewVersion(v) @@ -42,3 +29,60 @@ func IncreaseMinorVersion(v string) (string, error) { newVersion := oldVersion.IncMinor() return fmt.Sprintf("%d.%d", newVersion.Major(), newVersion.Minor()), nil } + +// changelogToProto transforms changelog struct to proto +func changelogToProto(cl diff.Changelog) (*compassv1beta1.Changelog, error) { + if len(cl) == 0 { + return nil, nil + } + protoChanges := []*compassv1beta1.Change{} + for _, ch := range cl { + chProto, err := diffChangeToProto(ch) + if err != nil { + return nil, err + } + + protoChanges = append(protoChanges, chProto) + } + return &compassv1beta1.Changelog{ + Changes: protoChanges, + }, nil +} + +func diffChangeToProto(dc diff.Change) (*compassv1beta1.Change, error) { + from, err := structpb.NewValue(dc.From) + if err != nil { + return nil, err + } + to, err := structpb.NewValue(dc.To) + if err != nil { + return nil, err + } + + return &compassv1beta1.Change{ + Type: dc.Type, + Path: dc.Path, + From: from, + To: to, + }, nil +} + +// newDiffChangeFromProto converts Change proto to diff.Change +func newDiffChangeFromProto(pb *compassv1beta1.Change) diff.Change { + var fromItf interface{} + if pb.GetFrom() != nil { + fromItf = pb.GetFrom().AsInterface() + } + + var toItf interface{} + if pb.GetTo() != nil { + toItf = pb.GetTo().AsInterface() + } + + return diff.Change{ + Type: pb.GetType(), + Path: pb.GetPath(), + From: fromItf, + To: toItf, + } +} diff --git a/buf.gen.yaml b/buf.gen.yaml index 498adc48..099e4549 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,4 +1,4 @@ -version: v1beta1 +version: v1 plugins: - name: go out: api/proto @@ -22,3 +22,4 @@ plugins: - allow_repeated_fields_in_body=true - allow_merge=true - merge_file_name=compass + diff --git a/cmd/serve.go b/cmd/serve.go index 21da9751..2b8d93bb 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -41,7 +41,9 @@ import ( // Version of the current build. overridden by the build system. // see "Makefile" for more information -var Version string +var ( + Version string +) func Serve() { if err := loadConfig(); err != nil { @@ -81,11 +83,10 @@ func Serve() { muxServer, gw, err := newGRPCServer( config, - newRelicMonitor.Application(), grpc_recovery.UnaryServerInterceptor(), grpc_ctxtags.UnaryServerInterceptor(), grpc_logrus.UnaryServerInterceptor(logrus.NewEntry(logrus.New())), //TODO: expose *logrus.Logger in salt - nrgrpc.UnaryServerInterceptor(newRelicMonitor.Application()), + nrgrpc.UnaryServerInterceptor(newRelicMonitor.Application()), // TODO: newRelicMonitor might be nil grpc_interceptor.ValidateUser(config.IdentityHeader, deps.UserService), ) if err != nil { @@ -320,7 +321,7 @@ func esInfo(cli *elasticsearch.Client) (string, error) { return fmt.Sprintf("%q (server version %s)", info.ClusterName, info.Version.Number), nil } -func newGRPCServer(cfg Config, nrApp *newrelic.Application, middleware ...grpc.UnaryServerInterceptor) (*server.MuxServer, *server.GRPCGateway, error) { +func newGRPCServer(cfg Config, middleware ...grpc.UnaryServerInterceptor) (*server.MuxServer, *server.GRPCGateway, error) { grpcPortInt, err := strconv.Atoi(config.GRPCServerPort) if err != nil { return nil, nil, err @@ -341,7 +342,6 @@ func newGRPCServer(cfg Config, nrApp *newrelic.Application, middleware ...grpc.U ), ), ) - // server.WithMuxHTTPServer(httpServer)) if err != nil { return nil, nil, err } @@ -363,36 +363,9 @@ func newGRPCServer(cfg Config, nrApp *newrelic.Application, middleware ...grpc.U return nil, nil, err } - // if err = gw.RegisterHandler(ctx, compassv1beta1.RegisterCompassServiceHandlerFromEndpoint); err != nil { - // return nil, err - // } - - // muxServer.RegisterService( - // &compassv1beta1.CompassService_ServiceDesc, - // grpcapi.NewService(logger, deps), - // ) - - // api.RegisterHandlers(ctx, muxServer, gw) return muxServer, gw, nil } -// func (s *Server) Run() error { -// ctx, cancelFunc := context.WithCancel( -// server.HandleSignals(context.Background()), -// ) -// defer cancelFunc() -// if err = s.gw.RegisterHandler(ctx, compassv1beta1.RegisterCompassServiceHandlerFromEndpoint); err != nil { -// return nil, err -// } - -// s.muxServer.RegisterService( -// &compassv1beta1.CompassService_ServiceDesc, -// grpcapi.NewService(logger, deps), -// ) - -// // api.RegisterHandlers(ctx, muxServer, gw) -// } - func makeHeaderMatcher(c Config) func(key string) (string, bool) { return func(key string) (string, bool) { switch strings.ToLower(key) { diff --git a/discovery/model.go b/discovery/model.go index d26215c4..ed07e091 100644 --- a/discovery/model.go +++ b/discovery/model.go @@ -17,6 +17,19 @@ type SearchResult struct { Labels map[string]string `json:"labels"` } +// ToAsset returns search result as asset +func (sr SearchResult) ToAsset() asset.Asset { + return asset.Asset{ + ID: sr.ID, + URN: sr.URN, + Name: sr.Title, + Type: asset.Type(sr.Type), + Service: sr.Service, + Description: sr.Description, + Labels: sr.Labels, + } +} + // SearchConfig represents a search query along // with any corresponding filter(s) type SearchConfig struct { diff --git a/discovery/repo.go b/discovery/repo.go index 2502e312..5514b81e 100644 --- a/discovery/repo.go +++ b/discovery/repo.go @@ -1,6 +1,7 @@ package discovery -//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --structname DiscoveryRepository --filename discovery_repository.go +//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname DiscoveryRepository --filename discovery_repository.go +//go:generate mockery --name RecordSearcher --outpkg mocks --output ../lib/mocks/ --with-expecter --structname DiscoveryRecordSearcher --filename discovery_record_searcher.go import ( "context" diff --git a/discussion/comment.go b/discussion/comment.go index 3c986ebf..30e5a67e 100644 --- a/discussion/comment.go +++ b/discussion/comment.go @@ -22,14 +22,25 @@ type Comment struct { // ToProto transforms struct to proto func (d Comment) ToProto() *compassv1beta1.Comment { + + var createdAtPB *timestamppb.Timestamp + if !d.CreatedAt.IsZero() { + createdAtPB = timestamppb.New(d.CreatedAt) + } + + var updatedAtPB *timestamppb.Timestamp + if !d.UpdatedAt.IsZero() { + updatedAtPB = timestamppb.New(d.UpdatedAt) + } + return &compassv1beta1.Comment{ Id: d.ID, DiscussionId: d.DiscussionID, Body: d.Body, Owner: d.Owner.ToProto(), UpdatedBy: d.UpdatedBy.ToProto(), - CreatedAt: timestamppb.New(d.CreatedAt), - UpdatedAt: timestamppb.New(d.UpdatedAt), + CreatedAt: createdAtPB, + UpdatedAt: updatedAtPB, } } diff --git a/go.mod b/go.mod index f1207cf6..4f3da1c0 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/go-playground/validator/v10 v10.10.0 github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/golang-migrate/migrate/v4 v4.15.0 + github.com/google/go-cmp v0.5.7 github.com/google/uuid v1.3.0 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 diff --git a/lib/mocks/asset_repository.go b/lib/mocks/asset_repository.go index 37f43c1d..cf2190fb 100644 --- a/lib/mocks/asset_repository.go +++ b/lib/mocks/asset_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -15,6 +15,14 @@ type AssetRepository struct { mock.Mock } +type AssetRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *AssetRepository) EXPECT() *AssetRepository_Expecter { + return &AssetRepository_Expecter{mock: &_m.Mock} +} + // Delete provides a mock function with given fields: ctx, id func (_m *AssetRepository) Delete(ctx context.Context, id string) error { ret := _m.Called(ctx, id) @@ -29,6 +37,30 @@ func (_m *AssetRepository) Delete(ctx context.Context, id string) error { return r0 } +// AssetRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type AssetRepository_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *AssetRepository_Expecter) Delete(ctx interface{}, id interface{}) *AssetRepository_Delete_Call { + return &AssetRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *AssetRepository_Delete_Call) Run(run func(ctx context.Context, id string)) *AssetRepository_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AssetRepository_Delete_Call) Return(_a0 error) *AssetRepository_Delete_Call { + _c.Call.Return(_a0) + return _c +} + // Find provides a mock function with given fields: ctx, urn, typ, service func (_m *AssetRepository) Find(ctx context.Context, urn string, typ asset.Type, service string) (asset.Asset, error) { ret := _m.Called(ctx, urn, typ, service) @@ -50,6 +82,32 @@ func (_m *AssetRepository) Find(ctx context.Context, urn string, typ asset.Type, return r0, r1 } +// AssetRepository_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find' +type AssetRepository_Find_Call struct { + *mock.Call +} + +// Find is a helper method to define mock.On call +// - ctx context.Context +// - urn string +// - typ asset.Type +// - service string +func (_e *AssetRepository_Expecter) Find(ctx interface{}, urn interface{}, typ interface{}, service interface{}) *AssetRepository_Find_Call { + return &AssetRepository_Find_Call{Call: _e.mock.On("Find", ctx, urn, typ, service)} +} + +func (_c *AssetRepository_Find_Call) Run(run func(ctx context.Context, urn string, typ asset.Type, service string)) *AssetRepository_Find_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(asset.Type), args[3].(string)) + }) + return _c +} + +func (_c *AssetRepository_Find_Call) Return(_a0 asset.Asset, _a1 error) *AssetRepository_Find_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetAll provides a mock function with given fields: _a0, _a1 func (_m *AssetRepository) GetAll(_a0 context.Context, _a1 asset.Config) ([]asset.Asset, error) { ret := _m.Called(_a0, _a1) @@ -73,6 +131,30 @@ func (_m *AssetRepository) GetAll(_a0 context.Context, _a1 asset.Config) ([]asse return r0, r1 } +// AssetRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type AssetRepository_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 asset.Config +func (_e *AssetRepository_Expecter) GetAll(_a0 interface{}, _a1 interface{}) *AssetRepository_GetAll_Call { + return &AssetRepository_GetAll_Call{Call: _e.mock.On("GetAll", _a0, _a1)} +} + +func (_c *AssetRepository_GetAll_Call) Run(run func(_a0 context.Context, _a1 asset.Config)) *AssetRepository_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(asset.Config)) + }) + return _c +} + +func (_c *AssetRepository_GetAll_Call) Return(_a0 []asset.Asset, _a1 error) *AssetRepository_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetByID provides a mock function with given fields: ctx, id func (_m *AssetRepository) GetByID(ctx context.Context, id string) (asset.Asset, error) { ret := _m.Called(ctx, id) @@ -94,6 +176,30 @@ func (_m *AssetRepository) GetByID(ctx context.Context, id string) (asset.Asset, return r0, r1 } +// AssetRepository_GetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByID' +type AssetRepository_GetByID_Call struct { + *mock.Call +} + +// GetByID is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *AssetRepository_Expecter) GetByID(ctx interface{}, id interface{}) *AssetRepository_GetByID_Call { + return &AssetRepository_GetByID_Call{Call: _e.mock.On("GetByID", ctx, id)} +} + +func (_c *AssetRepository_GetByID_Call) Run(run func(ctx context.Context, id string)) *AssetRepository_GetByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *AssetRepository_GetByID_Call) Return(_a0 asset.Asset, _a1 error) *AssetRepository_GetByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetByVersion provides a mock function with given fields: ctx, id, version func (_m *AssetRepository) GetByVersion(ctx context.Context, id string, version string) (asset.Asset, error) { ret := _m.Called(ctx, id, version) @@ -115,6 +221,31 @@ func (_m *AssetRepository) GetByVersion(ctx context.Context, id string, version return r0, r1 } +// AssetRepository_GetByVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByVersion' +type AssetRepository_GetByVersion_Call struct { + *mock.Call +} + +// GetByVersion is a helper method to define mock.On call +// - ctx context.Context +// - id string +// - version string +func (_e *AssetRepository_Expecter) GetByVersion(ctx interface{}, id interface{}, version interface{}) *AssetRepository_GetByVersion_Call { + return &AssetRepository_GetByVersion_Call{Call: _e.mock.On("GetByVersion", ctx, id, version)} +} + +func (_c *AssetRepository_GetByVersion_Call) Run(run func(ctx context.Context, id string, version string)) *AssetRepository_GetByVersion_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *AssetRepository_GetByVersion_Call) Return(_a0 asset.Asset, _a1 error) *AssetRepository_GetByVersion_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetCount provides a mock function with given fields: _a0, _a1 func (_m *AssetRepository) GetCount(_a0 context.Context, _a1 asset.Config) (int, error) { ret := _m.Called(_a0, _a1) @@ -136,16 +267,40 @@ func (_m *AssetRepository) GetCount(_a0 context.Context, _a1 asset.Config) (int, return r0, r1 } +// AssetRepository_GetCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCount' +type AssetRepository_GetCount_Call struct { + *mock.Call +} + +// GetCount is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 asset.Config +func (_e *AssetRepository_Expecter) GetCount(_a0 interface{}, _a1 interface{}) *AssetRepository_GetCount_Call { + return &AssetRepository_GetCount_Call{Call: _e.mock.On("GetCount", _a0, _a1)} +} + +func (_c *AssetRepository_GetCount_Call) Run(run func(_a0 context.Context, _a1 asset.Config)) *AssetRepository_GetCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(asset.Config)) + }) + return _c +} + +func (_c *AssetRepository_GetCount_Call) Return(_a0 int, _a1 error) *AssetRepository_GetCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetVersionHistory provides a mock function with given fields: ctx, cfg, id -func (_m *AssetRepository) GetVersionHistory(ctx context.Context, cfg asset.Config, id string) ([]asset.AssetVersion, error) { +func (_m *AssetRepository) GetVersionHistory(ctx context.Context, cfg asset.Config, id string) ([]asset.Asset, error) { ret := _m.Called(ctx, cfg, id) - var r0 []asset.AssetVersion - if rf, ok := ret.Get(0).(func(context.Context, asset.Config, string) []asset.AssetVersion); ok { + var r0 []asset.Asset + if rf, ok := ret.Get(0).(func(context.Context, asset.Config, string) []asset.Asset); ok { r0 = rf(ctx, cfg, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]asset.AssetVersion) + r0 = ret.Get(0).([]asset.Asset) } } @@ -159,6 +314,31 @@ func (_m *AssetRepository) GetVersionHistory(ctx context.Context, cfg asset.Conf return r0, r1 } +// AssetRepository_GetVersionHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVersionHistory' +type AssetRepository_GetVersionHistory_Call struct { + *mock.Call +} + +// GetVersionHistory is a helper method to define mock.On call +// - ctx context.Context +// - cfg asset.Config +// - id string +func (_e *AssetRepository_Expecter) GetVersionHistory(ctx interface{}, cfg interface{}, id interface{}) *AssetRepository_GetVersionHistory_Call { + return &AssetRepository_GetVersionHistory_Call{Call: _e.mock.On("GetVersionHistory", ctx, cfg, id)} +} + +func (_c *AssetRepository_GetVersionHistory_Call) Run(run func(ctx context.Context, cfg asset.Config, id string)) *AssetRepository_GetVersionHistory_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(asset.Config), args[2].(string)) + }) + return _c +} + +func (_c *AssetRepository_GetVersionHistory_Call) Return(_a0 []asset.Asset, _a1 error) *AssetRepository_GetVersionHistory_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // Upsert provides a mock function with given fields: ctx, ast func (_m *AssetRepository) Upsert(ctx context.Context, ast *asset.Asset) (string, error) { ret := _m.Called(ctx, ast) @@ -179,3 +359,27 @@ func (_m *AssetRepository) Upsert(ctx context.Context, ast *asset.Asset) (string return r0, r1 } + +// AssetRepository_Upsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upsert' +type AssetRepository_Upsert_Call struct { + *mock.Call +} + +// Upsert is a helper method to define mock.On call +// - ctx context.Context +// - ast *asset.Asset +func (_e *AssetRepository_Expecter) Upsert(ctx interface{}, ast interface{}) *AssetRepository_Upsert_Call { + return &AssetRepository_Upsert_Call{Call: _e.mock.On("Upsert", ctx, ast)} +} + +func (_c *AssetRepository_Upsert_Call) Run(run func(ctx context.Context, ast *asset.Asset)) *AssetRepository_Upsert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*asset.Asset)) + }) + return _c +} + +func (_c *AssetRepository_Upsert_Call) Return(_a0 string, _a1 error) *AssetRepository_Upsert_Call { + _c.Call.Return(_a0, _a1) + return _c +} diff --git a/lib/mocks/discovery_record_searcher.go b/lib/mocks/discovery_record_searcher.go new file mode 100644 index 00000000..a9299ce7 --- /dev/null +++ b/lib/mocks/discovery_record_searcher.go @@ -0,0 +1,117 @@ +// Code generated by mockery v2.10.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + discovery "github.com/odpf/columbus/discovery" + mock "github.com/stretchr/testify/mock" +) + +// DiscoveryRecordSearcher is an autogenerated mock type for the RecordSearcher type +type DiscoveryRecordSearcher struct { + mock.Mock +} + +type DiscoveryRecordSearcher_Expecter struct { + mock *mock.Mock +} + +func (_m *DiscoveryRecordSearcher) EXPECT() *DiscoveryRecordSearcher_Expecter { + return &DiscoveryRecordSearcher_Expecter{mock: &_m.Mock} +} + +// Search provides a mock function with given fields: ctx, cfg +func (_m *DiscoveryRecordSearcher) Search(ctx context.Context, cfg discovery.SearchConfig) ([]discovery.SearchResult, error) { + ret := _m.Called(ctx, cfg) + + var r0 []discovery.SearchResult + if rf, ok := ret.Get(0).(func(context.Context, discovery.SearchConfig) []discovery.SearchResult); ok { + r0 = rf(ctx, cfg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]discovery.SearchResult) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, discovery.SearchConfig) error); ok { + r1 = rf(ctx, cfg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DiscoveryRecordSearcher_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' +type DiscoveryRecordSearcher_Search_Call struct { + *mock.Call +} + +// Search is a helper method to define mock.On call +// - ctx context.Context +// - cfg discovery.SearchConfig +func (_e *DiscoveryRecordSearcher_Expecter) Search(ctx interface{}, cfg interface{}) *DiscoveryRecordSearcher_Search_Call { + return &DiscoveryRecordSearcher_Search_Call{Call: _e.mock.On("Search", ctx, cfg)} +} + +func (_c *DiscoveryRecordSearcher_Search_Call) Run(run func(ctx context.Context, cfg discovery.SearchConfig)) *DiscoveryRecordSearcher_Search_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(discovery.SearchConfig)) + }) + return _c +} + +func (_c *DiscoveryRecordSearcher_Search_Call) Return(results []discovery.SearchResult, err error) *DiscoveryRecordSearcher_Search_Call { + _c.Call.Return(results, err) + return _c +} + +// Suggest provides a mock function with given fields: ctx, cfg +func (_m *DiscoveryRecordSearcher) Suggest(ctx context.Context, cfg discovery.SearchConfig) ([]string, error) { + ret := _m.Called(ctx, cfg) + + var r0 []string + if rf, ok := ret.Get(0).(func(context.Context, discovery.SearchConfig) []string); ok { + r0 = rf(ctx, cfg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, discovery.SearchConfig) error); ok { + r1 = rf(ctx, cfg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DiscoveryRecordSearcher_Suggest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Suggest' +type DiscoveryRecordSearcher_Suggest_Call struct { + *mock.Call +} + +// Suggest is a helper method to define mock.On call +// - ctx context.Context +// - cfg discovery.SearchConfig +func (_e *DiscoveryRecordSearcher_Expecter) Suggest(ctx interface{}, cfg interface{}) *DiscoveryRecordSearcher_Suggest_Call { + return &DiscoveryRecordSearcher_Suggest_Call{Call: _e.mock.On("Suggest", ctx, cfg)} +} + +func (_c *DiscoveryRecordSearcher_Suggest_Call) Run(run func(ctx context.Context, cfg discovery.SearchConfig)) *DiscoveryRecordSearcher_Suggest_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(discovery.SearchConfig)) + }) + return _c +} + +func (_c *DiscoveryRecordSearcher_Suggest_Call) Return(suggestions []string, err error) *DiscoveryRecordSearcher_Suggest_Call { + _c.Call.Return(suggestions, err) + return _c +} diff --git a/lib/mocks/discovery_repository.go b/lib/mocks/discovery_repository.go index 4f48f133..f1014762 100644 --- a/lib/mocks/discovery_repository.go +++ b/lib/mocks/discovery_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -15,6 +15,14 @@ type DiscoveryRepository struct { mock.Mock } +type DiscoveryRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *DiscoveryRepository) EXPECT() *DiscoveryRepository_Expecter { + return &DiscoveryRepository_Expecter{mock: &_m.Mock} +} + // Delete provides a mock function with given fields: ctx, assetID func (_m *DiscoveryRepository) Delete(ctx context.Context, assetID string) error { ret := _m.Called(ctx, assetID) @@ -29,6 +37,30 @@ func (_m *DiscoveryRepository) Delete(ctx context.Context, assetID string) error return r0 } +// DiscoveryRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type DiscoveryRepository_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - assetID string +func (_e *DiscoveryRepository_Expecter) Delete(ctx interface{}, assetID interface{}) *DiscoveryRepository_Delete_Call { + return &DiscoveryRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, assetID)} +} + +func (_c *DiscoveryRepository_Delete_Call) Run(run func(ctx context.Context, assetID string)) *DiscoveryRepository_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *DiscoveryRepository_Delete_Call) Return(_a0 error) *DiscoveryRepository_Delete_Call { + _c.Call.Return(_a0) + return _c +} + // Upsert provides a mock function with given fields: _a0, _a1 func (_m *DiscoveryRepository) Upsert(_a0 context.Context, _a1 asset.Asset) error { ret := _m.Called(_a0, _a1) @@ -42,3 +74,27 @@ func (_m *DiscoveryRepository) Upsert(_a0 context.Context, _a1 asset.Asset) erro return r0 } + +// DiscoveryRepository_Upsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upsert' +type DiscoveryRepository_Upsert_Call struct { + *mock.Call +} + +// Upsert is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 asset.Asset +func (_e *DiscoveryRepository_Expecter) Upsert(_a0 interface{}, _a1 interface{}) *DiscoveryRepository_Upsert_Call { + return &DiscoveryRepository_Upsert_Call{Call: _e.mock.On("Upsert", _a0, _a1)} +} + +func (_c *DiscoveryRepository_Upsert_Call) Run(run func(_a0 context.Context, _a1 asset.Asset)) *DiscoveryRepository_Upsert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(asset.Asset)) + }) + return _c +} + +func (_c *DiscoveryRepository_Upsert_Call) Return(_a0 error) *DiscoveryRepository_Upsert_Call { + _c.Call.Return(_a0) + return _c +} diff --git a/lib/mocks/discussion_repository.go b/lib/mocks/discussion_repository.go index 7e61ec06..164c59a8 100644 --- a/lib/mocks/discussion_repository.go +++ b/lib/mocks/discussion_repository.go @@ -243,13 +243,13 @@ func (_c *DiscussionRepository_GetAll_Call) Return(_a0 []discussion.Discussion, return _c } -// GetAllComments provides a mock function with given fields: ctx, discussionID, flt -func (_m *DiscussionRepository) GetAllComments(ctx context.Context, discussionID string, flt discussion.Filter) ([]discussion.Comment, error) { - ret := _m.Called(ctx, discussionID, flt) +// GetAllComments provides a mock function with given fields: ctx, discussionID, filter +func (_m *DiscussionRepository) GetAllComments(ctx context.Context, discussionID string, filter discussion.Filter) ([]discussion.Comment, error) { + ret := _m.Called(ctx, discussionID, filter) var r0 []discussion.Comment if rf, ok := ret.Get(0).(func(context.Context, string, discussion.Filter) []discussion.Comment); ok { - r0 = rf(ctx, discussionID, flt) + r0 = rf(ctx, discussionID, filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]discussion.Comment) @@ -258,7 +258,7 @@ func (_m *DiscussionRepository) GetAllComments(ctx context.Context, discussionID var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, discussion.Filter) error); ok { - r1 = rf(ctx, discussionID, flt) + r1 = rf(ctx, discussionID, filter) } else { r1 = ret.Error(1) } @@ -274,12 +274,12 @@ type DiscussionRepository_GetAllComments_Call struct { // GetAllComments is a helper method to define mock.On call // - ctx context.Context // - discussionID string -// - flt discussion.Filter -func (_e *DiscussionRepository_Expecter) GetAllComments(ctx interface{}, discussionID interface{}, flt interface{}) *DiscussionRepository_GetAllComments_Call { - return &DiscussionRepository_GetAllComments_Call{Call: _e.mock.On("GetAllComments", ctx, discussionID, flt)} +// - filter discussion.Filter +func (_e *DiscussionRepository_Expecter) GetAllComments(ctx interface{}, discussionID interface{}, filter interface{}) *DiscussionRepository_GetAllComments_Call { + return &DiscussionRepository_GetAllComments_Call{Call: _e.mock.On("GetAllComments", ctx, discussionID, filter)} } -func (_c *DiscussionRepository_GetAllComments_Call) Run(run func(ctx context.Context, discussionID string, flt discussion.Filter)) *DiscussionRepository_GetAllComments_Call { +func (_c *DiscussionRepository_GetAllComments_Call) Run(run func(ctx context.Context, discussionID string, filter discussion.Filter)) *DiscussionRepository_GetAllComments_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(discussion.Filter)) }) diff --git a/lib/mocks/lineage_repository.go b/lib/mocks/lineage_repository.go index 49944eb6..5184141b 100644 --- a/lib/mocks/lineage_repository.go +++ b/lib/mocks/lineage_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type LineageRepository struct { mock.Mock } +type LineageRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *LineageRepository) EXPECT() *LineageRepository_Expecter { + return &LineageRepository_Expecter{mock: &_m.Mock} +} + // GetGraph provides a mock function with given fields: ctx, node func (_m *LineageRepository) GetGraph(ctx context.Context, node lineage.Node) (lineage.Graph, error) { ret := _m.Called(ctx, node) @@ -37,6 +45,30 @@ func (_m *LineageRepository) GetGraph(ctx context.Context, node lineage.Node) (l return r0, r1 } +// LineageRepository_GetGraph_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGraph' +type LineageRepository_GetGraph_Call struct { + *mock.Call +} + +// GetGraph is a helper method to define mock.On call +// - ctx context.Context +// - node lineage.Node +func (_e *LineageRepository_Expecter) GetGraph(ctx interface{}, node interface{}) *LineageRepository_GetGraph_Call { + return &LineageRepository_GetGraph_Call{Call: _e.mock.On("GetGraph", ctx, node)} +} + +func (_c *LineageRepository_GetGraph_Call) Run(run func(ctx context.Context, node lineage.Node)) *LineageRepository_GetGraph_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(lineage.Node)) + }) + return _c +} + +func (_c *LineageRepository_GetGraph_Call) Return(_a0 lineage.Graph, _a1 error) *LineageRepository_GetGraph_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // Upsert provides a mock function with given fields: ctx, node, upstreams, downstreams func (_m *LineageRepository) Upsert(ctx context.Context, node lineage.Node, upstreams []lineage.Node, downstreams []lineage.Node) error { ret := _m.Called(ctx, node, upstreams, downstreams) @@ -50,3 +82,29 @@ func (_m *LineageRepository) Upsert(ctx context.Context, node lineage.Node, upst return r0 } + +// LineageRepository_Upsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upsert' +type LineageRepository_Upsert_Call struct { + *mock.Call +} + +// Upsert is a helper method to define mock.On call +// - ctx context.Context +// - node lineage.Node +// - upstreams []lineage.Node +// - downstreams []lineage.Node +func (_e *LineageRepository_Expecter) Upsert(ctx interface{}, node interface{}, upstreams interface{}, downstreams interface{}) *LineageRepository_Upsert_Call { + return &LineageRepository_Upsert_Call{Call: _e.mock.On("Upsert", ctx, node, upstreams, downstreams)} +} + +func (_c *LineageRepository_Upsert_Call) Run(run func(ctx context.Context, node lineage.Node, upstreams []lineage.Node, downstreams []lineage.Node)) *LineageRepository_Upsert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(lineage.Node), args[2].([]lineage.Node), args[3].([]lineage.Node)) + }) + return _c +} + +func (_c *LineageRepository_Upsert_Call) Return(_a0 error) *LineageRepository_Upsert_Call { + _c.Call.Return(_a0) + return _c +} diff --git a/lib/mocks/star_repository.go b/lib/mocks/star_repository.go index 8405a7ac..69ba88f4 100644 --- a/lib/mocks/star_repository.go +++ b/lib/mocks/star_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -19,6 +19,14 @@ type StarRepository struct { mock.Mock } +type StarRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *StarRepository) EXPECT() *StarRepository_Expecter { + return &StarRepository_Expecter{mock: &_m.Mock} +} + // Create provides a mock function with given fields: ctx, userID, assetID func (_m *StarRepository) Create(ctx context.Context, userID string, assetID string) (string, error) { ret := _m.Called(ctx, userID, assetID) @@ -40,6 +48,31 @@ func (_m *StarRepository) Create(ctx context.Context, userID string, assetID str return r0, r1 } +// StarRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type StarRepository_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - userID string +// - assetID string +func (_e *StarRepository_Expecter) Create(ctx interface{}, userID interface{}, assetID interface{}) *StarRepository_Create_Call { + return &StarRepository_Create_Call{Call: _e.mock.On("Create", ctx, userID, assetID)} +} + +func (_c *StarRepository_Create_Call) Run(run func(ctx context.Context, userID string, assetID string)) *StarRepository_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *StarRepository_Create_Call) Return(_a0 string, _a1 error) *StarRepository_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // Delete provides a mock function with given fields: ctx, userID, assetID func (_m *StarRepository) Delete(ctx context.Context, userID string, assetID string) error { ret := _m.Called(ctx, userID, assetID) @@ -54,6 +87,31 @@ func (_m *StarRepository) Delete(ctx context.Context, userID string, assetID str return r0 } +// StarRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type StarRepository_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - userID string +// - assetID string +func (_e *StarRepository_Expecter) Delete(ctx interface{}, userID interface{}, assetID interface{}) *StarRepository_Delete_Call { + return &StarRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, userID, assetID)} +} + +func (_c *StarRepository_Delete_Call) Run(run func(ctx context.Context, userID string, assetID string)) *StarRepository_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *StarRepository_Delete_Call) Return(_a0 error) *StarRepository_Delete_Call { + _c.Call.Return(_a0) + return _c +} + // GetAllAssetsByUserEmail provides a mock function with given fields: ctx, cfg, userEmail func (_m *StarRepository) GetAllAssetsByUserEmail(ctx context.Context, cfg star.Config, userEmail string) ([]asset.Asset, error) { ret := _m.Called(ctx, cfg, userEmail) @@ -77,6 +135,31 @@ func (_m *StarRepository) GetAllAssetsByUserEmail(ctx context.Context, cfg star. return r0, r1 } +// StarRepository_GetAllAssetsByUserEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllAssetsByUserEmail' +type StarRepository_GetAllAssetsByUserEmail_Call struct { + *mock.Call +} + +// GetAllAssetsByUserEmail is a helper method to define mock.On call +// - ctx context.Context +// - cfg star.Config +// - userEmail string +func (_e *StarRepository_Expecter) GetAllAssetsByUserEmail(ctx interface{}, cfg interface{}, userEmail interface{}) *StarRepository_GetAllAssetsByUserEmail_Call { + return &StarRepository_GetAllAssetsByUserEmail_Call{Call: _e.mock.On("GetAllAssetsByUserEmail", ctx, cfg, userEmail)} +} + +func (_c *StarRepository_GetAllAssetsByUserEmail_Call) Run(run func(ctx context.Context, cfg star.Config, userEmail string)) *StarRepository_GetAllAssetsByUserEmail_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(star.Config), args[2].(string)) + }) + return _c +} + +func (_c *StarRepository_GetAllAssetsByUserEmail_Call) Return(_a0 []asset.Asset, _a1 error) *StarRepository_GetAllAssetsByUserEmail_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetAllAssetsByUserID provides a mock function with given fields: ctx, cfg, userID func (_m *StarRepository) GetAllAssetsByUserID(ctx context.Context, cfg star.Config, userID string) ([]asset.Asset, error) { ret := _m.Called(ctx, cfg, userID) @@ -100,6 +183,31 @@ func (_m *StarRepository) GetAllAssetsByUserID(ctx context.Context, cfg star.Con return r0, r1 } +// StarRepository_GetAllAssetsByUserID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllAssetsByUserID' +type StarRepository_GetAllAssetsByUserID_Call struct { + *mock.Call +} + +// GetAllAssetsByUserID is a helper method to define mock.On call +// - ctx context.Context +// - cfg star.Config +// - userID string +func (_e *StarRepository_Expecter) GetAllAssetsByUserID(ctx interface{}, cfg interface{}, userID interface{}) *StarRepository_GetAllAssetsByUserID_Call { + return &StarRepository_GetAllAssetsByUserID_Call{Call: _e.mock.On("GetAllAssetsByUserID", ctx, cfg, userID)} +} + +func (_c *StarRepository_GetAllAssetsByUserID_Call) Run(run func(ctx context.Context, cfg star.Config, userID string)) *StarRepository_GetAllAssetsByUserID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(star.Config), args[2].(string)) + }) + return _c +} + +func (_c *StarRepository_GetAllAssetsByUserID_Call) Return(_a0 []asset.Asset, _a1 error) *StarRepository_GetAllAssetsByUserID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetAssetByUserID provides a mock function with given fields: ctx, userID, assetID func (_m *StarRepository) GetAssetByUserID(ctx context.Context, userID string, assetID string) (asset.Asset, error) { ret := _m.Called(ctx, userID, assetID) @@ -121,6 +229,31 @@ func (_m *StarRepository) GetAssetByUserID(ctx context.Context, userID string, a return r0, r1 } +// StarRepository_GetAssetByUserID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAssetByUserID' +type StarRepository_GetAssetByUserID_Call struct { + *mock.Call +} + +// GetAssetByUserID is a helper method to define mock.On call +// - ctx context.Context +// - userID string +// - assetID string +func (_e *StarRepository_Expecter) GetAssetByUserID(ctx interface{}, userID interface{}, assetID interface{}) *StarRepository_GetAssetByUserID_Call { + return &StarRepository_GetAssetByUserID_Call{Call: _e.mock.On("GetAssetByUserID", ctx, userID, assetID)} +} + +func (_c *StarRepository_GetAssetByUserID_Call) Run(run func(ctx context.Context, userID string, assetID string)) *StarRepository_GetAssetByUserID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *StarRepository_GetAssetByUserID_Call) Return(_a0 asset.Asset, _a1 error) *StarRepository_GetAssetByUserID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetStargazers provides a mock function with given fields: ctx, cfg, assetID func (_m *StarRepository) GetStargazers(ctx context.Context, cfg star.Config, assetID string) ([]user.User, error) { ret := _m.Called(ctx, cfg, assetID) @@ -143,3 +276,28 @@ func (_m *StarRepository) GetStargazers(ctx context.Context, cfg star.Config, as return r0, r1 } + +// StarRepository_GetStargazers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStargazers' +type StarRepository_GetStargazers_Call struct { + *mock.Call +} + +// GetStargazers is a helper method to define mock.On call +// - ctx context.Context +// - cfg star.Config +// - assetID string +func (_e *StarRepository_Expecter) GetStargazers(ctx interface{}, cfg interface{}, assetID interface{}) *StarRepository_GetStargazers_Call { + return &StarRepository_GetStargazers_Call{Call: _e.mock.On("GetStargazers", ctx, cfg, assetID)} +} + +func (_c *StarRepository_GetStargazers_Call) Run(run func(ctx context.Context, cfg star.Config, assetID string)) *StarRepository_GetStargazers_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(star.Config), args[2].(string)) + }) + return _c +} + +func (_c *StarRepository_GetStargazers_Call) Return(_a0 []user.User, _a1 error) *StarRepository_GetStargazers_Call { + _c.Call.Return(_a0, _a1) + return _c +} diff --git a/lib/mocks/tag_repository.go b/lib/mocks/tag_repository.go index ad6d2826..a153e46b 100644 --- a/lib/mocks/tag_repository.go +++ b/lib/mocks/tag_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type TagRepository struct { mock.Mock } +type TagRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *TagRepository) EXPECT() *TagRepository_Expecter { + return &TagRepository_Expecter{mock: &_m.Mock} +} + // Create provides a mock function with given fields: ctx, _a1 func (_m *TagRepository) Create(ctx context.Context, _a1 *tag.Tag) error { ret := _m.Called(ctx, _a1) @@ -28,6 +36,30 @@ func (_m *TagRepository) Create(ctx context.Context, _a1 *tag.Tag) error { return r0 } +// TagRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type TagRepository_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - _a1 *tag.Tag +func (_e *TagRepository_Expecter) Create(ctx interface{}, _a1 interface{}) *TagRepository_Create_Call { + return &TagRepository_Create_Call{Call: _e.mock.On("Create", ctx, _a1)} +} + +func (_c *TagRepository_Create_Call) Run(run func(ctx context.Context, _a1 *tag.Tag)) *TagRepository_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*tag.Tag)) + }) + return _c +} + +func (_c *TagRepository_Create_Call) Return(_a0 error) *TagRepository_Create_Call { + _c.Call.Return(_a0) + return _c +} + // Delete provides a mock function with given fields: ctx, filter func (_m *TagRepository) Delete(ctx context.Context, filter tag.Tag) error { ret := _m.Called(ctx, filter) @@ -42,6 +74,30 @@ func (_m *TagRepository) Delete(ctx context.Context, filter tag.Tag) error { return r0 } +// TagRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type TagRepository_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - filter tag.Tag +func (_e *TagRepository_Expecter) Delete(ctx interface{}, filter interface{}) *TagRepository_Delete_Call { + return &TagRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, filter)} +} + +func (_c *TagRepository_Delete_Call) Run(run func(ctx context.Context, filter tag.Tag)) *TagRepository_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(tag.Tag)) + }) + return _c +} + +func (_c *TagRepository_Delete_Call) Return(_a0 error) *TagRepository_Delete_Call { + _c.Call.Return(_a0) + return _c +} + // Read provides a mock function with given fields: ctx, filter func (_m *TagRepository) Read(ctx context.Context, filter tag.Tag) ([]tag.Tag, error) { ret := _m.Called(ctx, filter) @@ -65,6 +121,30 @@ func (_m *TagRepository) Read(ctx context.Context, filter tag.Tag) ([]tag.Tag, e return r0, r1 } +// TagRepository_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' +type TagRepository_Read_Call struct { + *mock.Call +} + +// Read is a helper method to define mock.On call +// - ctx context.Context +// - filter tag.Tag +func (_e *TagRepository_Expecter) Read(ctx interface{}, filter interface{}) *TagRepository_Read_Call { + return &TagRepository_Read_Call{Call: _e.mock.On("Read", ctx, filter)} +} + +func (_c *TagRepository_Read_Call) Run(run func(ctx context.Context, filter tag.Tag)) *TagRepository_Read_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(tag.Tag)) + }) + return _c +} + +func (_c *TagRepository_Read_Call) Return(_a0 []tag.Tag, _a1 error) *TagRepository_Read_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // Update provides a mock function with given fields: ctx, _a1 func (_m *TagRepository) Update(ctx context.Context, _a1 *tag.Tag) error { ret := _m.Called(ctx, _a1) @@ -78,3 +158,27 @@ func (_m *TagRepository) Update(ctx context.Context, _a1 *tag.Tag) error { return r0 } + +// TagRepository_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type TagRepository_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - _a1 *tag.Tag +func (_e *TagRepository_Expecter) Update(ctx interface{}, _a1 interface{}) *TagRepository_Update_Call { + return &TagRepository_Update_Call{Call: _e.mock.On("Update", ctx, _a1)} +} + +func (_c *TagRepository_Update_Call) Run(run func(ctx context.Context, _a1 *tag.Tag)) *TagRepository_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*tag.Tag)) + }) + return _c +} + +func (_c *TagRepository_Update_Call) Return(_a0 error) *TagRepository_Update_Call { + _c.Call.Return(_a0) + return _c +} diff --git a/lib/mocks/tag_template_repository.go b/lib/mocks/tag_template_repository.go index 213cd430..5a1c0cb5 100644 --- a/lib/mocks/tag_template_repository.go +++ b/lib/mocks/tag_template_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type TagTemplateRepository struct { mock.Mock } +type TagTemplateRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *TagTemplateRepository) EXPECT() *TagTemplateRepository_Expecter { + return &TagTemplateRepository_Expecter{mock: &_m.Mock} +} + // Create provides a mock function with given fields: ctx, template func (_m *TagTemplateRepository) Create(ctx context.Context, template *tag.Template) error { ret := _m.Called(ctx, template) @@ -28,6 +36,30 @@ func (_m *TagTemplateRepository) Create(ctx context.Context, template *tag.Templ return r0 } +// TagTemplateRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type TagTemplateRepository_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - template *tag.Template +func (_e *TagTemplateRepository_Expecter) Create(ctx interface{}, template interface{}) *TagTemplateRepository_Create_Call { + return &TagTemplateRepository_Create_Call{Call: _e.mock.On("Create", ctx, template)} +} + +func (_c *TagTemplateRepository_Create_Call) Run(run func(ctx context.Context, template *tag.Template)) *TagTemplateRepository_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*tag.Template)) + }) + return _c +} + +func (_c *TagTemplateRepository_Create_Call) Return(_a0 error) *TagTemplateRepository_Create_Call { + _c.Call.Return(_a0) + return _c +} + // Delete provides a mock function with given fields: ctx, templateURN func (_m *TagTemplateRepository) Delete(ctx context.Context, templateURN string) error { ret := _m.Called(ctx, templateURN) @@ -42,6 +74,30 @@ func (_m *TagTemplateRepository) Delete(ctx context.Context, templateURN string) return r0 } +// TagTemplateRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type TagTemplateRepository_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - templateURN string +func (_e *TagTemplateRepository_Expecter) Delete(ctx interface{}, templateURN interface{}) *TagTemplateRepository_Delete_Call { + return &TagTemplateRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, templateURN)} +} + +func (_c *TagTemplateRepository_Delete_Call) Run(run func(ctx context.Context, templateURN string)) *TagTemplateRepository_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *TagTemplateRepository_Delete_Call) Return(_a0 error) *TagTemplateRepository_Delete_Call { + _c.Call.Return(_a0) + return _c +} + // Read provides a mock function with given fields: ctx, templateURN func (_m *TagTemplateRepository) Read(ctx context.Context, templateURN string) ([]tag.Template, error) { ret := _m.Called(ctx, templateURN) @@ -65,6 +121,30 @@ func (_m *TagTemplateRepository) Read(ctx context.Context, templateURN string) ( return r0, r1 } +// TagTemplateRepository_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' +type TagTemplateRepository_Read_Call struct { + *mock.Call +} + +// Read is a helper method to define mock.On call +// - ctx context.Context +// - templateURN string +func (_e *TagTemplateRepository_Expecter) Read(ctx interface{}, templateURN interface{}) *TagTemplateRepository_Read_Call { + return &TagTemplateRepository_Read_Call{Call: _e.mock.On("Read", ctx, templateURN)} +} + +func (_c *TagTemplateRepository_Read_Call) Run(run func(ctx context.Context, templateURN string)) *TagTemplateRepository_Read_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *TagTemplateRepository_Read_Call) Return(_a0 []tag.Template, _a1 error) *TagTemplateRepository_Read_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // ReadAll provides a mock function with given fields: ctx func (_m *TagTemplateRepository) ReadAll(ctx context.Context) ([]tag.Template, error) { ret := _m.Called(ctx) @@ -88,6 +168,29 @@ func (_m *TagTemplateRepository) ReadAll(ctx context.Context) ([]tag.Template, e return r0, r1 } +// TagTemplateRepository_ReadAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadAll' +type TagTemplateRepository_ReadAll_Call struct { + *mock.Call +} + +// ReadAll is a helper method to define mock.On call +// - ctx context.Context +func (_e *TagTemplateRepository_Expecter) ReadAll(ctx interface{}) *TagTemplateRepository_ReadAll_Call { + return &TagTemplateRepository_ReadAll_Call{Call: _e.mock.On("ReadAll", ctx)} +} + +func (_c *TagTemplateRepository_ReadAll_Call) Run(run func(ctx context.Context)) *TagTemplateRepository_ReadAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *TagTemplateRepository_ReadAll_Call) Return(_a0 []tag.Template, _a1 error) *TagTemplateRepository_ReadAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // Update provides a mock function with given fields: ctx, templateURN, template func (_m *TagTemplateRepository) Update(ctx context.Context, templateURN string, template *tag.Template) error { ret := _m.Called(ctx, templateURN, template) @@ -101,3 +204,28 @@ func (_m *TagTemplateRepository) Update(ctx context.Context, templateURN string, return r0 } + +// TagTemplateRepository_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type TagTemplateRepository_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - templateURN string +// - template *tag.Template +func (_e *TagTemplateRepository_Expecter) Update(ctx interface{}, templateURN interface{}, template interface{}) *TagTemplateRepository_Update_Call { + return &TagTemplateRepository_Update_Call{Call: _e.mock.On("Update", ctx, templateURN, template)} +} + +func (_c *TagTemplateRepository_Update_Call) Run(run func(ctx context.Context, templateURN string, template *tag.Template)) *TagTemplateRepository_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*tag.Template)) + }) + return _c +} + +func (_c *TagTemplateRepository_Update_Call) Return(_a0 error) *TagTemplateRepository_Update_Call { + _c.Call.Return(_a0) + return _c +} diff --git a/lib/mocks/user_repository.go b/lib/mocks/user_repository.go index 9adda03d..7da1d56f 100644 --- a/lib/mocks/user_repository.go +++ b/lib/mocks/user_repository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.9.4. DO NOT EDIT. +// Code generated by mockery v2.10.0. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type UserRepository struct { mock.Mock } +type UserRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *UserRepository) EXPECT() *UserRepository_Expecter { + return &UserRepository_Expecter{mock: &_m.Mock} +} + // Create provides a mock function with given fields: ctx, u func (_m *UserRepository) Create(ctx context.Context, u *user.User) (string, error) { ret := _m.Called(ctx, u) @@ -35,6 +43,30 @@ func (_m *UserRepository) Create(ctx context.Context, u *user.User) (string, err return r0, r1 } +// UserRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type UserRepository_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - u *user.User +func (_e *UserRepository_Expecter) Create(ctx interface{}, u interface{}) *UserRepository_Create_Call { + return &UserRepository_Create_Call{Call: _e.mock.On("Create", ctx, u)} +} + +func (_c *UserRepository_Create_Call) Run(run func(ctx context.Context, u *user.User)) *UserRepository_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*user.User)) + }) + return _c +} + +func (_c *UserRepository_Create_Call) Return(_a0 string, _a1 error) *UserRepository_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + // GetID provides a mock function with given fields: ctx, email func (_m *UserRepository) GetID(ctx context.Context, email string) (string, error) { ret := _m.Called(ctx, email) @@ -55,3 +87,27 @@ func (_m *UserRepository) GetID(ctx context.Context, email string) (string, erro return r0, r1 } + +// UserRepository_GetID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetID' +type UserRepository_GetID_Call struct { + *mock.Call +} + +// GetID is a helper method to define mock.On call +// - ctx context.Context +// - email string +func (_e *UserRepository_Expecter) GetID(ctx interface{}, email interface{}) *UserRepository_GetID_Call { + return &UserRepository_GetID_Call{Call: _e.mock.On("GetID", ctx, email)} +} + +func (_c *UserRepository_GetID_Call) Run(run func(ctx context.Context, email string)) *UserRepository_GetID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *UserRepository_GetID_Call) Return(_a0 string, _a1 error) *UserRepository_GetID_Call { + _c.Call.Return(_a0, _a1) + return _c +} diff --git a/lineage/graph.go b/lineage/graph.go index 023b3a55..93e51eb6 100644 --- a/lineage/graph.go +++ b/lineage/graph.go @@ -1,6 +1,10 @@ package lineage -import "github.com/odpf/columbus/asset" +import ( + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" + "github.com/odpf/columbus/asset" + "google.golang.org/protobuf/types/known/structpb" +) type Graph []Edge @@ -15,8 +19,57 @@ type Edge struct { Prop map[string]interface{} `json:"prop"` } +func (e Edge) ToProto() (*compassv1beta1.LineageEdge, error) { + var ( + propPB *structpb.Struct + err error + ) + + if len(e.Prop) > 0 { + propPB, err = structpb.NewStruct(e.Prop) + if err != nil { + return nil, err + } + } + return &compassv1beta1.LineageEdge{ + Source: e.Source, + Target: e.Target, + Prop: propPB, + }, nil +} + +func NewEdgeFromProto(pb *compassv1beta1.LineageEdge) Edge { + var propVal map[string]interface{} + propPB := pb.GetProp() + if propPB != nil { + propVal = propPB.AsMap() + } + + return Edge{ + Source: pb.GetSource(), + Target: pb.GetTarget(), + Prop: propVal, + } +} + type Node struct { URN string `json:"urn"` Type asset.Type `json:"type"` Service string `json:"service"` } + +func (n Node) ToProto() *compassv1beta1.LineageNode { + return &compassv1beta1.LineageNode{ + Urn: n.URN, + Type: string(n.Type), + Service: n.Service, + } +} + +func NewNodeFromProto(proto *compassv1beta1.LineageNode) Node { + return Node{ + URN: proto.GetUrn(), + Type: asset.Type(proto.GetType()), + Service: proto.GetService(), + } +} diff --git a/lineage/repo.go b/lineage/repo.go index 163012ce..a4bffc46 100644 --- a/lineage/repo.go +++ b/lineage/repo.go @@ -4,7 +4,7 @@ import ( "context" ) -//go:generate mockery --name Repository --outpkg mocks --output ../../lib/mocks/ --structname LineageRepository --filename lineage_repository.go +//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname LineageRepository --filename lineage_repository.go type Repository interface { GetGraph(ctx context.Context, node Node) (Graph, error) Upsert(ctx context.Context, node Node, upstreams, downstreams []Node) error diff --git a/star/star.go b/star/star.go index 9b7b6a89..6fc2c719 100644 --- a/star/star.go +++ b/star/star.go @@ -1,6 +1,6 @@ package star -//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --structname StarRepository --filename star_repository.go +//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname StarRepository --filename star_repository.go import ( "context" diff --git a/store/elasticsearch/discovery_repository.go b/store/elasticsearch/discovery_repository.go index 02c75d17..7ffefc98 100644 --- a/store/elasticsearch/discovery_repository.go +++ b/store/elasticsearch/discovery_repository.go @@ -90,6 +90,7 @@ func (repo *DiscoveryRepository) createUpsertBody(ast asset.Asset) (io.Reader, e if err != nil { return nil, fmt.Errorf("createBulkInsertPayload: %w", err) } + err = json.NewEncoder(payload).Encode(ast) if err != nil { return nil, fmt.Errorf("error serialising record: %w", err) diff --git a/store/elasticsearch/search.go b/store/elasticsearch/search.go index 84a0a245..a53e39fc 100644 --- a/store/elasticsearch/search.go +++ b/store/elasticsearch/search.go @@ -21,6 +21,8 @@ const ( suggesterName = "name-phrase-suggest" ) +var returnedAssetFieldsResult = []string{"id", "urn", "type", "service", "name", "description", "data", "labels", "created_at", "updated_at"} + type SearcherConfig struct { Client *elasticsearch.Client } @@ -77,6 +79,7 @@ func (sr *Searcher) Search(ctx context.Context, cfg discovery.SearchConfig) (res sr.cli.Search.WithIndex(indices...), sr.cli.Search.WithSize(maxResults), sr.cli.Search.WithIgnoreUnavailable(true), + sr.cli.Search.WithSourceIncludes(returnedAssetFieldsResult...), sr.cli.Search.WithContext(ctx), ) if err != nil { diff --git a/store/postgres/asset_model.go b/store/postgres/asset_model.go index d7ed9eea..91e372cb 100644 --- a/store/postgres/asset_model.go +++ b/store/postgres/asset_model.go @@ -50,18 +50,18 @@ func (a *AssetModel) toAsset(owners []user.User) asset.Asset { } } -func (a *AssetModel) toAssetVersion() (asset.AssetVersion, error) { +func (a *AssetModel) toAssetVersion() (asset.Asset, error) { var clog diff.Changelog err := a.Changelog.Unmarshal(&clog) if err != nil { - return asset.AssetVersion{}, err + return asset.Asset{}, err } - return asset.AssetVersion{ + return asset.Asset{ ID: a.ID, URN: a.URN, - Type: a.Type, + Type: asset.Type(a.Type), Service: a.Service, Version: a.Version, Changelog: clog, diff --git a/store/postgres/asset_repository.go b/store/postgres/asset_repository.go index b3f379fc..33966f51 100644 --- a/store/postgres/asset_repository.go +++ b/store/postgres/asset_repository.go @@ -146,7 +146,7 @@ func (r *AssetRepository) Find(ctx context.Context, assetURN string, assetType a } // GetVersionHistory retrieves the previous versions of an asset -func (r *AssetRepository) GetVersionHistory(ctx context.Context, cfg asset.Config, id string) (avs []asset.AssetVersion, err error) { +func (r *AssetRepository) GetVersionHistory(ctx context.Context, cfg asset.Config, id string) (avs []asset.Asset, err error) { if !isValidUUID(id) { err = asset.InvalidError{AssetID: id} return diff --git a/store/postgres/asset_repository_test.go b/store/postgres/asset_repository_test.go index 9492fafe..3bc36877 100644 --- a/store/postgres/asset_repository_test.go +++ b/store/postgres/asset_repository_test.go @@ -411,7 +411,7 @@ func (r *AssetRepositoryTestSuite) TestVersions() { r.Run("should return 3 last versions of an assets if there are exist", func() { - expectedAssetVersions := []asset.AssetVersion{ + expectedAssetVersions := []asset.Asset{ { ID: astVersioning.ID, URN: assetURN, diff --git a/tag/tag.go b/tag/tag.go index 44320d8a..37c8bbf5 100644 --- a/tag/tag.go +++ b/tag/tag.go @@ -1,6 +1,6 @@ package tag -//go:generate mockery --name TagRepository --outpkg mocks --output ../lib/mocks/ --structname TagRepository --filename tag_repository.go +//go:generate mockery --name TagRepository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname TagRepository --filename tag_repository.go import ( "context" diff --git a/tag/tag_template.go b/tag/tag_template.go index 83a6ea70..3dbadc8f 100644 --- a/tag/tag_template.go +++ b/tag/tag_template.go @@ -1,6 +1,6 @@ package tag -//go:generate mockery --name TagTemplateRepository --outpkg mocks --output ../lib/mocks/ --structname TagTemplateRepository --filename tag_template_repository.go +//go:generate mockery --name TagTemplateRepository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname TagTemplateRepository --filename tag_template_repository.go import ( "context" diff --git a/third_party/OpenAPI/compass.swagger.json b/third_party/OpenAPI/compass.swagger.json index b30d3975..370203d4 100644 --- a/third_party/OpenAPI/compass.swagger.json +++ b/third_party/OpenAPI/compass.swagger.json @@ -24,15 +24,16 @@ "application/json" ], "paths": { - "/v1beta1/discussions": { + "/v1beta1/assets": { "get": { - "summary": "Get all discussions", - "operationId": "CompassService_GetAllDiscussions", + "summary": "Get list of assets", + "description": "Returns list of assets, optionally filtered by type and service", + "operationId": "CompassService_GetAllAssets", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1beta1GetAllDiscussionsResponse" + "$ref": "#/definitions/v1beta1GetAllAssetsResponse" } }, "default": { @@ -44,55 +45,29 @@ }, "parameters": [ { - "name": "type", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "state", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "owner", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "assignee", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "asset", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "labels", + "name": "text", + "description": "filter by text", "in": "query", "required": false, "type": "string" }, { - "name": "sort", + "name": "type", + "description": "filter by type", "in": "query", "required": false, "type": "string" }, { - "name": "direction", + "name": "service", + "description": "filter by service", "in": "query", "required": false, "type": "string" }, { "name": "size", + "description": "maximum size to fetch", "in": "query", "required": false, "type": "integer", @@ -100,24 +75,33 @@ }, { "name": "offset", + "description": "offset to fetch from", "in": "query", "required": false, "type": "integer", "format": "int64" + }, + { + "name": "withTotal", + "description": "if set include total field in response", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ - "Discussion" + "Asset" ] }, - "post": { - "summary": "Create a discussion", - "operationId": "CompassService_CreateDiscussion", + "put": { + "summary": "Upsert an asset", + "description": "Create a new asset if a combination of urn, type and service does not exist. If exists update instead", + "operationId": "CompassService_UpsertAsset", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1beta1CreateDiscussionResponse" + "$ref": "#/definitions/v1beta1UpsertAssetResponse" } }, "default": { @@ -133,24 +117,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v1beta1CreateDiscussionRequest" + "$ref": "#/definitions/v1beta1UpsertAssetRequest" } } ], "tags": [ - "Discussion" + "Asset" ] - } - }, - "/v1beta1/discussions/{discussionId}/comments": { - "get": { - "summary": "Get all comments of a discussion", - "operationId": "CompassService_GetAllComments", + }, + "patch": { + "summary": "Patch/Create an asset", + "description": "Similar to Upsert but with patch strategy and different body format", + "operationId": "CompassService_UpsertPatchAsset", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1beta1GetAllCommentsResponse" + "$ref": "#/definitions/v1beta1UpsertPatchAssetResponse" } }, "default": { @@ -162,51 +145,29 @@ }, "parameters": [ { - "name": "discussionId", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" - }, - { - "name": "sort", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "direction", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "size", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" + "schema": { + "$ref": "#/definitions/v1beta1UpsertPatchAssetRequest" + } } ], "tags": [ - "Discussion", - "Comment" + "Asset" ] - }, - "post": { - "summary": "Create a comment of a discussion", - "operationId": "CompassService_CreateComment", + } + }, + "/v1beta1/assets/{id}": { + "get": { + "summary": "Find an asset", + "description": "Returns a single asset with given ID", + "operationId": "CompassService_GetAssetByID", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1beta1CreateCommentResponse" + "$ref": "#/definitions/v1beta1GetAssetByIDResponse" } }, "default": { @@ -218,45 +179,25 @@ }, "parameters": [ { - "name": "discussionId", + "name": "id", "in": "path", "required": true, "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "body": { - "type": "string" - } - }, - "description": "Request to be sent to create a comment", - "title": "CreateCommentRequest", - "required": [ - "body" - ] - } } ], "tags": [ - "Discussion", - "Comment" + "Asset" ] - } - }, - "/v1beta1/discussions/{discussionId}/comments/{id}": { - "get": { - "summary": "Get a comment of a discussion", - "operationId": "CompassService_GetComment", + }, + "delete": { + "summary": "Delete an asset", + "description": "Delete a single asset with given ID", + "operationId": "CompassService_DeleteAsset", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1beta1GetCommentResponse" + "$ref": "#/definitions/v1beta1DeleteAssetResponse" } }, "default": { @@ -267,12 +208,6 @@ } }, "parameters": [ - { - "name": "discussionId", - "in": "path", - "required": true, - "type": "string" - }, { "name": "id", "in": "path", @@ -281,18 +216,20 @@ } ], "tags": [ - "Discussion", - "Comment" + "Asset" ] - }, - "delete": { - "summary": "Delete a comment of a discussion", - "operationId": "CompassService_DeleteComment", + } + }, + "/v1beta1/assets/{id}/stargazers": { + "get": { + "summary": "Find users that stars an asset", + "description": "Returns a list of users that stars an asset", + "operationId": "CompassService_GetAssetStargazers", "responses": { "200": { "description": "A successful response.", "schema": { - "properties": {} + "$ref": "#/definitions/v1beta1GetAssetStargazersResponse" } }, "default": { @@ -304,31 +241,41 @@ }, "parameters": [ { - "name": "discussionId", + "name": "id", "in": "path", "required": true, "type": "string" }, { - "name": "id", - "in": "path", - "required": true, - "type": "string" + "name": "size", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" } ], "tags": [ - "Discussion", - "Comment" + "Asset" ] - }, - "put": { - "summary": "Update a comment of a discussion", - "operationId": "CompassService_UpdateComment", + } + }, + "/v1beta1/assets/{id}/versions": { + "get": { + "summary": "Get version history of an asset", + "description": "Returns a list of asset version history", + "operationId": "CompassService_GetAssetVersionHistory", "responses": { "200": { "description": "A successful response.", "schema": { - "properties": {} + "$ref": "#/definitions/v1beta1GetAssetVersionHistoryResponse" } }, "default": { @@ -340,47 +287,41 @@ }, "parameters": [ { - "name": "discussionId", + "name": "id", "in": "path", "required": true, "type": "string" }, { - "name": "id", - "in": "path", - "required": true, - "type": "string" + "name": "size", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "body": { - "type": "string" - } - }, - "title": "UpdateCommentRequest" - } + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" } ], "tags": [ - "Discussion", - "Comment" + "Asset" ] } }, - "/v1beta1/discussions/{id}": { + "/v1beta1/assets/{id}/versions/{version}": { "get": { - "summary": "Get a discussion", - "operationId": "CompassService_GetDiscussion", + "summary": "Get asset's previous version", + "description": "Returns a specific version of an asset", + "operationId": "CompassService_GetAssetByVersion", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1beta1GetDiscussionResponse" + "$ref": "#/definitions/v1beta1GetAssetByVersionResponse" } }, "default": { @@ -396,20 +337,28 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "type": "string" } ], "tags": [ - "Discussion" + "Asset" ] - }, - "patch": { - "summary": "Patch a discussion", - "operationId": "CompassService_PatchDiscussion", + } + }, + "/v1beta1/discussions": { + "get": { + "summary": "Get all discussions", + "operationId": "CompassService_GetAllDiscussions", "responses": { "200": { "description": "A successful response.", "schema": { - "properties": {} + "$ref": "#/definitions/v1beta1GetAllDiscussionsResponse" } }, "default": { @@ -421,36 +370,413 @@ }, "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "type", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "body": { - "type": "string" - }, - "type": { - "type": "string" - }, - "state": { - "type": "string" - }, - "labels": { - "type": "array", - "items": { - "type": "string" - } - }, + "name": "state", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "owner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "assignee", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "asset", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "labels", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "sort", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "direction", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "size", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "Discussion" + ] + }, + "post": { + "summary": "Create a discussion", + "operationId": "CompassService_CreateDiscussion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1CreateDiscussionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1beta1CreateDiscussionRequest" + } + } + ], + "tags": [ + "Discussion" + ] + } + }, + "/v1beta1/discussions/{discussionId}/comments": { + "get": { + "summary": "Get all comments of a discussion", + "operationId": "CompassService_GetAllComments", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetAllCommentsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "discussionId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "sort", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "direction", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "size", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "offset", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "Discussion", + "Comment" + ] + }, + "post": { + "summary": "Create a comment of a discussion", + "operationId": "CompassService_CreateComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1CreateCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "discussionId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string" + } + }, + "description": "Request to be sent to create a comment", + "title": "CreateCommentRequest", + "required": [ + "body" + ] + } + } + ], + "tags": [ + "Discussion", + "Comment" + ] + } + }, + "/v1beta1/discussions/{discussionId}/comments/{id}": { + "get": { + "summary": "Get a comment of a discussion", + "operationId": "CompassService_GetComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "discussionId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Discussion", + "Comment" + ] + }, + "delete": { + "summary": "Delete a comment of a discussion", + "operationId": "CompassService_DeleteComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1DeleteCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "discussionId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Discussion", + "Comment" + ] + }, + "put": { + "summary": "Update a comment of a discussion", + "operationId": "CompassService_UpdateComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1UpdateCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "discussionId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string" + } + }, + "title": "UpdateCommentRequest" + } + } + ], + "tags": [ + "Discussion", + "Comment" + ] + } + }, + "/v1beta1/discussions/{id}": { + "get": { + "summary": "Get a discussion", + "operationId": "CompassService_GetDiscussion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetDiscussionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Discussion" + ] + }, + "patch": { + "summary": "Patch a discussion", + "operationId": "CompassService_PatchDiscussion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1PatchDiscussionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "type": { + "type": "string" + }, + "state": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, "assets": { "type": "array", "items": { @@ -469,7 +795,151 @@ } ], "tags": [ - "Discussion" + "Discussion" + ] + } + }, + "/v1beta1/lineage/{urn}": { + "get": { + "summary": "Get Lineage Graph", + "description": "Get lineage graph of an asset", + "operationId": "CompassService_GetGraph", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1GetGraphResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "urn", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Lineage", + "Asset" + ] + } + }, + "/v1beta1/search": { + "get": { + "summary": "Search for an asset", + "description": "API for querying documents. 'text' is fuzzy matched against all the available datasets, and matched results are returned. You can specify additional match criteria using 'filter.*' query parameters. You can specify each filter multiple times to specify a set of values for those filters. For instance, to specify two landscape 'vn' and 'th', the query could be `/search/?text=\u003ctext\u003e\u0026filter.environment=integration\u0026filter.landscape=vn\u0026filter.landscape=th`", + "operationId": "CompassService_SearchAssets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1SearchAssetsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "text", + "description": "text to search for (fuzzy)", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "rankby", + "description": "descendingly sort based on a numeric field in the record. the nested field is written with period separated field name. eg, \"data.profile.usage_count\"", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "searchby", + "description": "search on a specific records field. the nested field is written with period separated field name. eg, \"data.schema.columns.name\"", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "size", + "description": "number of results to return", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "Search", + "Asset" + ] + } + }, + "/v1beta1/search/suggest": { + "get": { + "summary": "Suggest an asset", + "operationId": "CompassService_SuggestAssets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1beta1SuggestAssetsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "text", + "description": "text to search for (fuzzy)", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "rankby", + "description": "descendingly sort based on a numeric field in the record. the nested field is written with period separated field name. eg, \"data.profile.usage_count\"", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "searchby", + "description": "search on a specific records field. the nested field is written with period separated field name. eg, \"data.schema.columns.name\"", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "size", + "description": "number of results to return", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "Search", + "Asset" ] } } @@ -484,6 +954,14 @@ }, "additionalProperties": {} }, + "protobufNullValue": { + "type": "string", + "enum": [ + "NULL_VALUE" + ], + "default": "NULL_VALUE", + "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." + }, "rpcStatus": { "type": "object", "properties": { @@ -502,6 +980,92 @@ } } }, + "v1beta1Asset": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "urn": { + "type": "string" + }, + "type": { + "type": "string" + }, + "service": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "data": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "owners": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1User" + } + }, + "version": { + "type": "string" + }, + "updatedBy": { + "$ref": "#/definitions/v1beta1User" + }, + "changelog": { + "$ref": "#/definitions/v1beta1Changelog" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + }, + "title": "Asset" + }, + "v1beta1Change": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "path": { + "type": "array", + "items": { + "type": "string" + } + }, + "from": { + "type": "object" + }, + "to": { + "type": "object" + } + }, + "title": "Change" + }, + "v1beta1Changelog": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1Change" + } + } + }, + "title": "Changelog" + }, "v1beta1Comment": { "type": "object", "properties": { @@ -591,6 +1155,12 @@ }, "title": "CreateDiscussionResponse" }, + "v1beta1DeleteAssetResponse": { + "type": "object" + }, + "v1beta1DeleteCommentResponse": { + "type": "object" + }, "v1beta1Discussion": { "type": "object", "properties": { @@ -641,6 +1211,21 @@ }, "title": "Discussion" }, + "v1beta1GetAllAssetsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1Asset" + } + }, + "total": { + "type": "integer", + "format": "int64" + } + } + }, "v1beta1GetAllCommentsResponse": { "type": "object", "properties": { @@ -665,6 +1250,44 @@ }, "title": "GetAllDiscussionsResponse" }, + "v1beta1GetAssetByIDResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/v1beta1Asset" + } + } + }, + "v1beta1GetAssetByVersionResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/v1beta1Asset" + } + } + }, + "v1beta1GetAssetStargazersResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1User" + } + } + } + }, + "v1beta1GetAssetVersionHistoryResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1Asset" + } + } + } + }, "v1beta1GetCommentResponse": { "type": "object", "properties": { @@ -683,6 +1306,187 @@ }, "title": "GetDiscussionResponse" }, + "v1beta1GetGraphResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1LineageEdge" + } + } + } + }, + "v1beta1LineageEdge": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "target": { + "type": "string" + }, + "prop": { + "type": "object" + } + } + }, + "v1beta1LineageNode": { + "type": "object", + "properties": { + "urn": { + "type": "string" + }, + "type": { + "type": "string" + }, + "service": { + "type": "string" + } + } + }, + "v1beta1PatchDiscussionResponse": { + "type": "object" + }, + "v1beta1SearchAssetsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1Asset" + } + } + } + }, + "v1beta1SuggestAssetsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1beta1UpdateCommentResponse": { + "type": "object" + }, + "v1beta1UpsertAssetRequest": { + "type": "object", + "properties": { + "asset": { + "$ref": "#/definitions/v1beta1UpsertAssetRequestBaseAsset" + }, + "upstreams": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1LineageNode" + } + }, + "downstreams": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1LineageNode" + } + } + } + }, + "v1beta1UpsertAssetRequestBaseAsset": { + "type": "object", + "properties": { + "urn": { + "type": "string" + }, + "type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "service": { + "type": "string" + }, + "description": { + "type": "string", + "description": "description of an asset" + }, + "data": { + "type": "object" + }, + "labels": { + "type": "object", + "description": "labels of an asset" + } + } + }, + "v1beta1UpsertAssetResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "v1beta1UpsertPatchAssetRequest": { + "type": "object", + "properties": { + "asset": { + "$ref": "#/definitions/v1beta1UpsertPatchAssetRequestBaseAsset" + }, + "upstreams": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1LineageNode" + } + }, + "downstreams": { + "type": "array", + "items": { + "$ref": "#/definitions/v1beta1LineageNode" + } + } + } + }, + "v1beta1UpsertPatchAssetRequestBaseAsset": { + "type": "object", + "properties": { + "urn": { + "type": "string" + }, + "type": { + "type": "string" + }, + "name": { + "type": "string", + "description": "name of an asset" + }, + "service": { + "type": "string" + }, + "description": { + "type": "string", + "description": "description of an asset" + }, + "data": { + "type": "object", + "description": "dynamic data of an asset" + }, + "labels": { + "type": "object", + "description": "labels of an asset" + } + } + }, + "v1beta1UpsertPatchAssetResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, "v1beta1User": { "type": "object", "properties": { diff --git a/user/user.go b/user/user.go index 1bd1cdb8..e6c0455f 100644 --- a/user/user.go +++ b/user/user.go @@ -1,6 +1,6 @@ package user -//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --structname UserRepository --filename user_repository.go +//go:generate mockery --name Repository --outpkg mocks --output ../lib/mocks/ --with-expecter --structname UserRepository --filename user_repository.go import ( "context" "time" @@ -20,23 +20,47 @@ type User struct { // ToProto transforms struct to proto func (d User) ToProto() *compassv1beta1.User { + if d.ID == "" { + return nil + } + + var createdAtPB *timestamppb.Timestamp + if !d.CreatedAt.IsZero() { + createdAtPB = timestamppb.New(d.CreatedAt) + } + + var updatedAtPB *timestamppb.Timestamp + if !d.UpdatedAt.IsZero() { + updatedAtPB = timestamppb.New(d.UpdatedAt) + } + return &compassv1beta1.User{ - Id: d.ID, - Email: d.Email, - // Provider: d.Provider, //TODO add in proto - CreatedAt: timestamppb.New(d.CreatedAt), - UpdatedAt: timestamppb.New(d.UpdatedAt), + Id: d.ID, + Email: d.Email, + Provider: d.Provider, + CreatedAt: createdAtPB, + UpdatedAt: updatedAtPB, } } // NewFromProto transforms proto to struct func NewFromProto(proto *compassv1beta1.User) User { + var createdAt time.Time + if proto.GetCreatedAt() != nil { + createdAt = proto.GetCreatedAt().AsTime() + } + + var updatedAt time.Time + if proto.GetUpdatedAt() != nil { + updatedAt = proto.GetUpdatedAt().AsTime() + } + return User{ - ID: proto.Id, - Email: proto.Email, - // Provider: d.Provider, //TODO add in proto - CreatedAt: proto.CreatedAt.AsTime(), - UpdatedAt: proto.UpdatedAt.AsTime(), + ID: proto.GetId(), + Email: proto.GetEmail(), + Provider: proto.GetProvider(), + CreatedAt: createdAt, + UpdatedAt: updatedAt, } } diff --git a/user/user_test.go b/user/user_test.go index 43684430..95983568 100644 --- a/user/user_test.go +++ b/user/user_test.go @@ -1,9 +1,15 @@ package user import ( + "reflect" "testing" + "time" + "github.com/google/go-cmp/cmp" + compassv1beta1 "github.com/odpf/columbus/api/proto/odpf/compass/v1beta1" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/timestamppb" ) func TestValidate(t *testing.T) { @@ -38,3 +44,70 @@ func TestValidate(t *testing.T) { }) } } + +func TestToProto(t *testing.T) { + timeDummy := time.Date(2000, time.January, 7, 0, 0, 0, 0, time.UTC) + type testCase struct { + Title string + User *User + ExpectProto *compassv1beta1.User + } + + var testCases = []testCase{ + { + Title: "should return nil if ID is empty", + User: &User{}, + ExpectProto: nil, + }, + { + Title: "should return no timestamp pb if timestamp is zero", + User: &User{ID: "id1", Provider: "provider"}, + ExpectProto: &compassv1beta1.User{Id: "id1", Provider: "provider"}, + }, + { + Title: "should return timestamp pb if timestamp is not zero", + User: &User{ID: "id1", Provider: "provider", CreatedAt: timeDummy, UpdatedAt: timeDummy}, + ExpectProto: &compassv1beta1.User{Id: "id1", Provider: "provider", CreatedAt: timestamppb.New(timeDummy), UpdatedAt: timestamppb.New(timeDummy)}, + }, + } + for _, tc := range testCases { + t.Run(tc.Title, func(t *testing.T) { + + got := tc.User.ToProto() + if diff := cmp.Diff(got, tc.ExpectProto, protocmp.Transform()); diff != "" { + t.Errorf("expected response to be %+v, was %+v", tc.ExpectProto, got) + } + }) + } +} + +func TestNewFromProto(t *testing.T) { + timeDummy := time.Date(2000, time.January, 7, 0, 0, 0, 0, time.UTC) + type testCase struct { + Title string + UserPB *compassv1beta1.User + ExpectUser User + } + + var testCases = []testCase{ + { + Title: "should return non empty time.Time if timestamp pb is not zero", + UserPB: &compassv1beta1.User{Id: "id1", Provider: "provider", CreatedAt: timestamppb.New(timeDummy), UpdatedAt: timestamppb.New(timeDummy)}, + ExpectUser: User{ID: "id1", Provider: "provider", CreatedAt: timeDummy, UpdatedAt: timeDummy}, + }, + { + Title: "should return empty time.Time if timestamp pb is zero", + UserPB: &compassv1beta1.User{Id: "id1", Provider: "provider"}, + ExpectUser: User{ID: "id1", Provider: "provider"}, + }, + } + for _, tc := range testCases { + t.Run(tc.Title, func(t *testing.T) { + + got := NewFromProto(tc.UserPB) + if reflect.DeepEqual(got, tc.ExpectUser) == false { + t.Errorf("expected returned asset to be to be %+v, was %+v", tc.ExpectUser, got) + } + }) + } +}