diff --git a/Makefile b/Makefile index a6e9fbb..b6d0a10 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,6 @@ cover-svg: before-push: go mod tidy gofumpt -l -w . - golangci-lint run ./... \ No newline at end of file + golangci-lint run ./... + + diff --git a/gen/external/questions/v1/admin.pb.go b/gen/external/questions/v1/admin.pb.go index 12a3a7e..0345dfa 100644 --- a/gen/external/questions/v1/admin.pb.go +++ b/gen/external/questions/v1/admin.pb.go @@ -136,9 +136,11 @@ func (Sort) EnumDescriptor() ([]byte, []int) { return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{1} } +// * +// Represents a request argument for creating new category type CreateCategoryRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Field is a name for new category unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -180,9 +182,11 @@ func (x *CreateCategoryRequest) GetName() string { return "" } +// * +// Represents a response result of a request for creating category type CreateCategoryResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID is ID of created category unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -224,15 +228,17 @@ func (x *CreateCategoryResponse) GetId() int32 { return 0 } +// * +// Represents a request argument for creating new questions with options type CreateQuestionRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=questionsservice.v1.Type" json:"type,omitempty"` - Difficulty Difficulty `protobuf:"varint,2,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` - CategoryId int32 `protobuf:"varint,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` - Options []*Option `protobuf:"bytes,5,rep,name=options,proto3" json:"options,omitempty"` - Language string `protobuf:"bytes,6,opt,name=language,proto3" json:"language,omitempty"` - MediaUrl *string `protobuf:"bytes,7,opt,name=media_url,json=mediaUrl,proto3,oneof" json:"media_url,omitempty"` + Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=questionsservice.v1.Type" json:"type,omitempty"` // Question type + Difficulty Difficulty `protobuf:"varint,2,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` // Difficulty of the question + CategoryId int32 `protobuf:"varint,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` // Question's category ID + Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` // Text of the question + Options []*Option `protobuf:"bytes,5,rep,name=options,proto3" json:"options,omitempty"` // Possible answers for the question + Language string `protobuf:"bytes,6,opt,name=language,proto3" json:"language,omitempty"` // Language of the question + MediaUrl *string `protobuf:"bytes,7,opt,name=media_url,json=mediaUrl,proto3,oneof" json:"media_url,omitempty"` // Media URL if it has unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -316,6 +322,70 @@ func (x *CreateQuestionRequest) GetMediaUrl() string { return "" } +// * +// Represents a request argument for creating and appending a option for existing question +type CreateQuestionOptionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + QuestionId string `protobuf:"bytes,1,opt,name=question_id,json=questionId,proto3" json:"question_id,omitempty"` // ID of a question + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // Text for new option + IsCorrect bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3" json:"is_correct,omitempty"` // Is option correct answer or not + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateQuestionOptionRequest) Reset() { + *x = CreateQuestionOptionRequest{} + mi := &file_external_questions_v1_admin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateQuestionOptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateQuestionOptionRequest) ProtoMessage() {} + +func (x *CreateQuestionOptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_questions_v1_admin_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateQuestionOptionRequest.ProtoReflect.Descriptor instead. +func (*CreateQuestionOptionRequest) Descriptor() ([]byte, []int) { + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateQuestionOptionRequest) GetQuestionId() string { + if x != nil { + return x.QuestionId + } + return "" +} + +func (x *CreateQuestionOptionRequest) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *CreateQuestionOptionRequest) GetIsCorrect() bool { + if x != nil { + return x.IsCorrect + } + return false +} + +// * +// Represents a argument of update category request type UpdateCategoryRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -326,7 +396,7 @@ type UpdateCategoryRequest struct { func (x *UpdateCategoryRequest) Reset() { *x = UpdateCategoryRequest{} - mi := &file_external_questions_v1_admin_proto_msgTypes[3] + mi := &file_external_questions_v1_admin_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -338,7 +408,7 @@ func (x *UpdateCategoryRequest) String() string { func (*UpdateCategoryRequest) ProtoMessage() {} func (x *UpdateCategoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[3] + mi := &file_external_questions_v1_admin_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -351,7 +421,7 @@ func (x *UpdateCategoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateCategoryRequest.ProtoReflect.Descriptor instead. func (*UpdateCategoryRequest) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{3} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{4} } func (x *UpdateCategoryRequest) GetId() int32 { @@ -368,21 +438,23 @@ func (x *UpdateCategoryRequest) GetName() string { return "" } +// * +// Represents a request argument for update question data, allows edit types, difficulty, category, text and language type UpdateQuestionRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type *Type `protobuf:"varint,2,opt,name=type,proto3,enum=questionsservice.v1.Type,oneof" json:"type,omitempty"` - Difficulty *Difficulty `protobuf:"varint,3,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty,oneof" json:"difficulty,omitempty"` - CategoryId *int32 `protobuf:"varint,4,opt,name=category_id,json=categoryId,proto3,oneof" json:"category_id,omitempty"` - Text *string `protobuf:"bytes,5,opt,name=text,proto3,oneof" json:"text,omitempty"` - Language *string `protobuf:"bytes,6,opt,name=language,proto3,oneof" json:"language,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the question + Type *Type `protobuf:"varint,2,opt,name=type,proto3,enum=questionsservice.v1.Type,oneof" json:"type,omitempty"` // New type + Difficulty *Difficulty `protobuf:"varint,3,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty,oneof" json:"difficulty,omitempty"` // New difficulty + CategoryId *int32 `protobuf:"varint,4,opt,name=category_id,json=categoryId,proto3,oneof" json:"category_id,omitempty"` // New category of the question + Text *string `protobuf:"bytes,5,opt,name=text,proto3,oneof" json:"text,omitempty"` // New text of the question + Language *string `protobuf:"bytes,6,opt,name=language,proto3,oneof" json:"language,omitempty"` // New language for the language unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateQuestionRequest) Reset() { *x = UpdateQuestionRequest{} - mi := &file_external_questions_v1_admin_proto_msgTypes[4] + mi := &file_external_questions_v1_admin_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -394,7 +466,7 @@ func (x *UpdateQuestionRequest) String() string { func (*UpdateQuestionRequest) ProtoMessage() {} func (x *UpdateQuestionRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[4] + mi := &file_external_questions_v1_admin_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -407,7 +479,7 @@ func (x *UpdateQuestionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateQuestionRequest.ProtoReflect.Descriptor instead. func (*UpdateQuestionRequest) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{4} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{5} } func (x *UpdateQuestionRequest) GetId() string { @@ -452,18 +524,20 @@ func (x *UpdateQuestionRequest) GetLanguage() string { return "" } +// * +// Represents a request argument for update question's option type UpdateQuestionOptionRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Text *string `protobuf:"bytes,2,opt,name=text,proto3,oneof" json:"text,omitempty"` - IsCorrect *bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3,oneof" json:"is_correct,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the option + Text *string `protobuf:"bytes,2,opt,name=text,proto3,oneof" json:"text,omitempty"` // New text for option + IsCorrect *bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3,oneof" json:"is_correct,omitempty"` // Is it right option or not unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateQuestionOptionRequest) Reset() { *x = UpdateQuestionOptionRequest{} - mi := &file_external_questions_v1_admin_proto_msgTypes[5] + mi := &file_external_questions_v1_admin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -475,7 +549,7 @@ func (x *UpdateQuestionOptionRequest) String() string { func (*UpdateQuestionOptionRequest) ProtoMessage() {} func (x *UpdateQuestionOptionRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[5] + mi := &file_external_questions_v1_admin_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -488,7 +562,7 @@ func (x *UpdateQuestionOptionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateQuestionOptionRequest.ProtoReflect.Descriptor instead. func (*UpdateQuestionOptionRequest) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{5} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{6} } func (x *UpdateQuestionOptionRequest) GetId() string { @@ -512,6 +586,8 @@ func (x *UpdateQuestionOptionRequest) GetIsCorrect() bool { return false } +// * +// Represent argument for deleting question request type DeleteQuestionRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -521,7 +597,7 @@ type DeleteQuestionRequest struct { func (x *DeleteQuestionRequest) Reset() { *x = DeleteQuestionRequest{} - mi := &file_external_questions_v1_admin_proto_msgTypes[6] + mi := &file_external_questions_v1_admin_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -533,7 +609,7 @@ func (x *DeleteQuestionRequest) String() string { func (*DeleteQuestionRequest) ProtoMessage() {} func (x *DeleteQuestionRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[6] + mi := &file_external_questions_v1_admin_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -546,7 +622,7 @@ func (x *DeleteQuestionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteQuestionRequest.ProtoReflect.Descriptor instead. func (*DeleteQuestionRequest) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{6} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{7} } func (x *DeleteQuestionRequest) GetId() string { @@ -556,6 +632,8 @@ func (x *DeleteQuestionRequest) GetId() string { return "" } +// * +// Represent argument for deleting question's option request type DeleteQuestionOptionRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -565,7 +643,7 @@ type DeleteQuestionOptionRequest struct { func (x *DeleteQuestionOptionRequest) Reset() { *x = DeleteQuestionOptionRequest{} - mi := &file_external_questions_v1_admin_proto_msgTypes[7] + mi := &file_external_questions_v1_admin_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -577,7 +655,7 @@ func (x *DeleteQuestionOptionRequest) String() string { func (*DeleteQuestionOptionRequest) ProtoMessage() {} func (x *DeleteQuestionOptionRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[7] + mi := &file_external_questions_v1_admin_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -590,7 +668,7 @@ func (x *DeleteQuestionOptionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteQuestionOptionRequest.ProtoReflect.Descriptor instead. func (*DeleteQuestionOptionRequest) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{7} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{8} } func (x *DeleteQuestionOptionRequest) GetId() string { @@ -600,24 +678,26 @@ func (x *DeleteQuestionOptionRequest) GetId() string { return "" } +// * +// Represents a componential argument of request for getting paginated questions with filters type GetFilteredQuestionsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - Order *Order `protobuf:"varint,3,opt,name=order,proto3,enum=questionsservice.v1.Order,oneof" json:"order,omitempty"` - Sort *Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=questionsservice.v1.Sort,oneof" json:"sort,omitempty"` - TypeFilter *TypeFilter `protobuf:"bytes,5,opt,name=type_filter,json=typeFilter,proto3,oneof" json:"type_filter,omitempty"` - DifficultyFilter *DifficultyFilter `protobuf:"bytes,6,opt,name=difficulty_filter,json=difficultyFilter,proto3,oneof" json:"difficulty_filter,omitempty"` - CategoryFilter *CategoryFilter `protobuf:"bytes,7,opt,name=category_filter,json=categoryFilter,proto3,oneof" json:"category_filter,omitempty"` - LanguageFilter *LanguageFilter `protobuf:"bytes,8,opt,name=language_filter,json=languageFilter,proto3,oneof" json:"language_filter,omitempty"` - CreateAtFilter *CreatedAtFilter `protobuf:"bytes,9,opt,name=create_at_filter,json=createAtFilter,proto3,oneof" json:"create_at_filter,omitempty"` + Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // Page of the requested content, by default must me 1 + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` // Amount of requesting questions + Order *Order `protobuf:"varint,3,opt,name=order,proto3,enum=questionsservice.v1.Order,oneof" json:"order,omitempty"` // What order should be + Sort *Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=questionsservice.v1.Sort,oneof" json:"sort,omitempty"` // Sort of the resulted questions + TypeFilter *TypeFilter `protobuf:"bytes,5,opt,name=type_filter,json=typeFilter,proto3,oneof" json:"type_filter,omitempty"` // What type of question should be + DifficultyFilter *DifficultyFilter `protobuf:"bytes,6,opt,name=difficulty_filter,json=difficultyFilter,proto3,oneof" json:"difficulty_filter,omitempty"` // Desired difficulty of questions + CategoryFilter *CategoryFilter `protobuf:"bytes,7,opt,name=category_filter,json=categoryFilter,proto3,oneof" json:"category_filter,omitempty"` // Desired category + LanguageFilter *LanguageFilter `protobuf:"bytes,8,opt,name=language_filter,json=languageFilter,proto3,oneof" json:"language_filter,omitempty"` // What language of questions + CreateAtFilter *CreatedAtFilter `protobuf:"bytes,9,opt,name=create_at_filter,json=createAtFilter,proto3,oneof" json:"create_at_filter,omitempty"` // When questions were created unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GetFilteredQuestionsRequest) Reset() { *x = GetFilteredQuestionsRequest{} - mi := &file_external_questions_v1_admin_proto_msgTypes[8] + mi := &file_external_questions_v1_admin_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -629,7 +709,7 @@ func (x *GetFilteredQuestionsRequest) String() string { func (*GetFilteredQuestionsRequest) ProtoMessage() {} func (x *GetFilteredQuestionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[8] + mi := &file_external_questions_v1_admin_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -642,7 +722,7 @@ func (x *GetFilteredQuestionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFilteredQuestionsRequest.ProtoReflect.Descriptor instead. func (*GetFilteredQuestionsRequest) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{8} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{9} } func (x *GetFilteredQuestionsRequest) GetPage() uint64 { @@ -708,21 +788,23 @@ func (x *GetFilteredQuestionsRequest) GetCreateAtFilter() *CreatedAtFilter { return nil } +// * +// Represents a response of requested, filtered and paginated questions type GetFilteredQuestionsResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - Questions []*Question `protobuf:"bytes,1,rep,name=questions,proto3" json:"questions,omitempty"` - Page uint64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` - Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - Order Order `protobuf:"varint,4,opt,name=order,proto3,enum=questionsservice.v1.Order" json:"order,omitempty"` - Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=questionsservice.v1.Sort" json:"sort,omitempty"` - Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + Questions []*Question `protobuf:"bytes,1,rep,name=questions,proto3" json:"questions,omitempty"` // List of resulted questions + Page uint64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // Current requested page + Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` // Amount of current + Order Order `protobuf:"varint,4,opt,name=order,proto3,enum=questionsservice.v1.Order" json:"order,omitempty"` // Order of resulted questions list + Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=questionsservice.v1.Sort" json:"sort,omitempty"` // Sort of resulted questions list + Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` // Total amount of possible to request with the same request filter questions unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GetFilteredQuestionsResponse) Reset() { *x = GetFilteredQuestionsResponse{} - mi := &file_external_questions_v1_admin_proto_msgTypes[9] + mi := &file_external_questions_v1_admin_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -734,7 +816,7 @@ func (x *GetFilteredQuestionsResponse) String() string { func (*GetFilteredQuestionsResponse) ProtoMessage() {} func (x *GetFilteredQuestionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[9] + mi := &file_external_questions_v1_admin_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -747,7 +829,7 @@ func (x *GetFilteredQuestionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFilteredQuestionsResponse.ProtoReflect.Descriptor instead. func (*GetFilteredQuestionsResponse) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{9} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{10} } func (x *GetFilteredQuestionsResponse) GetQuestions() []*Question { @@ -794,14 +876,14 @@ func (x *GetFilteredQuestionsResponse) GetAmount() int64 { type TypeFilter struct { state protoimpl.MessageState `protogen:"open.v1"` - Types []Type `protobuf:"varint,1,rep,packed,name=types,proto3,enum=questionsservice.v1.Type" json:"types,omitempty"` + Types []Type `protobuf:"varint,1,rep,packed,name=types,proto3,enum=questionsservice.v1.Type" json:"types,omitempty"` // List of desired questions types unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *TypeFilter) Reset() { *x = TypeFilter{} - mi := &file_external_questions_v1_admin_proto_msgTypes[10] + mi := &file_external_questions_v1_admin_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -813,7 +895,7 @@ func (x *TypeFilter) String() string { func (*TypeFilter) ProtoMessage() {} func (x *TypeFilter) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[10] + mi := &file_external_questions_v1_admin_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -826,7 +908,7 @@ func (x *TypeFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeFilter.ProtoReflect.Descriptor instead. func (*TypeFilter) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{10} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{11} } func (x *TypeFilter) GetTypes() []Type { @@ -838,14 +920,14 @@ func (x *TypeFilter) GetTypes() []Type { type DifficultyFilter struct { state protoimpl.MessageState `protogen:"open.v1"` - Difficulties []Difficulty `protobuf:"varint,1,rep,packed,name=difficulties,proto3,enum=questionsservice.v1.Difficulty" json:"difficulties,omitempty"` + Difficulties []Difficulty `protobuf:"varint,1,rep,packed,name=difficulties,proto3,enum=questionsservice.v1.Difficulty" json:"difficulties,omitempty"` // List of desired questions difficulties unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DifficultyFilter) Reset() { *x = DifficultyFilter{} - mi := &file_external_questions_v1_admin_proto_msgTypes[11] + mi := &file_external_questions_v1_admin_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -857,7 +939,7 @@ func (x *DifficultyFilter) String() string { func (*DifficultyFilter) ProtoMessage() {} func (x *DifficultyFilter) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[11] + mi := &file_external_questions_v1_admin_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -870,7 +952,7 @@ func (x *DifficultyFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use DifficultyFilter.ProtoReflect.Descriptor instead. func (*DifficultyFilter) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{11} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{12} } func (x *DifficultyFilter) GetDifficulties() []Difficulty { @@ -882,14 +964,14 @@ func (x *DifficultyFilter) GetDifficulties() []Difficulty { type CategoryFilter struct { state protoimpl.MessageState `protogen:"open.v1"` - Categories []int32 `protobuf:"varint,1,rep,packed,name=categories,proto3" json:"categories,omitempty"` + Categories []int32 `protobuf:"varint,1,rep,packed,name=categories,proto3" json:"categories,omitempty"` // List of desired questions categories unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CategoryFilter) Reset() { *x = CategoryFilter{} - mi := &file_external_questions_v1_admin_proto_msgTypes[12] + mi := &file_external_questions_v1_admin_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -901,7 +983,7 @@ func (x *CategoryFilter) String() string { func (*CategoryFilter) ProtoMessage() {} func (x *CategoryFilter) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[12] + mi := &file_external_questions_v1_admin_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -914,7 +996,7 @@ func (x *CategoryFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use CategoryFilter.ProtoReflect.Descriptor instead. func (*CategoryFilter) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{12} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{13} } func (x *CategoryFilter) GetCategories() []int32 { @@ -926,14 +1008,14 @@ func (x *CategoryFilter) GetCategories() []int32 { type LanguageFilter struct { state protoimpl.MessageState `protogen:"open.v1"` - Languages []string `protobuf:"bytes,1,rep,name=languages,proto3" json:"languages,omitempty"` + Languages []string `protobuf:"bytes,1,rep,name=languages,proto3" json:"languages,omitempty"` // List of desired questions languages unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *LanguageFilter) Reset() { *x = LanguageFilter{} - mi := &file_external_questions_v1_admin_proto_msgTypes[13] + mi := &file_external_questions_v1_admin_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -945,7 +1027,7 @@ func (x *LanguageFilter) String() string { func (*LanguageFilter) ProtoMessage() {} func (x *LanguageFilter) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[13] + mi := &file_external_questions_v1_admin_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -958,7 +1040,7 @@ func (x *LanguageFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use LanguageFilter.ProtoReflect.Descriptor instead. func (*LanguageFilter) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{13} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{14} } func (x *LanguageFilter) GetLanguages() []string { @@ -970,15 +1052,15 @@ func (x *LanguageFilter) GetLanguages() []string { type CreatedAtFilter struct { state protoimpl.MessageState `protogen:"open.v1"` - From *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - To *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + From *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // Start interval date for desired question + To *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` // End interval date for desired question unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CreatedAtFilter) Reset() { *x = CreatedAtFilter{} - mi := &file_external_questions_v1_admin_proto_msgTypes[14] + mi := &file_external_questions_v1_admin_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -990,7 +1072,7 @@ func (x *CreatedAtFilter) String() string { func (*CreatedAtFilter) ProtoMessage() {} func (x *CreatedAtFilter) ProtoReflect() protoreflect.Message { - mi := &file_external_questions_v1_admin_proto_msgTypes[14] + mi := &file_external_questions_v1_admin_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1003,7 +1085,7 @@ func (x *CreatedAtFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatedAtFilter.ProtoReflect.Descriptor instead. func (*CreatedAtFilter) Descriptor() ([]byte, []int) { - return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{14} + return file_external_questions_v1_admin_proto_rawDescGZIP(), []int{15} } func (x *CreatedAtFilter) GetFrom() *timestamppb.Timestamp { @@ -1058,193 +1140,206 @@ var file_external_questions_v1_admin_proto_rawDesc = string([]byte{ 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, - 0x75, 0x72, 0x6c, 0x22, 0x3b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0xbf, 0x02, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, - 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, 0x32, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x44, - 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x48, 0x01, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, - 0x79, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x0a, 0x63, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, - 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, - 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x0a, - 0x0b, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, - 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, - 0x67, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, + 0x75, 0x72, 0x6c, 0x22, 0x71, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, 0x69, - 0x73, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, - 0x01, 0x52, 0x09, 0x69, 0x73, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x42, - 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x69, 0x73, 0x5f, - 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 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, - 0x22, 0x2d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x22, - 0xc1, 0x05, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, - 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, - 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x32, - 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x48, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x88, - 0x01, 0x01, 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, - 0x70, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x0a, 0x74, 0x79, 0x70, 0x65, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x57, 0x0a, 0x11, 0x64, 0x69, 0x66, - 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, - 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x03, 0x52, 0x10, 0x64, - 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, - 0x01, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x71, 0x75, + 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x63, 0x6f, + 0x72, 0x72, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x43, + 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x22, 0x3b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, + 0x65, 0x73, 0x74, 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, 0x32, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x48, 0x04, 0x52, 0x0e, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x48, 0x05, 0x52, 0x0e, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x53, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x06, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, - 0x06, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x6f, 0x72, 0x74, - 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x6c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x13, - 0x0a, 0x11, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0xfc, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x04, 0x73, - 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, + 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x44, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x48, 0x01, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x0a, + 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x04, 0x74, + 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, + 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x42, + 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x12, 0x22, + 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x01, 0x52, 0x09, 0x69, 0x73, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x88, + 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x2d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x22, 0xc1, 0x05, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x3d, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x12, 0x2f, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, + 0x01, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x22, 0x57, 0x0a, 0x10, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0c, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0c, 0x64, 0x69, - 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x69, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x0e, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, - 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x0e, - 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1c, - 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x0f, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, - 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, - 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x2a, 0xa0, 0x01, 0x0a, 0x05, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, - 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x52, - 0x44, 0x45, 0x52, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x52, - 0x44, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, - 0x44, 0x45, 0x52, 0x5f, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, 0x4c, 0x54, 0x59, 0x10, 0x04, - 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, - 0x52, 0x59, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x4c, 0x41, - 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, 0x44, 0x45, - 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, 0x07, 0x2a, 0x39, - 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, - 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4f, - 0x52, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x02, 0x32, 0x9b, 0x06, 0x0a, 0x15, 0x51, 0x75, - 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x2e, 0x71, 0x75, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x48, 0x01, 0x52, 0x04, 0x73, 0x6f, + 0x72, 0x74, 0x88, 0x01, 0x01, 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x0a, 0x74, + 0x79, 0x70, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x57, 0x0a, 0x11, + 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, + 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x03, + 0x52, 0x10, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x48, 0x04, 0x52, 0x0e, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x51, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x05, 0x52, 0x0e, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x53, 0x0a, 0x10, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x06, 0x52, 0x0e, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, + 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, + 0x6f, 0x72, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x12, 0x0a, + 0x10, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x5f, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xfc, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x30, 0x0a, 0x05, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, - 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x69, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x2d, + 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3d, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x22, 0x57, 0x0a, 0x10, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0c, 0x64, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 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, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 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, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 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, 0x12, 0x60, 0x0a, - 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x12, - 0x54, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, - 0x65, 0x73, 0x74, 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, 0x12, 0x60, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, - 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x42, 0x1a, 0x5a, 0x18, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, + 0x0c, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x69, 0x65, 0x73, 0x22, 0x30, 0x0a, + 0x0e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, + 0x2e, 0x0a, 0x0e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x22, + 0x6d, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x2a, 0xa0, + 0x01, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x49, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, + 0x0a, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, + 0x0a, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, + 0x10, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x44, 0x49, 0x46, 0x46, 0x49, 0x43, 0x55, 0x4c, 0x54, + 0x59, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x41, 0x54, + 0x45, 0x47, 0x4f, 0x52, 0x59, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, + 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x4f, + 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, + 0x07, 0x2a, 0x39, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, + 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x01, 0x12, 0x0d, 0x0a, + 0x09, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x02, 0x32, 0xfd, 0x06, 0x0a, + 0x15, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, + 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x31, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x65, 0x64, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, + 0x73, 0x74, 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, 0x12, 0x60, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x4f, 0x70, 0x74, 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, 0x12, 0x54, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 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, 0x12, 0x54, 0x0a, 0x0e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, + 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, + 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, 0x12, 0x60, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, + 0x70, 0x74, 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, 0x12, 0x54, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 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, 0x12, 0x60, 0x0a, 0x14, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 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, 0x42, 0x1a, 0x5a, 0x18, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -1260,70 +1355,73 @@ func file_external_questions_v1_admin_proto_rawDescGZIP() []byte { } var file_external_questions_v1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_external_questions_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_external_questions_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_external_questions_v1_admin_proto_goTypes = []any{ (Order)(0), // 0: questionsservice.v1.Order (Sort)(0), // 1: questionsservice.v1.Sort (*CreateCategoryRequest)(nil), // 2: questionsservice.v1.CreateCategoryRequest (*CreateCategoryResponse)(nil), // 3: questionsservice.v1.CreateCategoryResponse (*CreateQuestionRequest)(nil), // 4: questionsservice.v1.CreateQuestionRequest - (*UpdateCategoryRequest)(nil), // 5: questionsservice.v1.UpdateCategoryRequest - (*UpdateQuestionRequest)(nil), // 6: questionsservice.v1.UpdateQuestionRequest - (*UpdateQuestionOptionRequest)(nil), // 7: questionsservice.v1.UpdateQuestionOptionRequest - (*DeleteQuestionRequest)(nil), // 8: questionsservice.v1.DeleteQuestionRequest - (*DeleteQuestionOptionRequest)(nil), // 9: questionsservice.v1.DeleteQuestionOptionRequest - (*GetFilteredQuestionsRequest)(nil), // 10: questionsservice.v1.GetFilteredQuestionsRequest - (*GetFilteredQuestionsResponse)(nil), // 11: questionsservice.v1.GetFilteredQuestionsResponse - (*TypeFilter)(nil), // 12: questionsservice.v1.TypeFilter - (*DifficultyFilter)(nil), // 13: questionsservice.v1.DifficultyFilter - (*CategoryFilter)(nil), // 14: questionsservice.v1.CategoryFilter - (*LanguageFilter)(nil), // 15: questionsservice.v1.LanguageFilter - (*CreatedAtFilter)(nil), // 16: questionsservice.v1.CreatedAtFilter - (Type)(0), // 17: questionsservice.v1.Type - (Difficulty)(0), // 18: questionsservice.v1.Difficulty - (*Option)(nil), // 19: questionsservice.v1.Option - (*Question)(nil), // 20: questionsservice.v1.Question - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 22: google.protobuf.Empty + (*CreateQuestionOptionRequest)(nil), // 5: questionsservice.v1.CreateQuestionOptionRequest + (*UpdateCategoryRequest)(nil), // 6: questionsservice.v1.UpdateCategoryRequest + (*UpdateQuestionRequest)(nil), // 7: questionsservice.v1.UpdateQuestionRequest + (*UpdateQuestionOptionRequest)(nil), // 8: questionsservice.v1.UpdateQuestionOptionRequest + (*DeleteQuestionRequest)(nil), // 9: questionsservice.v1.DeleteQuestionRequest + (*DeleteQuestionOptionRequest)(nil), // 10: questionsservice.v1.DeleteQuestionOptionRequest + (*GetFilteredQuestionsRequest)(nil), // 11: questionsservice.v1.GetFilteredQuestionsRequest + (*GetFilteredQuestionsResponse)(nil), // 12: questionsservice.v1.GetFilteredQuestionsResponse + (*TypeFilter)(nil), // 13: questionsservice.v1.TypeFilter + (*DifficultyFilter)(nil), // 14: questionsservice.v1.DifficultyFilter + (*CategoryFilter)(nil), // 15: questionsservice.v1.CategoryFilter + (*LanguageFilter)(nil), // 16: questionsservice.v1.LanguageFilter + (*CreatedAtFilter)(nil), // 17: questionsservice.v1.CreatedAtFilter + (Type)(0), // 18: questionsservice.v1.Type + (Difficulty)(0), // 19: questionsservice.v1.Difficulty + (*Option)(nil), // 20: questionsservice.v1.Option + (*Question)(nil), // 21: questionsservice.v1.Question + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 23: google.protobuf.Empty } var file_external_questions_v1_admin_proto_depIdxs = []int32{ - 17, // 0: questionsservice.v1.CreateQuestionRequest.type:type_name -> questionsservice.v1.Type - 18, // 1: questionsservice.v1.CreateQuestionRequest.difficulty:type_name -> questionsservice.v1.Difficulty - 19, // 2: questionsservice.v1.CreateQuestionRequest.options:type_name -> questionsservice.v1.Option - 17, // 3: questionsservice.v1.UpdateQuestionRequest.type:type_name -> questionsservice.v1.Type - 18, // 4: questionsservice.v1.UpdateQuestionRequest.difficulty:type_name -> questionsservice.v1.Difficulty + 18, // 0: questionsservice.v1.CreateQuestionRequest.type:type_name -> questionsservice.v1.Type + 19, // 1: questionsservice.v1.CreateQuestionRequest.difficulty:type_name -> questionsservice.v1.Difficulty + 20, // 2: questionsservice.v1.CreateQuestionRequest.options:type_name -> questionsservice.v1.Option + 18, // 3: questionsservice.v1.UpdateQuestionRequest.type:type_name -> questionsservice.v1.Type + 19, // 4: questionsservice.v1.UpdateQuestionRequest.difficulty:type_name -> questionsservice.v1.Difficulty 0, // 5: questionsservice.v1.GetFilteredQuestionsRequest.order:type_name -> questionsservice.v1.Order 1, // 6: questionsservice.v1.GetFilteredQuestionsRequest.sort:type_name -> questionsservice.v1.Sort - 12, // 7: questionsservice.v1.GetFilteredQuestionsRequest.type_filter:type_name -> questionsservice.v1.TypeFilter - 13, // 8: questionsservice.v1.GetFilteredQuestionsRequest.difficulty_filter:type_name -> questionsservice.v1.DifficultyFilter - 14, // 9: questionsservice.v1.GetFilteredQuestionsRequest.category_filter:type_name -> questionsservice.v1.CategoryFilter - 15, // 10: questionsservice.v1.GetFilteredQuestionsRequest.language_filter:type_name -> questionsservice.v1.LanguageFilter - 16, // 11: questionsservice.v1.GetFilteredQuestionsRequest.create_at_filter:type_name -> questionsservice.v1.CreatedAtFilter - 20, // 12: questionsservice.v1.GetFilteredQuestionsResponse.questions:type_name -> questionsservice.v1.Question + 13, // 7: questionsservice.v1.GetFilteredQuestionsRequest.type_filter:type_name -> questionsservice.v1.TypeFilter + 14, // 8: questionsservice.v1.GetFilteredQuestionsRequest.difficulty_filter:type_name -> questionsservice.v1.DifficultyFilter + 15, // 9: questionsservice.v1.GetFilteredQuestionsRequest.category_filter:type_name -> questionsservice.v1.CategoryFilter + 16, // 10: questionsservice.v1.GetFilteredQuestionsRequest.language_filter:type_name -> questionsservice.v1.LanguageFilter + 17, // 11: questionsservice.v1.GetFilteredQuestionsRequest.create_at_filter:type_name -> questionsservice.v1.CreatedAtFilter + 21, // 12: questionsservice.v1.GetFilteredQuestionsResponse.questions:type_name -> questionsservice.v1.Question 0, // 13: questionsservice.v1.GetFilteredQuestionsResponse.order:type_name -> questionsservice.v1.Order 1, // 14: questionsservice.v1.GetFilteredQuestionsResponse.sort:type_name -> questionsservice.v1.Sort - 17, // 15: questionsservice.v1.TypeFilter.types:type_name -> questionsservice.v1.Type - 18, // 16: questionsservice.v1.DifficultyFilter.difficulties:type_name -> questionsservice.v1.Difficulty - 21, // 17: questionsservice.v1.CreatedAtFilter.from:type_name -> google.protobuf.Timestamp - 21, // 18: questionsservice.v1.CreatedAtFilter.to:type_name -> google.protobuf.Timestamp - 10, // 19: questionsservice.v1.QuestionsAdminService.GetFilteredQuestions:input_type -> questionsservice.v1.GetFilteredQuestionsRequest + 18, // 15: questionsservice.v1.TypeFilter.types:type_name -> questionsservice.v1.Type + 19, // 16: questionsservice.v1.DifficultyFilter.difficulties:type_name -> questionsservice.v1.Difficulty + 22, // 17: questionsservice.v1.CreatedAtFilter.from:type_name -> google.protobuf.Timestamp + 22, // 18: questionsservice.v1.CreatedAtFilter.to:type_name -> google.protobuf.Timestamp + 11, // 19: questionsservice.v1.QuestionsAdminService.GetFilteredQuestions:input_type -> questionsservice.v1.GetFilteredQuestionsRequest 2, // 20: questionsservice.v1.QuestionsAdminService.CreateCategory:input_type -> questionsservice.v1.CreateCategoryRequest 4, // 21: questionsservice.v1.QuestionsAdminService.CreateQuestion:input_type -> questionsservice.v1.CreateQuestionRequest - 5, // 22: questionsservice.v1.QuestionsAdminService.UpdateCategory:input_type -> questionsservice.v1.UpdateCategoryRequest - 6, // 23: questionsservice.v1.QuestionsAdminService.UpdateQuestion:input_type -> questionsservice.v1.UpdateQuestionRequest - 7, // 24: questionsservice.v1.QuestionsAdminService.UpdateQuestionOption:input_type -> questionsservice.v1.UpdateQuestionOptionRequest - 8, // 25: questionsservice.v1.QuestionsAdminService.DeleteQuestion:input_type -> questionsservice.v1.DeleteQuestionRequest - 9, // 26: questionsservice.v1.QuestionsAdminService.DeleteQuestionOption:input_type -> questionsservice.v1.DeleteQuestionOptionRequest - 11, // 27: questionsservice.v1.QuestionsAdminService.GetFilteredQuestions:output_type -> questionsservice.v1.GetFilteredQuestionsResponse - 3, // 28: questionsservice.v1.QuestionsAdminService.CreateCategory:output_type -> questionsservice.v1.CreateCategoryResponse - 22, // 29: questionsservice.v1.QuestionsAdminService.CreateQuestion:output_type -> google.protobuf.Empty - 22, // 30: questionsservice.v1.QuestionsAdminService.UpdateCategory:output_type -> google.protobuf.Empty - 22, // 31: questionsservice.v1.QuestionsAdminService.UpdateQuestion:output_type -> google.protobuf.Empty - 22, // 32: questionsservice.v1.QuestionsAdminService.UpdateQuestionOption:output_type -> google.protobuf.Empty - 22, // 33: questionsservice.v1.QuestionsAdminService.DeleteQuestion:output_type -> google.protobuf.Empty - 22, // 34: questionsservice.v1.QuestionsAdminService.DeleteQuestionOption:output_type -> google.protobuf.Empty - 27, // [27:35] is the sub-list for method output_type - 19, // [19:27] is the sub-list for method input_type + 5, // 22: questionsservice.v1.QuestionsAdminService.CreateQuestionOption:input_type -> questionsservice.v1.CreateQuestionOptionRequest + 6, // 23: questionsservice.v1.QuestionsAdminService.UpdateCategory:input_type -> questionsservice.v1.UpdateCategoryRequest + 7, // 24: questionsservice.v1.QuestionsAdminService.UpdateQuestion:input_type -> questionsservice.v1.UpdateQuestionRequest + 8, // 25: questionsservice.v1.QuestionsAdminService.UpdateQuestionOption:input_type -> questionsservice.v1.UpdateQuestionOptionRequest + 9, // 26: questionsservice.v1.QuestionsAdminService.DeleteQuestion:input_type -> questionsservice.v1.DeleteQuestionRequest + 10, // 27: questionsservice.v1.QuestionsAdminService.DeleteQuestionOption:input_type -> questionsservice.v1.DeleteQuestionOptionRequest + 12, // 28: questionsservice.v1.QuestionsAdminService.GetFilteredQuestions:output_type -> questionsservice.v1.GetFilteredQuestionsResponse + 3, // 29: questionsservice.v1.QuestionsAdminService.CreateCategory:output_type -> questionsservice.v1.CreateCategoryResponse + 23, // 30: questionsservice.v1.QuestionsAdminService.CreateQuestion:output_type -> google.protobuf.Empty + 23, // 31: questionsservice.v1.QuestionsAdminService.CreateQuestionOption:output_type -> google.protobuf.Empty + 23, // 32: questionsservice.v1.QuestionsAdminService.UpdateCategory:output_type -> google.protobuf.Empty + 23, // 33: questionsservice.v1.QuestionsAdminService.UpdateQuestion:output_type -> google.protobuf.Empty + 23, // 34: questionsservice.v1.QuestionsAdminService.UpdateQuestionOption:output_type -> google.protobuf.Empty + 23, // 35: questionsservice.v1.QuestionsAdminService.DeleteQuestion:output_type -> google.protobuf.Empty + 23, // 36: questionsservice.v1.QuestionsAdminService.DeleteQuestionOption:output_type -> google.protobuf.Empty + 28, // [28:37] is the sub-list for method output_type + 19, // [19:28] is the sub-list for method input_type 19, // [19:19] is the sub-list for extension type_name 19, // [19:19] is the sub-list for extension extendee 0, // [0:19] is the sub-list for field type_name @@ -1336,16 +1434,16 @@ func file_external_questions_v1_admin_proto_init() { } file_external_questions_v1_shared_proto_init() file_external_questions_v1_admin_proto_msgTypes[2].OneofWrappers = []any{} - file_external_questions_v1_admin_proto_msgTypes[4].OneofWrappers = []any{} file_external_questions_v1_admin_proto_msgTypes[5].OneofWrappers = []any{} - file_external_questions_v1_admin_proto_msgTypes[8].OneofWrappers = []any{} + file_external_questions_v1_admin_proto_msgTypes[6].OneofWrappers = []any{} + file_external_questions_v1_admin_proto_msgTypes[9].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_questions_v1_admin_proto_rawDesc), len(file_external_questions_v1_admin_proto_rawDesc)), NumEnums: 2, - NumMessages: 15, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/external/questions/v1/admin.pb.gw.go b/gen/external/questions/v1/admin.pb.gw.go index f282e7c..b075065 100644 --- a/gen/external/questions/v1/admin.pb.gw.go +++ b/gen/external/questions/v1/admin.pb.gw.go @@ -107,6 +107,30 @@ func local_request_QuestionsAdminService_CreateQuestion_0(ctx context.Context, m return msg, metadata, err } +func request_QuestionsAdminService_CreateQuestionOption_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateQuestionOptionRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.CreateQuestionOption(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_QuestionsAdminService_CreateQuestionOption_0(ctx context.Context, marshaler runtime.Marshaler, server QuestionsAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq CreateQuestionOptionRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.CreateQuestionOption(ctx, &protoReq) + return msg, metadata, err +} + func request_QuestionsAdminService_UpdateCategory_0(ctx context.Context, marshaler runtime.Marshaler, client QuestionsAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( protoReq UpdateCategoryRequest @@ -293,6 +317,26 @@ func RegisterQuestionsAdminServiceHandlerServer(ctx context.Context, mux *runtim } forward_QuestionsAdminService_CreateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_CreateQuestionOption_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) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/questionsservice.v1.QuestionsAdminService/CreateQuestionOption", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/CreateQuestionOption")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_QuestionsAdminService_CreateQuestionOption_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_CreateQuestionOption_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -484,6 +528,23 @@ func RegisterQuestionsAdminServiceHandlerClient(ctx context.Context, mux *runtim } forward_QuestionsAdminService_CreateQuestion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_QuestionsAdminService_CreateQuestionOption_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) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/questionsservice.v1.QuestionsAdminService/CreateQuestionOption", runtime.WithHTTPPathPattern("/questionsservice.v1.QuestionsAdminService/CreateQuestionOption")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_QuestionsAdminService_CreateQuestionOption_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_QuestionsAdminService_CreateQuestionOption_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_QuestionsAdminService_UpdateCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -576,6 +637,7 @@ var ( pattern_QuestionsAdminService_GetFilteredQuestions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "GetFilteredQuestions"}, "")) pattern_QuestionsAdminService_CreateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "CreateCategory"}, "")) pattern_QuestionsAdminService_CreateQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "CreateQuestion"}, "")) + pattern_QuestionsAdminService_CreateQuestionOption_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "CreateQuestionOption"}, "")) pattern_QuestionsAdminService_UpdateCategory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "UpdateCategory"}, "")) pattern_QuestionsAdminService_UpdateQuestion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "UpdateQuestion"}, "")) pattern_QuestionsAdminService_UpdateQuestionOption_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"questionsservice.v1.QuestionsAdminService", "UpdateQuestionOption"}, "")) @@ -587,6 +649,7 @@ var ( forward_QuestionsAdminService_GetFilteredQuestions_0 = runtime.ForwardResponseMessage forward_QuestionsAdminService_CreateCategory_0 = runtime.ForwardResponseMessage forward_QuestionsAdminService_CreateQuestion_0 = runtime.ForwardResponseMessage + forward_QuestionsAdminService_CreateQuestionOption_0 = runtime.ForwardResponseMessage forward_QuestionsAdminService_UpdateCategory_0 = runtime.ForwardResponseMessage forward_QuestionsAdminService_UpdateQuestion_0 = runtime.ForwardResponseMessage forward_QuestionsAdminService_UpdateQuestionOption_0 = runtime.ForwardResponseMessage diff --git a/gen/external/questions/v1/admin_grpc.pb.go b/gen/external/questions/v1/admin_grpc.pb.go index 289aeb9..671353d 100644 --- a/gen/external/questions/v1/admin_grpc.pb.go +++ b/gen/external/questions/v1/admin_grpc.pb.go @@ -23,6 +23,7 @@ const ( QuestionsAdminService_GetFilteredQuestions_FullMethodName = "/questionsservice.v1.QuestionsAdminService/GetFilteredQuestions" QuestionsAdminService_CreateCategory_FullMethodName = "/questionsservice.v1.QuestionsAdminService/CreateCategory" QuestionsAdminService_CreateQuestion_FullMethodName = "/questionsservice.v1.QuestionsAdminService/CreateQuestion" + QuestionsAdminService_CreateQuestionOption_FullMethodName = "/questionsservice.v1.QuestionsAdminService/CreateQuestionOption" QuestionsAdminService_UpdateCategory_FullMethodName = "/questionsservice.v1.QuestionsAdminService/UpdateCategory" QuestionsAdminService_UpdateQuestion_FullMethodName = "/questionsservice.v1.QuestionsAdminService/UpdateQuestion" QuestionsAdminService_UpdateQuestionOption_FullMethodName = "/questionsservice.v1.QuestionsAdminService/UpdateQuestionOption" @@ -33,14 +34,27 @@ const ( // QuestionsAdminServiceClient is the client API for QuestionsAdminService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// Questions Admin Service provides methods for admin's access and management type QuestionsAdminServiceClient interface { + // Method for getting paginated list of questions that can be requested with filters GetFilteredQuestions(ctx context.Context, in *GetFilteredQuestionsRequest, opts ...grpc.CallOption) (*GetFilteredQuestionsResponse, error) + // Method for creating new category CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CreateCategoryResponse, error) + // Method lets create a question with options CreateQuestion(ctx context.Context, in *CreateQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method lets create and add a question's option to existing question + CreateQuestionOption(ctx context.Context, in *CreateQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method for updating existing category UpdateCategory(ctx context.Context, in *UpdateCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method for updating question data by it's ID UpdateQuestion(ctx context.Context, in *UpdateQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method for updating question's options UpdateQuestionOption(ctx context.Context, in *UpdateQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method for deleting a question from database DeleteQuestion(ctx context.Context, in *DeleteQuestionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method for deleting a question's options from database DeleteQuestionOption(ctx context.Context, in *DeleteQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -82,6 +96,16 @@ func (c *questionsAdminServiceClient) CreateQuestion(ctx context.Context, in *Cr return out, nil } +func (c *questionsAdminServiceClient) CreateQuestionOption(ctx context.Context, in *CreateQuestionOptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, QuestionsAdminService_CreateQuestionOption_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *questionsAdminServiceClient) UpdateCategory(ctx context.Context, in *UpdateCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) @@ -135,14 +159,27 @@ func (c *questionsAdminServiceClient) DeleteQuestionOption(ctx context.Context, // QuestionsAdminServiceServer is the server API for QuestionsAdminService service. // All implementations should embed UnimplementedQuestionsAdminServiceServer // for forward compatibility. +// +// * +// Questions Admin Service provides methods for admin's access and management type QuestionsAdminServiceServer interface { + // Method for getting paginated list of questions that can be requested with filters GetFilteredQuestions(context.Context, *GetFilteredQuestionsRequest) (*GetFilteredQuestionsResponse, error) + // Method for creating new category CreateCategory(context.Context, *CreateCategoryRequest) (*CreateCategoryResponse, error) + // Method lets create a question with options CreateQuestion(context.Context, *CreateQuestionRequest) (*emptypb.Empty, error) + // Method lets create and add a question's option to existing question + CreateQuestionOption(context.Context, *CreateQuestionOptionRequest) (*emptypb.Empty, error) + // Method for updating existing category UpdateCategory(context.Context, *UpdateCategoryRequest) (*emptypb.Empty, error) + // Method for updating question data by it's ID UpdateQuestion(context.Context, *UpdateQuestionRequest) (*emptypb.Empty, error) + // Method for updating question's options UpdateQuestionOption(context.Context, *UpdateQuestionOptionRequest) (*emptypb.Empty, error) + // Method for deleting a question from database DeleteQuestion(context.Context, *DeleteQuestionRequest) (*emptypb.Empty, error) + // Method for deleting a question's options from database DeleteQuestionOption(context.Context, *DeleteQuestionOptionRequest) (*emptypb.Empty, error) } @@ -162,6 +199,9 @@ func (UnimplementedQuestionsAdminServiceServer) CreateCategory(context.Context, func (UnimplementedQuestionsAdminServiceServer) CreateQuestion(context.Context, *CreateQuestionRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateQuestion not implemented") } +func (UnimplementedQuestionsAdminServiceServer) CreateQuestionOption(context.Context, *CreateQuestionOptionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateQuestionOption not implemented") +} func (UnimplementedQuestionsAdminServiceServer) UpdateCategory(context.Context, *UpdateCategoryRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCategory not implemented") } @@ -251,6 +291,24 @@ func _QuestionsAdminService_CreateQuestion_Handler(srv interface{}, ctx context. return interceptor(ctx, in, info, handler) } +func _QuestionsAdminService_CreateQuestionOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateQuestionOptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QuestionsAdminServiceServer).CreateQuestionOption(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QuestionsAdminService_CreateQuestionOption_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QuestionsAdminServiceServer).CreateQuestionOption(ctx, req.(*CreateQuestionOptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _QuestionsAdminService_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateCategoryRequest) if err := dec(in); err != nil { @@ -360,6 +418,10 @@ var QuestionsAdminService_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateQuestion", Handler: _QuestionsAdminService_CreateQuestion_Handler, }, + { + MethodName: "CreateQuestionOption", + Handler: _QuestionsAdminService_CreateQuestionOption_Handler, + }, { MethodName: "UpdateCategory", Handler: _QuestionsAdminService_UpdateCategory_Handler, diff --git a/gen/external/questions/v1/client.pb.go b/gen/external/questions/v1/client.pb.go index be8b672..5fb15ac 100644 --- a/gen/external/questions/v1/client.pb.go +++ b/gen/external/questions/v1/client.pb.go @@ -22,6 +22,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// * +// Represents message with all existing categories is server type GetCategoriesResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Categories []*Category `protobuf:"bytes,1,rep,name=categories,proto3" json:"categories,omitempty"` diff --git a/gen/external/questions/v1/client_grpc.pb.go b/gen/external/questions/v1/client_grpc.pb.go index f5c3b93..2e7c5e3 100644 --- a/gen/external/questions/v1/client_grpc.pb.go +++ b/gen/external/questions/v1/client_grpc.pb.go @@ -26,7 +26,11 @@ const ( // QuestionsClientServiceClient is the client API for QuestionsClientService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// Questions Client Service provides methods for clients type QuestionsClientServiceClient interface { + // Method allows get all existing categories GetCategories(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetCategoriesResponse, error) } @@ -51,7 +55,11 @@ func (c *questionsClientServiceClient) GetCategories(ctx context.Context, in *em // QuestionsClientServiceServer is the server API for QuestionsClientService service. // All implementations should embed UnimplementedQuestionsClientServiceServer // for forward compatibility. +// +// * +// Questions Client Service provides methods for clients type QuestionsClientServiceServer interface { + // Method allows get all existing categories GetCategories(context.Context, *emptypb.Empty) (*GetCategoriesResponse, error) } diff --git a/gen/external/questions/v1/questions.pb.go b/gen/external/questions/v1/questions.pb.go index 9dd2f52..9f0b4c7 100644 --- a/gen/external/questions/v1/questions.pb.go +++ b/gen/external/questions/v1/questions.pb.go @@ -21,12 +21,14 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// * +// Represents a light filter for getting desired questions type GetQuestionsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Difficulty Difficulty `protobuf:"varint,1,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` - Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"` - CategoryId int32 `protobuf:"varint,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` - Amount int32 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` + Difficulty Difficulty `protobuf:"varint,1,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` // Desired difficulty + Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"` // Desired question language + CategoryId int32 `protobuf:"varint,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` // Desired question category id + Amount int32 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // Amount of desired questions unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -89,14 +91,16 @@ func (x *GetQuestionsRequest) GetAmount() int32 { return 0 } +// * +// Represents a heavy filtered request for getting questions type GetQuestionBatchRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Types []Type `protobuf:"varint,1,rep,packed,name=types,proto3,enum=questionsservice.v1.Type" json:"types,omitempty"` - Sources []Source `protobuf:"varint,2,rep,packed,name=sources,proto3,enum=questionsservice.v1.Source" json:"sources,omitempty"` - Difficulties []Difficulty `protobuf:"varint,3,rep,packed,name=difficulties,proto3,enum=questionsservice.v1.Difficulty" json:"difficulties,omitempty"` - CategoriesIds []int32 `protobuf:"varint,4,rep,packed,name=categories_ids,json=categoriesIds,proto3" json:"categories_ids,omitempty"` - Language string `protobuf:"bytes,5,opt,name=language,proto3" json:"language,omitempty"` - Amount int32 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + Types []Type `protobuf:"varint,1,rep,packed,name=types,proto3,enum=questionsservice.v1.Type" json:"types,omitempty"` // List of desired question's types + Sources []Source `protobuf:"varint,2,rep,packed,name=sources,proto3,enum=questionsservice.v1.Source" json:"sources,omitempty"` // List of desired questions' sources + Difficulties []Difficulty `protobuf:"varint,3,rep,packed,name=difficulties,proto3,enum=questionsservice.v1.Difficulty" json:"difficulties,omitempty"` // List of desired question's difficulties + CategoriesIds []int32 `protobuf:"varint,4,rep,packed,name=categories_ids,json=categoriesIds,proto3" json:"categories_ids,omitempty"` // List of desired question's categories ids + Language string `protobuf:"bytes,5,opt,name=language,proto3" json:"language,omitempty"` // Language of requesting question + Amount int32 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` // Amount of desired questions unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -173,9 +177,11 @@ func (x *GetQuestionBatchRequest) GetAmount() int32 { return 0 } +// * +// Represents of requested, filtered questions list type QuestionsResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - Questions []*Question `protobuf:"bytes,1,rep,name=questions,proto3" json:"questions,omitempty"` + Questions []*Question `protobuf:"bytes,1,rep,name=questions,proto3" json:"questions,omitempty"` // List of resulted questions unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } diff --git a/gen/external/questions/v1/questions_grpc.pb.go b/gen/external/questions/v1/questions_grpc.pb.go index 693f6d5..cc70eb4 100644 --- a/gen/external/questions/v1/questions_grpc.pb.go +++ b/gen/external/questions/v1/questions_grpc.pb.go @@ -26,8 +26,14 @@ const ( // QuestionsServiceClient is the client API for QuestionsService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// +// Questions service is a service for getting desired questions type QuestionsServiceClient interface { + // Method for getting questions with light filter GetQuestions(ctx context.Context, in *GetQuestionsRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) + // Method for getting batch of questions with heavy filter GetQuestionBatch(ctx context.Context, in *GetQuestionBatchRequest, opts ...grpc.CallOption) (*QuestionsResponse, error) } @@ -62,8 +68,14 @@ func (c *questionsServiceClient) GetQuestionBatch(ctx context.Context, in *GetQu // QuestionsServiceServer is the server API for QuestionsService service. // All implementations should embed UnimplementedQuestionsServiceServer // for forward compatibility. +// +// * +// +// Questions service is a service for getting desired questions type QuestionsServiceServer interface { + // Method for getting questions with light filter GetQuestions(context.Context, *GetQuestionsRequest) (*QuestionsResponse, error) + // Method for getting batch of questions with heavy filter GetQuestionBatch(context.Context, *GetQuestionBatchRequest) (*QuestionsResponse, error) } diff --git a/gen/external/questions/v1/shared.pb.go b/gen/external/questions/v1/shared.pb.go index 363b0ed..b591b90 100644 --- a/gen/external/questions/v1/shared.pb.go +++ b/gen/external/questions/v1/shared.pb.go @@ -26,9 +26,9 @@ type Type int32 const ( Type_TYPE_UNSPECIFIED Type = 0 - Type_TYPE_SINGLE Type = 1 - Type_TYPE_MULTI Type = 2 - Type_TYPE_BETTING Type = 3 + Type_TYPE_SINGLE Type = 1 // Question has definitely only one correct option + Type_TYPE_MULTI Type = 2 // Question has one or more correct option + Type_TYPE_BETTING Type = 3 // Question has ability make a bid on question answer ) // Enum value maps for Type. @@ -187,17 +187,19 @@ func (Difficulty) EnumDescriptor() ([]byte, []int) { return file_external_questions_v1_shared_proto_rawDescGZIP(), []int{2} } +// * +// Message represents a question type Question struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=questionsservice.v1.Type" json:"type,omitempty"` - Source Source `protobuf:"varint,3,opt,name=source,proto3,enum=questionsservice.v1.Source" json:"source,omitempty"` - Difficulty Difficulty `protobuf:"varint,4,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` - Category *Category `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"` - Text string `protobuf:"bytes,6,opt,name=text,proto3" json:"text,omitempty"` - Options []*Option `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` - Language string `protobuf:"bytes,8,opt,name=language,proto3" json:"language,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of question is UUID v4 + Type Type `protobuf:"varint,2,opt,name=type,proto3,enum=questionsservice.v1.Type" json:"type,omitempty"` // Type of question is a enum value + Source Source `protobuf:"varint,3,opt,name=source,proto3,enum=questionsservice.v1.Source" json:"source,omitempty"` // Source of question is a enum value + Difficulty Difficulty `protobuf:"varint,4,opt,name=difficulty,proto3,enum=questionsservice.v1.Difficulty" json:"difficulty,omitempty"` // Difficulty is a enum value + Category *Category `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"` // Category is a pair of id of category and it's name + Text string `protobuf:"bytes,6,opt,name=text,proto3" json:"text,omitempty"` // Text of a question + Options []*Option `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` // List of question options + Language string `protobuf:"bytes,8,opt,name=language,proto3" json:"language,omitempty"` // Language of a question + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Date when a questing was added unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -295,11 +297,13 @@ func (x *Question) GetCreatedAt() *timestamppb.Timestamp { return nil } +// * +// Message represents a question's option type Option struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` - IsCorrect bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3" json:"is_correct,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of option is UUID v4 + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // Text of question option + IsCorrect bool `protobuf:"varint,3,opt,name=is_correct,json=isCorrect,proto3" json:"is_correct,omitempty"` // Filed that shows is it correct answer or not unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -355,10 +359,12 @@ func (x *Option) GetIsCorrect() bool { return false } +// * +// Message represents a category pf question type Category struct { state protoimpl.MessageState `protogen:"open.v1"` - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID is integer type + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Name of category unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } diff --git a/gen/external/users/v1/admin.pb.go b/gen/external/users/v1/admin.pb.go index eeb8972..6ff0175 100644 --- a/gen/external/users/v1/admin.pb.go +++ b/gen/external/users/v1/admin.pb.go @@ -136,111 +136,77 @@ func (Sort) EnumDescriptor() ([]byte, []int) { return file_external_users_v1_admin_proto_rawDescGZIP(), []int{1} } -type BanUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BanUserRequest) Reset() { - *x = BanUserRequest{} - mi := &file_external_users_v1_admin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BanUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} +type Role int32 -func (*BanUserRequest) ProtoMessage() {} +const ( + Role_ROLE_UNSPECIFIED Role = 0 + Role_ROLE_USER Role = 1 + Role_ROLE_ADMIN Role = 2 + Role_ROLE_SUPER Role = 3 +) -func (x *BanUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +// Enum value maps for Role. +var ( + Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "ROLE_USER", + 2: "ROLE_ADMIN", + 3: "ROLE_SUPER", } - return mi.MessageOf(x) -} - -// Deprecated: Use BanUserRequest.ProtoReflect.Descriptor instead. -func (*BanUserRequest) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{0} -} - -func (x *BanUserRequest) GetUserId() string { - if x != nil { - return x.UserId + Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "ROLE_USER": 1, + "ROLE_ADMIN": 2, + "ROLE_SUPER": 3, } - return "" -} +) -type UnbanUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache +func (x Role) Enum() *Role { + p := new(Role) + *p = x + return p } -func (x *UnbanUserRequest) Reset() { - *x = UnbanUserRequest{} - mi := &file_external_users_v1_admin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (x *UnbanUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (Role) Descriptor() protoreflect.EnumDescriptor { + return file_external_users_v1_admin_proto_enumTypes[2].Descriptor() } -func (*UnbanUserRequest) ProtoMessage() {} - -func (x *UnbanUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (Role) Type() protoreflect.EnumType { + return &file_external_users_v1_admin_proto_enumTypes[2] } -// Deprecated: Use UnbanUserRequest.ProtoReflect.Descriptor instead. -func (*UnbanUserRequest) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{1} +func (x Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (x *UnbanUserRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" +// Deprecated: Use Role.Descriptor instead. +func (Role) EnumDescriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{2} } +// * +// Represent filter for searching users profiles, has required fields type SearchUsersRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - Order *Order `protobuf:"varint,3,opt,name=order,proto3,enum=usersservice.v1.Order,oneof" json:"order,omitempty"` - Sort *Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=usersservice.v1.Sort,oneof" json:"sort,omitempty"` - UserRating *RatingFiler `protobuf:"bytes,5,opt,name=user_rating,json=userRating,proto3" json:"user_rating,omitempty"` - UserCoins *CoinsFiler `protobuf:"bytes,6,opt,name=user_coins,json=userCoins,proto3" json:"user_coins,omitempty"` - UserCreatedAt *CreateAtFiler `protobuf:"bytes,7,opt,name=user_created_at,json=userCreatedAt,proto3" json:"user_created_at,omitempty"` - UserDeletedAt *DeletedAtFiler `protobuf:"bytes,8,opt,name=user_deleted_at,json=userDeletedAt,proto3" json:"user_deleted_at,omitempty"` + Page uint64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // Value of taget page, default must be 1 + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` // Amount of desired entities amount, try use with limit + Order *Order `protobuf:"varint,3,opt,name=order,proto3,enum=usersservice.v1.Order,oneof" json:"order,omitempty"` // Optional order, default is username + Sort *Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=usersservice.v1.Sort,oneof" json:"sort,omitempty"` // Optional sort, default is ASC + UserRating *RatingFiler `protobuf:"bytes,5,opt,name=user_rating,json=userRating,proto3" json:"user_rating,omitempty"` // Optional filter, from-to rating window + UserCoins *CoinsFiler `protobuf:"bytes,6,opt,name=user_coins,json=userCoins,proto3" json:"user_coins,omitempty"` // Optional filter, from-to coins window + UserCreatedAt *CreateAtFiler `protobuf:"bytes,7,opt,name=user_created_at,json=userCreatedAt,proto3" json:"user_created_at,omitempty"` // Optional filter, from-to register date window + UserDeletedAt *DeletedAtFiler `protobuf:"bytes,8,opt,name=user_deleted_at,json=userDeletedAt,proto3" json:"user_deleted_at,omitempty"` // Optional filter, from-to deleted (banned) date window unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SearchUsersRequest) Reset() { *x = SearchUsersRequest{} - mi := &file_external_users_v1_admin_proto_msgTypes[2] + mi := &file_external_users_v1_admin_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -252,7 +218,7 @@ func (x *SearchUsersRequest) String() string { func (*SearchUsersRequest) ProtoMessage() {} func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[2] + mi := &file_external_users_v1_admin_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -265,7 +231,7 @@ func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead. func (*SearchUsersRequest) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{2} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{0} } func (x *SearchUsersRequest) GetPage() uint64 { @@ -334,7 +300,7 @@ type RatingFiler struct { func (x *RatingFiler) Reset() { *x = RatingFiler{} - mi := &file_external_users_v1_admin_proto_msgTypes[3] + mi := &file_external_users_v1_admin_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -346,7 +312,7 @@ func (x *RatingFiler) String() string { func (*RatingFiler) ProtoMessage() {} func (x *RatingFiler) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[3] + mi := &file_external_users_v1_admin_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -359,7 +325,7 @@ func (x *RatingFiler) ProtoReflect() protoreflect.Message { // Deprecated: Use RatingFiler.ProtoReflect.Descriptor instead. func (*RatingFiler) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{3} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{1} } func (x *RatingFiler) GetFrom() int32 { @@ -386,7 +352,7 @@ type CoinsFiler struct { func (x *CoinsFiler) Reset() { *x = CoinsFiler{} - mi := &file_external_users_v1_admin_proto_msgTypes[4] + mi := &file_external_users_v1_admin_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -398,7 +364,7 @@ func (x *CoinsFiler) String() string { func (*CoinsFiler) ProtoMessage() {} func (x *CoinsFiler) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[4] + mi := &file_external_users_v1_admin_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -411,7 +377,7 @@ func (x *CoinsFiler) ProtoReflect() protoreflect.Message { // Deprecated: Use CoinsFiler.ProtoReflect.Descriptor instead. func (*CoinsFiler) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{4} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{2} } func (x *CoinsFiler) GetFrom() int64 { @@ -438,7 +404,7 @@ type CreateAtFiler struct { func (x *CreateAtFiler) Reset() { *x = CreateAtFiler{} - mi := &file_external_users_v1_admin_proto_msgTypes[5] + mi := &file_external_users_v1_admin_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -450,7 +416,7 @@ func (x *CreateAtFiler) String() string { func (*CreateAtFiler) ProtoMessage() {} func (x *CreateAtFiler) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[5] + mi := &file_external_users_v1_admin_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -463,7 +429,7 @@ func (x *CreateAtFiler) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateAtFiler.ProtoReflect.Descriptor instead. func (*CreateAtFiler) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{5} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{3} } func (x *CreateAtFiler) GetFrom() *timestamppb.Timestamp { @@ -490,7 +456,7 @@ type DeletedAtFiler struct { func (x *DeletedAtFiler) Reset() { *x = DeletedAtFiler{} - mi := &file_external_users_v1_admin_proto_msgTypes[6] + mi := &file_external_users_v1_admin_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +468,7 @@ func (x *DeletedAtFiler) String() string { func (*DeletedAtFiler) ProtoMessage() {} func (x *DeletedAtFiler) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[6] + mi := &file_external_users_v1_admin_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +481,7 @@ func (x *DeletedAtFiler) ProtoReflect() protoreflect.Message { // Deprecated: Use DeletedAtFiler.ProtoReflect.Descriptor instead. func (*DeletedAtFiler) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{6} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{4} } func (x *DeletedAtFiler) GetFrom() *timestamppb.Timestamp { @@ -532,21 +498,23 @@ func (x *DeletedAtFiler) GetTo() *timestamppb.Timestamp { return nil } +// * +// Represent result of searching users. type SearchUsersResponse struct { state protoimpl.MessageState `protogen:"open.v1"` - Users []*UserAdmin `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - Page uint64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` - Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - Order Order `protobuf:"varint,4,opt,name=order,proto3,enum=usersservice.v1.Order" json:"order,omitempty"` - Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=usersservice.v1.Sort" json:"sort,omitempty"` - Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` + Users []*UserAdmin `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` // Array of user's profiles that has additional fields that able only for admin view + Page uint64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // Current page, allow work with pagination + Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` // Current page size value + Order Order `protobuf:"varint,4,opt,name=order,proto3,enum=usersservice.v1.Order" json:"order,omitempty"` // Order what was used to get current result + Sort Sort `protobuf:"varint,5,opt,name=sort,proto3,enum=usersservice.v1.Sort" json:"sort,omitempty"` // Sort type that was used for get current result + Amount int64 `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"` // Amount of all user's profiles that able to get using the same request filter unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SearchUsersResponse) Reset() { *x = SearchUsersResponse{} - mi := &file_external_users_v1_admin_proto_msgTypes[7] + mi := &file_external_users_v1_admin_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -558,7 +526,7 @@ func (x *SearchUsersResponse) String() string { func (*SearchUsersResponse) ProtoMessage() {} func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[7] + mi := &file_external_users_v1_admin_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -571,7 +539,7 @@ func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead. func (*SearchUsersResponse) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{7} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{5} } func (x *SearchUsersResponse) GetUsers() []*UserAdmin { @@ -616,6 +584,8 @@ func (x *SearchUsersResponse) GetAmount() int64 { return 0 } +// * +// Represent of request argument what allow admin get specified user by one of his identifier: id, username, email type GetUserByIdentifierRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Identifier: @@ -630,7 +600,7 @@ type GetUserByIdentifierRequest struct { func (x *GetUserByIdentifierRequest) Reset() { *x = GetUserByIdentifierRequest{} - mi := &file_external_users_v1_admin_proto_msgTypes[8] + mi := &file_external_users_v1_admin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -642,7 +612,7 @@ func (x *GetUserByIdentifierRequest) String() string { func (*GetUserByIdentifierRequest) ProtoMessage() {} func (x *GetUserByIdentifierRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_admin_proto_msgTypes[8] + mi := &file_external_users_v1_admin_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -655,7 +625,7 @@ func (x *GetUserByIdentifierRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserByIdentifierRequest.ProtoReflect.Descriptor instead. func (*GetUserByIdentifierRequest) Descriptor() ([]byte, []int) { - return file_external_users_v1_admin_proto_rawDescGZIP(), []int{8} + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{6} } func (x *GetUserByIdentifierRequest) GetIdentifier() isGetUserByIdentifierRequest_Identifier { @@ -714,6 +684,152 @@ func (*GetUserByIdentifierRequest_Username) isGetUserByIdentifierRequest_Identif func (*GetUserByIdentifierRequest_Email) isGetUserByIdentifierRequest_Identifier() {} +// * +// Represent argument of method for ban user, user id required +type BanUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BanUserRequest) Reset() { + *x = BanUserRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BanUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BanUserRequest) ProtoMessage() {} + +func (x *BanUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BanUserRequest.ProtoReflect.Descriptor instead. +func (*BanUserRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{7} +} + +func (x *BanUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// * +// Represent argument of method for unban user, user id required +type UnbanUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnbanUserRequest) Reset() { + *x = UnbanUserRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnbanUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnbanUserRequest) ProtoMessage() {} + +func (x *UnbanUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnbanUserRequest.ProtoReflect.Descriptor instead. +func (*UnbanUserRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{8} +} + +func (x *UnbanUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// * +// Represent argument of request for set a user new role, user id and enum role required +type UpdateUserRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Role Role `protobuf:"varint,2,opt,name=role,proto3,enum=usersservice.v1.Role" json:"role,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserRoleRequest) Reset() { + *x = UpdateUserRoleRequest{} + mi := &file_external_users_v1_admin_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRoleRequest) ProtoMessage() {} + +func (x *UpdateUserRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_external_users_v1_admin_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRoleRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRoleRequest) Descriptor() ([]byte, []int) { + return file_external_users_v1_admin_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateUserRoleRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateUserRoleRequest) GetRole() Role { + if x != nil { + return x.Role + } + return Role_ROLE_UNSPECIFIED +} + var File_external_users_v1_admin_proto protoreflect.FileDescriptor var file_external_users_v1_admin_proto_rawDesc = string([]byte{ @@ -725,120 +841,136 @@ var file_external_users_v1_admin_proto_rawDesc = string([]byte{ 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, 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, 0x22, 0x29, - 0x0a, 0x0e, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x10, 0x55, 0x6e, 0x62, - 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xbe, 0x03, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x48, 0x01, 0x52, - 0x04, 0x73, 0x6f, 0x72, 0x74, 0x88, 0x01, 0x01, 0x12, 0x3d, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, + 0x03, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x31, 0x0a, + 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, + 0x12, 0x2e, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x48, 0x01, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x3d, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, + 0x6c, 0x65, 0x72, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, + 0x3a, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x72, + 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x46, + 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x47, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x75, + 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x08, 0x0a, 0x06, + 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x22, + 0x31, 0x0a, 0x0b, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 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, 0x02, 0x74, + 0x6f, 0x22, 0x6c, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x22, + 0xe0, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x29, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0a, 0x75, 0x73, 0x65, - 0x72, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3a, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x75, 0x73, - 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x47, 0x0a, 0x0f, 0x75, - 0x73, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x46, 0x69, 0x6c, 0x65, 0x72, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x07, - 0x0a, 0x05, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x31, 0x0a, 0x0b, 0x52, 0x61, 0x74, 0x69, 0x6e, - 0x67, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x0a, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0d, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, - 0x02, 0x74, 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x0e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x04, 0x66, - 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, - 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x22, 0xe0, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, + 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x7b, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, + 0x29, 0x0a, 0x0e, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x10, 0x55, 0x6e, + 0x62, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x2a, 0xa0, 0x01, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x15, + 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x49, + 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x53, 0x45, + 0x52, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x52, 0x44, 0x45, 0x52, + 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x5f, 0x52, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x52, + 0x44, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x49, 0x4e, 0x53, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x4f, + 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, + 0x06, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, + 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, 0x07, 0x2a, 0x39, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, + 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x53, + 0x43, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, + 0x10, 0x02, 0x2a, 0x4b, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, + 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, + 0x0e, 0x0a, 0x0a, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, + 0x0e, 0x0a, 0x0a, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x53, 0x55, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32, + 0xab, 0x03, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x30, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, - 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x7b, 0x0a, 0x1a, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2a, 0xa0, 0x01, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x52, 0x44, 0x45, - 0x52, 0x5f, 0x49, 0x44, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, - 0x55, 0x53, 0x45, 0x52, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x52, - 0x44, 0x45, 0x52, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x4f, - 0x52, 0x44, 0x45, 0x52, 0x5f, 0x52, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0f, 0x0a, - 0x0b, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x49, 0x4e, 0x53, 0x10, 0x05, 0x12, 0x14, - 0x0a, 0x10, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, - 0x41, 0x54, 0x10, 0x06, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x44, 0x45, - 0x4c, 0x45, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x54, 0x10, 0x07, 0x2a, 0x39, 0x0a, 0x04, 0x53, 0x6f, - 0x72, 0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x52, 0x54, - 0x5f, 0x41, 0x53, 0x43, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, - 0x45, 0x53, 0x43, 0x10, 0x02, 0x32, 0xd9, 0x02, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x73, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0b, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x42, 0x0a, 0x07, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x1f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 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, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x62, - 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x61, 0x6e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x5e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, + 0x50, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, + 0x65, 0x12, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, + 0x6c, 0x65, 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, 0x42, 0x12, 0x5a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x12, 0x42, 0x0a, 0x07, 0x42, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 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, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x62, 0x61, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x72, 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, 0x42, 0x12, 0x5a, + 0x10, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -853,51 +985,56 @@ func file_external_users_v1_admin_proto_rawDescGZIP() []byte { return file_external_users_v1_admin_proto_rawDescData } -var file_external_users_v1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_external_users_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_external_users_v1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_external_users_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_external_users_v1_admin_proto_goTypes = []any{ (Order)(0), // 0: usersservice.v1.Order (Sort)(0), // 1: usersservice.v1.Sort - (*BanUserRequest)(nil), // 2: usersservice.v1.BanUserRequest - (*UnbanUserRequest)(nil), // 3: usersservice.v1.UnbanUserRequest - (*SearchUsersRequest)(nil), // 4: usersservice.v1.SearchUsersRequest - (*RatingFiler)(nil), // 5: usersservice.v1.RatingFiler - (*CoinsFiler)(nil), // 6: usersservice.v1.CoinsFiler - (*CreateAtFiler)(nil), // 7: usersservice.v1.CreateAtFiler - (*DeletedAtFiler)(nil), // 8: usersservice.v1.DeletedAtFiler - (*SearchUsersResponse)(nil), // 9: usersservice.v1.SearchUsersResponse - (*GetUserByIdentifierRequest)(nil), // 10: usersservice.v1.GetUserByIdentifierRequest - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*UserAdmin)(nil), // 12: usersservice.v1.UserAdmin - (*emptypb.Empty)(nil), // 13: google.protobuf.Empty + (Role)(0), // 2: usersservice.v1.Role + (*SearchUsersRequest)(nil), // 3: usersservice.v1.SearchUsersRequest + (*RatingFiler)(nil), // 4: usersservice.v1.RatingFiler + (*CoinsFiler)(nil), // 5: usersservice.v1.CoinsFiler + (*CreateAtFiler)(nil), // 6: usersservice.v1.CreateAtFiler + (*DeletedAtFiler)(nil), // 7: usersservice.v1.DeletedAtFiler + (*SearchUsersResponse)(nil), // 8: usersservice.v1.SearchUsersResponse + (*GetUserByIdentifierRequest)(nil), // 9: usersservice.v1.GetUserByIdentifierRequest + (*BanUserRequest)(nil), // 10: usersservice.v1.BanUserRequest + (*UnbanUserRequest)(nil), // 11: usersservice.v1.UnbanUserRequest + (*UpdateUserRoleRequest)(nil), // 12: usersservice.v1.UpdateUserRoleRequest + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*UserAdmin)(nil), // 14: usersservice.v1.UserAdmin + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty } var file_external_users_v1_admin_proto_depIdxs = []int32{ 0, // 0: usersservice.v1.SearchUsersRequest.order:type_name -> usersservice.v1.Order 1, // 1: usersservice.v1.SearchUsersRequest.sort:type_name -> usersservice.v1.Sort - 5, // 2: usersservice.v1.SearchUsersRequest.user_rating:type_name -> usersservice.v1.RatingFiler - 6, // 3: usersservice.v1.SearchUsersRequest.user_coins:type_name -> usersservice.v1.CoinsFiler - 7, // 4: usersservice.v1.SearchUsersRequest.user_created_at:type_name -> usersservice.v1.CreateAtFiler - 8, // 5: usersservice.v1.SearchUsersRequest.user_deleted_at:type_name -> usersservice.v1.DeletedAtFiler - 11, // 6: usersservice.v1.CreateAtFiler.from:type_name -> google.protobuf.Timestamp - 11, // 7: usersservice.v1.CreateAtFiler.to:type_name -> google.protobuf.Timestamp - 11, // 8: usersservice.v1.DeletedAtFiler.from:type_name -> google.protobuf.Timestamp - 11, // 9: usersservice.v1.DeletedAtFiler.to:type_name -> google.protobuf.Timestamp - 12, // 10: usersservice.v1.SearchUsersResponse.users:type_name -> usersservice.v1.UserAdmin + 4, // 2: usersservice.v1.SearchUsersRequest.user_rating:type_name -> usersservice.v1.RatingFiler + 5, // 3: usersservice.v1.SearchUsersRequest.user_coins:type_name -> usersservice.v1.CoinsFiler + 6, // 4: usersservice.v1.SearchUsersRequest.user_created_at:type_name -> usersservice.v1.CreateAtFiler + 7, // 5: usersservice.v1.SearchUsersRequest.user_deleted_at:type_name -> usersservice.v1.DeletedAtFiler + 13, // 6: usersservice.v1.CreateAtFiler.from:type_name -> google.protobuf.Timestamp + 13, // 7: usersservice.v1.CreateAtFiler.to:type_name -> google.protobuf.Timestamp + 13, // 8: usersservice.v1.DeletedAtFiler.from:type_name -> google.protobuf.Timestamp + 13, // 9: usersservice.v1.DeletedAtFiler.to:type_name -> google.protobuf.Timestamp + 14, // 10: usersservice.v1.SearchUsersResponse.users:type_name -> usersservice.v1.UserAdmin 0, // 11: usersservice.v1.SearchUsersResponse.order:type_name -> usersservice.v1.Order 1, // 12: usersservice.v1.SearchUsersResponse.sort:type_name -> usersservice.v1.Sort - 4, // 13: usersservice.v1.UsersAdminService.SearchUsers:input_type -> usersservice.v1.SearchUsersRequest - 10, // 14: usersservice.v1.UsersAdminService.GetUserByIdentifier:input_type -> usersservice.v1.GetUserByIdentifierRequest - 2, // 15: usersservice.v1.UsersAdminService.BanUser:input_type -> usersservice.v1.BanUserRequest - 3, // 16: usersservice.v1.UsersAdminService.UnbanUser:input_type -> usersservice.v1.UnbanUserRequest - 9, // 17: usersservice.v1.UsersAdminService.SearchUsers:output_type -> usersservice.v1.SearchUsersResponse - 12, // 18: usersservice.v1.UsersAdminService.GetUserByIdentifier:output_type -> usersservice.v1.UserAdmin - 13, // 19: usersservice.v1.UsersAdminService.BanUser:output_type -> google.protobuf.Empty - 13, // 20: usersservice.v1.UsersAdminService.UnbanUser:output_type -> google.protobuf.Empty - 17, // [17:21] is the sub-list for method output_type - 13, // [13:17] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 2, // 13: usersservice.v1.UpdateUserRoleRequest.role:type_name -> usersservice.v1.Role + 3, // 14: usersservice.v1.UsersAdminService.SearchUsers:input_type -> usersservice.v1.SearchUsersRequest + 9, // 15: usersservice.v1.UsersAdminService.GetUserByIdentifier:input_type -> usersservice.v1.GetUserByIdentifierRequest + 12, // 16: usersservice.v1.UsersAdminService.UpdateUserRole:input_type -> usersservice.v1.UpdateUserRoleRequest + 10, // 17: usersservice.v1.UsersAdminService.BanUser:input_type -> usersservice.v1.BanUserRequest + 11, // 18: usersservice.v1.UsersAdminService.UnbanUser:input_type -> usersservice.v1.UnbanUserRequest + 8, // 19: usersservice.v1.UsersAdminService.SearchUsers:output_type -> usersservice.v1.SearchUsersResponse + 14, // 20: usersservice.v1.UsersAdminService.GetUserByIdentifier:output_type -> usersservice.v1.UserAdmin + 15, // 21: usersservice.v1.UsersAdminService.UpdateUserRole:output_type -> google.protobuf.Empty + 15, // 22: usersservice.v1.UsersAdminService.BanUser:output_type -> google.protobuf.Empty + 15, // 23: usersservice.v1.UsersAdminService.UnbanUser:output_type -> google.protobuf.Empty + 19, // [19:24] is the sub-list for method output_type + 14, // [14:19] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_external_users_v1_admin_proto_init() } @@ -906,8 +1043,8 @@ func file_external_users_v1_admin_proto_init() { return } file_external_users_v1_shared_proto_init() - file_external_users_v1_admin_proto_msgTypes[2].OneofWrappers = []any{} - file_external_users_v1_admin_proto_msgTypes[8].OneofWrappers = []any{ + file_external_users_v1_admin_proto_msgTypes[0].OneofWrappers = []any{} + file_external_users_v1_admin_proto_msgTypes[6].OneofWrappers = []any{ (*GetUserByIdentifierRequest_UserId)(nil), (*GetUserByIdentifierRequest_Username)(nil), (*GetUserByIdentifierRequest_Email)(nil), @@ -917,8 +1054,8 @@ func file_external_users_v1_admin_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_admin_proto_rawDesc), len(file_external_users_v1_admin_proto_rawDesc)), - NumEnums: 2, - NumMessages: 9, + NumEnums: 3, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/external/users/v1/admin.pb.gw.go b/gen/external/users/v1/admin.pb.gw.go index 8fd3efa..2d986d9 100644 --- a/gen/external/users/v1/admin.pb.gw.go +++ b/gen/external/users/v1/admin.pb.gw.go @@ -83,6 +83,30 @@ func local_request_UsersAdminService_GetUserByIdentifier_0(ctx context.Context, return msg, metadata, err } +func request_UsersAdminService_UpdateUserRole_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateUserRoleRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.UpdateUserRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_UsersAdminService_UpdateUserRole_0(ctx context.Context, marshaler runtime.Marshaler, server UsersAdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq UpdateUserRoleRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.UpdateUserRole(ctx, &protoReq) + return msg, metadata, err +} + func request_UsersAdminService_BanUser_0(ctx context.Context, marshaler runtime.Marshaler, client UsersAdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var ( protoReq BanUserRequest @@ -177,6 +201,26 @@ func RegisterUsersAdminServiceHandlerServer(ctx context.Context, mux *runtime.Se } forward_UsersAdminService_GetUserByIdentifier_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_UpdateUserRole_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) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/usersservice.v1.UsersAdminService/UpdateUserRole", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/UpdateUserRole")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UsersAdminService_UpdateUserRole_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_UpdateUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_UsersAdminService_BanUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -291,6 +335,23 @@ func RegisterUsersAdminServiceHandlerClient(ctx context.Context, mux *runtime.Se } forward_UsersAdminService_GetUserByIdentifier_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodPost, pattern_UsersAdminService_UpdateUserRole_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) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/usersservice.v1.UsersAdminService/UpdateUserRole", runtime.WithHTTPPathPattern("/usersservice.v1.UsersAdminService/UpdateUserRole")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UsersAdminService_UpdateUserRole_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_UsersAdminService_UpdateUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle(http.MethodPost, pattern_UsersAdminService_BanUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -331,6 +392,7 @@ func RegisterUsersAdminServiceHandlerClient(ctx context.Context, mux *runtime.Se var ( pattern_UsersAdminService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "SearchUsers"}, "")) pattern_UsersAdminService_GetUserByIdentifier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "GetUserByIdentifier"}, "")) + pattern_UsersAdminService_UpdateUserRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "UpdateUserRole"}, "")) pattern_UsersAdminService_BanUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "BanUser"}, "")) pattern_UsersAdminService_UnbanUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"usersservice.v1.UsersAdminService", "UnbanUser"}, "")) ) @@ -338,6 +400,7 @@ var ( var ( forward_UsersAdminService_SearchUsers_0 = runtime.ForwardResponseMessage forward_UsersAdminService_GetUserByIdentifier_0 = runtime.ForwardResponseMessage + forward_UsersAdminService_UpdateUserRole_0 = runtime.ForwardResponseMessage forward_UsersAdminService_BanUser_0 = runtime.ForwardResponseMessage forward_UsersAdminService_UnbanUser_0 = runtime.ForwardResponseMessage ) diff --git a/gen/external/users/v1/admin_grpc.pb.go b/gen/external/users/v1/admin_grpc.pb.go index 1f6c009..0f8c054 100644 --- a/gen/external/users/v1/admin_grpc.pb.go +++ b/gen/external/users/v1/admin_grpc.pb.go @@ -22,6 +22,7 @@ const _ = grpc.SupportPackageIsVersion9 const ( UsersAdminService_SearchUsers_FullMethodName = "/usersservice.v1.UsersAdminService/SearchUsers" UsersAdminService_GetUserByIdentifier_FullMethodName = "/usersservice.v1.UsersAdminService/GetUserByIdentifier" + UsersAdminService_UpdateUserRole_FullMethodName = "/usersservice.v1.UsersAdminService/UpdateUserRole" UsersAdminService_BanUser_FullMethodName = "/usersservice.v1.UsersAdminService/BanUser" UsersAdminService_UnbanUser_FullMethodName = "/usersservice.v1.UsersAdminService/UnbanUser" ) @@ -29,10 +30,30 @@ const ( // UsersAdminServiceClient is the client API for UsersAdminService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// Users Admin Service has methods for manage user's profiles via Admin access type UsersAdminServiceClient interface { + //* + // Search users profile with pagination and filters + // Auth: Admin SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) + //* + // Get User profile with Admin view, possible use one of profile identifier. + // It can be id, email or username. + // Auth: Admin GetUserByIdentifier(ctx context.Context, in *GetUserByIdentifierRequest, opts ...grpc.CallOption) (*UserAdmin, error) + //* + // Set new user profile role + // Auth: Super + UpdateUserRole(ctx context.Context, in *UpdateUserRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + //* + // Method for ban user, it's happens by set delete_at a date. After ban, impossible login. + // Auth: Super BanUser(ctx context.Context, in *BanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + //* + // Method for unban user profile, it's happens by set delete_at a null. + // Auth: Super UnbanUser(ctx context.Context, in *UnbanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -64,6 +85,16 @@ func (c *usersAdminServiceClient) GetUserByIdentifier(ctx context.Context, in *G return out, nil } +func (c *usersAdminServiceClient) UpdateUserRole(ctx context.Context, in *UpdateUserRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UsersAdminService_UpdateUserRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *usersAdminServiceClient) BanUser(ctx context.Context, in *BanUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) @@ -87,10 +118,30 @@ func (c *usersAdminServiceClient) UnbanUser(ctx context.Context, in *UnbanUserRe // UsersAdminServiceServer is the server API for UsersAdminService service. // All implementations should embed UnimplementedUsersAdminServiceServer // for forward compatibility. +// +// * +// Users Admin Service has methods for manage user's profiles via Admin access type UsersAdminServiceServer interface { + //* + // Search users profile with pagination and filters + // Auth: Admin SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) + //* + // Get User profile with Admin view, possible use one of profile identifier. + // It can be id, email or username. + // Auth: Admin GetUserByIdentifier(context.Context, *GetUserByIdentifierRequest) (*UserAdmin, error) + //* + // Set new user profile role + // Auth: Super + UpdateUserRole(context.Context, *UpdateUserRoleRequest) (*emptypb.Empty, error) + //* + // Method for ban user, it's happens by set delete_at a date. After ban, impossible login. + // Auth: Super BanUser(context.Context, *BanUserRequest) (*emptypb.Empty, error) + //* + // Method for unban user profile, it's happens by set delete_at a null. + // Auth: Super UnbanUser(context.Context, *UnbanUserRequest) (*emptypb.Empty, error) } @@ -107,6 +158,9 @@ func (UnimplementedUsersAdminServiceServer) SearchUsers(context.Context, *Search func (UnimplementedUsersAdminServiceServer) GetUserByIdentifier(context.Context, *GetUserByIdentifierRequest) (*UserAdmin, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserByIdentifier not implemented") } +func (UnimplementedUsersAdminServiceServer) UpdateUserRole(context.Context, *UpdateUserRoleRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserRole not implemented") +} func (UnimplementedUsersAdminServiceServer) BanUser(context.Context, *BanUserRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method BanUser not implemented") } @@ -169,6 +223,24 @@ func _UsersAdminService_GetUserByIdentifier_Handler(srv interface{}, ctx context return interceptor(ctx, in, info, handler) } +func _UsersAdminService_UpdateUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersAdminServiceServer).UpdateUserRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersAdminService_UpdateUserRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersAdminServiceServer).UpdateUserRole(ctx, req.(*UpdateUserRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _UsersAdminService_BanUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BanUserRequest) if err := dec(in); err != nil { @@ -220,6 +292,10 @@ var UsersAdminService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetUserByIdentifier", Handler: _UsersAdminService_GetUserByIdentifier_Handler, }, + { + MethodName: "UpdateUserRole", + Handler: _UsersAdminService_UpdateUserRole_Handler, + }, { MethodName: "BanUser", Handler: _UsersAdminService_BanUser_Handler, diff --git a/gen/external/users/v1/auth.pb.go b/gen/external/users/v1/auth.pb.go index c90c1df..857452c 100644 --- a/gen/external/users/v1/auth.pb.go +++ b/gen/external/users/v1/auth.pb.go @@ -22,6 +22,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// * +// Represents register method argument for register new profile in system. All fields are required for action type RegisterRequest struct { state protoimpl.MessageState `protogen:"open.v1"` AvatarId int32 `protobuf:"varint,1,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` @@ -90,6 +92,8 @@ func (x *RegisterRequest) GetPassword() string { return "" } +// * +// Message that contain registered profile and JWT token for future usage type RegisterResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` @@ -142,6 +146,8 @@ func (x *RegisterResponse) GetProfile() *Profile { return nil } +// * +// Represents login method argument that allows user login in system type LoginRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Identifier: @@ -232,6 +238,8 @@ func (*LoginRequest_Username) isLoginRequest_Identifier() {} func (*LoginRequest_Email) isLoginRequest_Identifier() {} +// * +// Represents result of login request, contain user's profile and JWT token type LoginResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` @@ -284,6 +292,8 @@ func (x *LoginResponse) GetProfile() *Profile { return nil } +// * +// Message for request to logout, user id is required type LogoutRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` @@ -328,54 +338,20 @@ func (x *LogoutRequest) GetUserId() string { return "" } -type LogoutResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogoutResponse) Reset() { - *x = LogoutResponse{} - mi := &file_external_users_v1_auth_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LogoutResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogoutResponse) ProtoMessage() {} - -func (x *LogoutResponse) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_auth_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead. -func (*LogoutResponse) Descriptor() ([]byte, []int) { - return file_external_users_v1_auth_proto_rawDescGZIP(), []int{5} -} - +// * +// Message is argument of request to register or login in system using OAuth2 providers type OAuthLoginRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` - Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` - Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // Provider token + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` // Name of provider + Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` // Code of provider unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *OAuthLoginRequest) Reset() { *x = OAuthLoginRequest{} - mi := &file_external_users_v1_auth_proto_msgTypes[6] + mi := &file_external_users_v1_auth_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -387,7 +363,7 @@ func (x *OAuthLoginRequest) String() string { func (*OAuthLoginRequest) ProtoMessage() {} func (x *OAuthLoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_auth_proto_msgTypes[6] + mi := &file_external_users_v1_auth_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -400,7 +376,7 @@ func (x *OAuthLoginRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use OAuthLoginRequest.ProtoReflect.Descriptor instead. func (*OAuthLoginRequest) Descriptor() ([]byte, []int) { - return file_external_users_v1_auth_proto_rawDescGZIP(), []int{6} + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{5} } func (x *OAuthLoginRequest) GetToken() string { @@ -424,6 +400,8 @@ func (x *OAuthLoginRequest) GetCode() string { return "" } +// * +// Represents a result of method for login or register via OAuth2 type OAuthLoginResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Profile *Profile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` @@ -434,7 +412,7 @@ type OAuthLoginResponse struct { func (x *OAuthLoginResponse) Reset() { *x = OAuthLoginResponse{} - mi := &file_external_users_v1_auth_proto_msgTypes[7] + mi := &file_external_users_v1_auth_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -446,7 +424,7 @@ func (x *OAuthLoginResponse) String() string { func (*OAuthLoginResponse) ProtoMessage() {} func (x *OAuthLoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_auth_proto_msgTypes[7] + mi := &file_external_users_v1_auth_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -459,7 +437,7 @@ func (x *OAuthLoginResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use OAuthLoginResponse.ProtoReflect.Descriptor instead. func (*OAuthLoginResponse) Descriptor() ([]byte, []int) { - return file_external_users_v1_auth_proto_rawDescGZIP(), []int{7} + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{6} } func (x *OAuthLoginResponse) GetProfile() *Profile { @@ -476,6 +454,8 @@ func (x *OAuthLoginResponse) GetIsNewUser() bool { return false } +// * +// Represents rpc method argument for link existing system account with OAuth2 providers type LinkOAuthProviderRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` @@ -487,7 +467,7 @@ type LinkOAuthProviderRequest struct { func (x *LinkOAuthProviderRequest) Reset() { *x = LinkOAuthProviderRequest{} - mi := &file_external_users_v1_auth_proto_msgTypes[8] + mi := &file_external_users_v1_auth_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -499,7 +479,7 @@ func (x *LinkOAuthProviderRequest) String() string { func (*LinkOAuthProviderRequest) ProtoMessage() {} func (x *LinkOAuthProviderRequest) ProtoReflect() protoreflect.Message { - mi := &file_external_users_v1_auth_proto_msgTypes[8] + mi := &file_external_users_v1_auth_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -512,7 +492,7 @@ func (x *LinkOAuthProviderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LinkOAuthProviderRequest.ProtoReflect.Descriptor instead. func (*LinkOAuthProviderRequest) Descriptor() ([]byte, []int) { - return file_external_users_v1_auth_proto_rawDescGZIP(), []int{8} + return file_external_users_v1_auth_proto_rawDescGZIP(), []int{7} } func (x *LinkOAuthProviderRequest) GetUserId() string { @@ -574,55 +554,54 @@ var file_external_users_v1_auth_proto_rawDesc = string([]byte{ 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x28, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x10, 0x0a, - 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x59, 0x0a, 0x11, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x68, 0x0a, 0x12, 0x4f, 0x41, - 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x32, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, - 0x55, 0x73, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x18, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, - 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x32, 0x9c, 0x03, 0x0a, 0x10, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, - 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x75, 0x73, 0x65, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x59, 0x0a, + 0x11, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x68, 0x0a, 0x12, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, + 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x55, 0x73, + 0x65, 0x72, 0x22, 0x63, 0x0a, 0x18, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x32, 0x9c, 0x03, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x08, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x46, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, - 0x74, 0x12, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 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, 0x12, 0x55, 0x0a, 0x0a, 0x4f, 0x41, 0x75, - 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, - 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x56, 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, - 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 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, 0x42, 0x12, 0x5a, 0x10, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, + 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, + 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 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, 0x12, 0x55, 0x0a, 0x0a, 0x4f, 0x41, 0x75, 0x74, 0x68, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, + 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 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, 0x42, 0x12, 0x5a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, }) var ( @@ -637,39 +616,38 @@ func file_external_users_v1_auth_proto_rawDescGZIP() []byte { return file_external_users_v1_auth_proto_rawDescData } -var file_external_users_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_external_users_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_external_users_v1_auth_proto_goTypes = []any{ (*RegisterRequest)(nil), // 0: usersservice.v1.RegisterRequest (*RegisterResponse)(nil), // 1: usersservice.v1.RegisterResponse (*LoginRequest)(nil), // 2: usersservice.v1.LoginRequest (*LoginResponse)(nil), // 3: usersservice.v1.LoginResponse (*LogoutRequest)(nil), // 4: usersservice.v1.LogoutRequest - (*LogoutResponse)(nil), // 5: usersservice.v1.LogoutResponse - (*OAuthLoginRequest)(nil), // 6: usersservice.v1.OAuthLoginRequest - (*OAuthLoginResponse)(nil), // 7: usersservice.v1.OAuthLoginResponse - (*LinkOAuthProviderRequest)(nil), // 8: usersservice.v1.LinkOAuthProviderRequest - (*Profile)(nil), // 9: usersservice.v1.Profile - (*emptypb.Empty)(nil), // 10: google.protobuf.Empty + (*OAuthLoginRequest)(nil), // 5: usersservice.v1.OAuthLoginRequest + (*OAuthLoginResponse)(nil), // 6: usersservice.v1.OAuthLoginResponse + (*LinkOAuthProviderRequest)(nil), // 7: usersservice.v1.LinkOAuthProviderRequest + (*Profile)(nil), // 8: usersservice.v1.Profile + (*emptypb.Empty)(nil), // 9: google.protobuf.Empty } var file_external_users_v1_auth_proto_depIdxs = []int32{ - 9, // 0: usersservice.v1.RegisterResponse.profile:type_name -> usersservice.v1.Profile - 9, // 1: usersservice.v1.LoginResponse.profile:type_name -> usersservice.v1.Profile - 9, // 2: usersservice.v1.OAuthLoginResponse.profile:type_name -> usersservice.v1.Profile - 0, // 3: usersservice.v1.UsersAuthService.Register:input_type -> usersservice.v1.RegisterRequest - 2, // 4: usersservice.v1.UsersAuthService.Login:input_type -> usersservice.v1.LoginRequest - 4, // 5: usersservice.v1.UsersAuthService.Logout:input_type -> usersservice.v1.LogoutRequest - 6, // 6: usersservice.v1.UsersAuthService.OAuthLogin:input_type -> usersservice.v1.OAuthLoginRequest - 8, // 7: usersservice.v1.UsersAuthService.LinkOAuthProvider:input_type -> usersservice.v1.LinkOAuthProviderRequest - 1, // 8: usersservice.v1.UsersAuthService.Register:output_type -> usersservice.v1.RegisterResponse - 3, // 9: usersservice.v1.UsersAuthService.Login:output_type -> usersservice.v1.LoginResponse - 10, // 10: usersservice.v1.UsersAuthService.Logout:output_type -> google.protobuf.Empty - 7, // 11: usersservice.v1.UsersAuthService.OAuthLogin:output_type -> usersservice.v1.OAuthLoginResponse - 10, // 12: usersservice.v1.UsersAuthService.LinkOAuthProvider:output_type -> google.protobuf.Empty - 8, // [8:13] is the sub-list for method output_type - 3, // [3:8] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 8, // 0: usersservice.v1.RegisterResponse.profile:type_name -> usersservice.v1.Profile + 8, // 1: usersservice.v1.LoginResponse.profile:type_name -> usersservice.v1.Profile + 8, // 2: usersservice.v1.OAuthLoginResponse.profile:type_name -> usersservice.v1.Profile + 0, // 3: usersservice.v1.UsersAuthService.Register:input_type -> usersservice.v1.RegisterRequest + 2, // 4: usersservice.v1.UsersAuthService.Login:input_type -> usersservice.v1.LoginRequest + 4, // 5: usersservice.v1.UsersAuthService.Logout:input_type -> usersservice.v1.LogoutRequest + 5, // 6: usersservice.v1.UsersAuthService.OAuthLogin:input_type -> usersservice.v1.OAuthLoginRequest + 7, // 7: usersservice.v1.UsersAuthService.LinkOAuthProvider:input_type -> usersservice.v1.LinkOAuthProviderRequest + 1, // 8: usersservice.v1.UsersAuthService.Register:output_type -> usersservice.v1.RegisterResponse + 3, // 9: usersservice.v1.UsersAuthService.Login:output_type -> usersservice.v1.LoginResponse + 9, // 10: usersservice.v1.UsersAuthService.Logout:output_type -> google.protobuf.Empty + 6, // 11: usersservice.v1.UsersAuthService.OAuthLogin:output_type -> usersservice.v1.OAuthLoginResponse + 9, // 12: usersservice.v1.UsersAuthService.LinkOAuthProvider:output_type -> google.protobuf.Empty + 8, // [8:13] is the sub-list for method output_type + 3, // [3:8] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_external_users_v1_auth_proto_init() } @@ -688,7 +666,7 @@ func file_external_users_v1_auth_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_users_v1_auth_proto_rawDesc), len(file_external_users_v1_auth_proto_rawDesc)), NumEnums: 0, - NumMessages: 9, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/external/users/v1/auth_grpc.pb.go b/gen/external/users/v1/auth_grpc.pb.go index 7f76bf5..f0bd975 100644 --- a/gen/external/users/v1/auth_grpc.pb.go +++ b/gen/external/users/v1/auth_grpc.pb.go @@ -30,11 +30,19 @@ const ( // UsersAuthServiceClient is the client API for UsersAuthService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// User Auth Service manage of user's register, logging and logout in system type UsersAuthServiceClient interface { + // Method for register new user in system, all filed are required. Returns created user profile on success and JWT token for usage Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) + // Allow already registered users login in system using email or username an password. Returns user profile and JWT token Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + // Logout method mark user profile inactive in system and update git last login date. Can be use by user or client Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // UNIMPLEMENTED - Allow register of login users using OAuth2 tools. Returns user profile, JWT token and bool flag if user is new OAuthLogin(ctx context.Context, in *OAuthLoginRequest, opts ...grpc.CallOption) (*OAuthLoginResponse, error) + // UNIMPLEMENTED - Allow already registered user connect system profile with his account that provides OAuth2 tools LinkOAuthProvider(ctx context.Context, in *LinkOAuthProviderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -99,11 +107,19 @@ func (c *usersAuthServiceClient) LinkOAuthProvider(ctx context.Context, in *Link // UsersAuthServiceServer is the server API for UsersAuthService service. // All implementations should embed UnimplementedUsersAuthServiceServer // for forward compatibility. +// +// * +// User Auth Service manage of user's register, logging and logout in system type UsersAuthServiceServer interface { + // Method for register new user in system, all filed are required. Returns created user profile on success and JWT token for usage Register(context.Context, *RegisterRequest) (*RegisterResponse, error) + // Allow already registered users login in system using email or username an password. Returns user profile and JWT token Login(context.Context, *LoginRequest) (*LoginResponse, error) + // Logout method mark user profile inactive in system and update git last login date. Can be use by user or client Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error) + // UNIMPLEMENTED - Allow register of login users using OAuth2 tools. Returns user profile, JWT token and bool flag if user is new OAuthLogin(context.Context, *OAuthLoginRequest) (*OAuthLoginResponse, error) + // UNIMPLEMENTED - Allow already registered user connect system profile with his account that provides OAuth2 tools LinkOAuthProvider(context.Context, *LinkOAuthProviderRequest) (*emptypb.Empty, error) } diff --git a/gen/external/users/v1/profile.pb.go b/gen/external/users/v1/profile.pb.go index 03d48cd..d13f578 100644 --- a/gen/external/users/v1/profile.pb.go +++ b/gen/external/users/v1/profile.pb.go @@ -22,6 +22,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// * +// Represents request argument for getting user profile. Required on of identifier type GetProfileRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Identifier: @@ -104,6 +106,9 @@ func (*GetProfileRequest_UserId) isGetProfileRequest_Identifier() {} func (*GetProfileRequest_Username) isGetProfileRequest_Identifier() {} +// * +// Represents request result of getting user profile. Contain one of possible data. Profile what can be requester only his owner +// or User (short profile) what can be requested anyone type GetProfileResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Data: @@ -186,6 +191,9 @@ func (*GetProfileResponse_Profile) isGetProfileResponse_Data() {} func (*GetProfileResponse_User) isGetProfileResponse_Data() {} +// * +// Represents request argument for update some user's account data. User id always required, any others files are optional. +// They can be provided seperated or in one message type UpdateProfileRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` @@ -238,6 +246,8 @@ func (x *UpdateProfileRequest) GetUsername() string { return "" } +// * +// Represents request argument for set new profile's avatar id. User id always required type UpdateAvatarRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` @@ -290,6 +300,8 @@ func (x *UpdateAvatarRequest) GetAvatarId() int32 { return 0 } +// * +// Represents request message for reset user's profile password. User id always required type ChangePasswordRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` @@ -342,6 +354,8 @@ func (x *ChangePasswordRequest) GetPassword() string { return "" } +// * +// Message that required user id for mark his account as deleted in system type DeleteAccountRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` diff --git a/gen/external/users/v1/profile_grpc.pb.go b/gen/external/users/v1/profile_grpc.pb.go index 7b1b4aa..1ce95ae 100644 --- a/gen/external/users/v1/profile_grpc.pb.go +++ b/gen/external/users/v1/profile_grpc.pb.go @@ -30,11 +30,24 @@ const ( // UsersProfileServiceClient is the client API for UsersProfileService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// User Profile Service contain methods for self manage user profile type UsersProfileServiceClient interface { + // Method allow get existing user profile user his id or username. For self profile request user get more infirmation, for side user less + // Auth: Self/User GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error) + // Method allow user update his account + // Auth: Self UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method allow user update hiw profile avatar + // Auth: Self UpdateAvatar(ctx context.Context, in *UpdateAvatarRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method allow user reset his password + // Auth: Self ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method allow user delete his account (not fully) + // Auth: Self DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -99,11 +112,24 @@ func (c *usersProfileServiceClient) DeleteAccount(ctx context.Context, in *Delet // UsersProfileServiceServer is the server API for UsersProfileService service. // All implementations should embed UnimplementedUsersProfileServiceServer // for forward compatibility. +// +// * +// User Profile Service contain methods for self manage user profile type UsersProfileServiceServer interface { + // Method allow get existing user profile user his id or username. For self profile request user get more infirmation, for side user less + // Auth: Self/User GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) + // Method allow user update his account + // Auth: Self UpdateProfile(context.Context, *UpdateProfileRequest) (*emptypb.Empty, error) + // Method allow user update hiw profile avatar + // Auth: Self UpdateAvatar(context.Context, *UpdateAvatarRequest) (*emptypb.Empty, error) + // Method allow user reset his password + // Auth: Self ChangePassword(context.Context, *ChangePasswordRequest) (*emptypb.Empty, error) + // Method allow user delete his account (not fully) + // Auth: Self DeleteAccount(context.Context, *DeleteAccountRequest) (*emptypb.Empty, error) } diff --git a/gen/external/users/v1/shared.pb.go b/gen/external/users/v1/shared.pb.go index e650848..3f9c117 100644 --- a/gen/external/users/v1/shared.pb.go +++ b/gen/external/users/v1/shared.pb.go @@ -25,10 +25,10 @@ const ( type Status int32 const ( - Status_STATUS_UNSPECIFIED Status = 0 - Status_STATUS_PENDING Status = 1 - Status_STATUS_ACCEPTED Status = 2 - Status_STATUS_BLOCKED Status = 3 + Status_STATUS_UNSPECIFIED Status = 0 // Is technical status + Status_STATUS_PENDING Status = 1 // Means that requested waiting for recipient action + Status_STATUS_ACCEPTED Status = 2 // Means that friendship is active for both users + Status_STATUS_BLOCKED Status = 3 // Means that one of friend did block another and friendship exists but is inactive ) // Enum value maps for Status. @@ -74,16 +74,18 @@ func (Status) EnumDescriptor() ([]byte, []int) { return file_external_users_v1_shared_proto_rawDescGZIP(), []int{0} } +// * +// Message represents user profile that can be shown only for his owner type Profile struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` - Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating,omitempty"` - Coins int64 `protobuf:"varint,6,opt,name=coins,proto3" json:"coins,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // User id is actually UUID + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` // Is a id of avatars preset + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` // Username is a string, no longer then 32 char + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Email is a string, no longer then 128 char + Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating,omitempty"` // Is a int filed that represents user rating + Coins int64 `protobuf:"varint,6,opt,name=coins,proto3" json:"coins,omitempty"` // Is a int value that represents amount of user's coins + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Is a date when user was registered, cannot be null + LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` // Is a date when user was last active, can be null unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -174,14 +176,16 @@ func (x *Profile) GetLastLoginAt() *timestamppb.Timestamp { return nil } +// * +// Message represents user profile that can be shown anyone type User struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Rating int32 `protobuf:"varint,4,opt,name=rating,proto3" json:"rating,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // User id is actually UUID + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` // Is a id of avatars preset + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` // Username is a string, no longer then 32 char + Rating int32 `protobuf:"varint,4,opt,name=rating,proto3" json:"rating,omitempty"` // Is a int filed that represents user rating + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Is a date when user was registered, cannot be null + LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` // Is a date when user was last active, can be null unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -258,17 +262,19 @@ func (x *User) GetLastLoginAt() *timestamppb.Timestamp { return nil } +// * +// Message represents user profile that can be shown only admin type UserAdmin struct { state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` - Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating,omitempty"` - Coins int64 `protobuf:"varint,6,opt,name=coins,proto3" json:"coins,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` - DeletedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=deleted_at,json=deletedAt,proto3,oneof" json:"deleted_at,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // User id is actually UUID + AvatarId int32 `protobuf:"varint,2,opt,name=avatar_id,json=avatarId,proto3" json:"avatar_id,omitempty"` // Is a id of avatars preset + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` // Username is a string, no longer then 32 char + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Email is a string, no longer then 128 char + Rating int32 `protobuf:"varint,5,opt,name=rating,proto3" json:"rating,omitempty"` // Is a int filed that represents user rating + Coins int64 `protobuf:"varint,6,opt,name=coins,proto3" json:"coins,omitempty"` // Is a int value that represents amount of user's coins + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Is a date when user was registered, cannot be null + LastLoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=last_login_at,json=lastLoginAt,proto3,oneof" json:"last_login_at,omitempty"` // Is a date when user was last active, can be null + DeletedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=deleted_at,json=deletedAt,proto3,oneof" json:"deleted_at,omitempty"` // Is a date when user profile was deleted by owner or banned by admin unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -366,6 +372,8 @@ func (x *UserAdmin) GetDeletedAt() *timestamppb.Timestamp { return nil } +// * +// Message represents user's friends, actually is a list of user profiles with friendship status type FriendsList struct { state protoimpl.MessageState `protogen:"open.v1"` Friends []*Friend `protobuf:"bytes,1,rep,name=friends,proto3" json:"friends,omitempty"` @@ -412,8 +420,8 @@ func (x *FriendsList) GetFriends() []*Friend { type Friend struct { state protoimpl.MessageState `protogen:"open.v1"` - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=usersservice.v1.Status" json:"status,omitempty"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // A user that interact with another + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=usersservice.v1.Status" json:"status,omitempty"` // Status of friendship, this is shared status, it means if one person accepted request on fiendship, it will be accepted for both unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } diff --git a/gen/external/users/v1/social.pb.go b/gen/external/users/v1/social.pb.go index 485ae8c..4f08e9d 100644 --- a/gen/external/users/v1/social.pb.go +++ b/gen/external/users/v1/social.pb.go @@ -22,10 +22,12 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// * +// Represents request argument for creating friendship, all fields are required type AddFriendRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` - RecipientId string `protobuf:"bytes,2,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` + RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` // Requested id is id of user that is initiator of action + RecipientId string `protobuf:"bytes,2,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` // Recipient id is id of user that is terminator of action unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -74,10 +76,12 @@ func (x *AddFriendRequest) GetRecipientId() string { return "" } +// * +// Represents request argument for make friendship active, all fields are required type AcceptFriendRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - RecipientId string `protobuf:"bytes,1,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` - RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + RecipientId string `protobuf:"bytes,1,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` // Recipient id is id of user that got friendship request on want to act + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` // Requester id is id of user that was a initiator of the action unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -126,10 +130,12 @@ func (x *AcceptFriendRequest) GetRequesterId() string { return "" } +// * +// Represents request argument for rejecting proposed friendship, all fields are required type RejectFriendRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - RecipientId string `protobuf:"bytes,1,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` - RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + RecipientId string `protobuf:"bytes,1,opt,name=recipient_id,json=recipientId,proto3" json:"recipient_id,omitempty"` // Recipient id is id of user that got request on friendship but wants to reject it + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` // Requester id is id of user that was a initiator of the action unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -178,10 +184,12 @@ func (x *RejectFriendRequest) GetRequesterId() string { return "" } +// * +// Represents request argument for remove already existing friendship between users, all fields are required type RemoveFriendRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` - FriendId string `protobuf:"bytes,2,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` + RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` // Recipient id is id of user that is initiator of removing friendship + FriendId string `protobuf:"bytes,2,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` // Friend id is id of user that is a friend of removing friendship initiator unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -230,9 +238,11 @@ func (x *RemoveFriendRequest) GetFriendId() string { return "" } +// * +// Represents request argument for getting all his friends as a list type ListFriendsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // User id of initiator of get list friends action (self) unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -274,6 +284,8 @@ func (x *ListFriendsRequest) GetUserId() string { return "" } +// * +// Represents request argument for block friend. It will mark their friendship as blocked type BlockFriendRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` @@ -326,6 +338,8 @@ func (x *BlockFriendRequest) GetFriendId() string { return "" } +// * +// Represents request argument for unblock friend. It will mark their friendship as active (accepted) type UnblockFriendRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` diff --git a/gen/external/users/v1/social_grpc.pb.go b/gen/external/users/v1/social_grpc.pb.go index 6a223a8..c6056b9 100644 --- a/gen/external/users/v1/social_grpc.pb.go +++ b/gen/external/users/v1/social_grpc.pb.go @@ -32,13 +32,25 @@ const ( // UsersSocialServiceClient is the client API for UsersSocialService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// * +// Users Social Service allow users be active with others users type UsersSocialServiceClient interface { + // Method for asking another user be friends. It adds requested user request message on friendship AddFriend(ctx context.Context, in *AddFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method that set message on friendship active and adds users in shared relation (make users mutual related) AcceptFriend(ctx context.Context, in *AcceptFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method that reject message on friendship from requester RejectFriend(ctx context.Context, in *RejectFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method removes already created and active friendship between two users RemoveFriend(ctx context.Context, in *RemoveFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method for get all relations for specified user, result is users list with any relation (active/inactive) ListFriends(ctx context.Context, in *ListFriendsRequest, opts ...grpc.CallOption) (*FriendsList, error) + // Method for blocking friend (they will be not able to communicate witch each other) + // Auth: Self BlockFriend(ctx context.Context, in *BlockFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Method is reverse action of blocking. Allows user remove friend from black list + // Auth: Self UnblockFriend(ctx context.Context, in *UnblockFriendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -123,13 +135,25 @@ func (c *usersSocialServiceClient) UnblockFriend(ctx context.Context, in *Unbloc // UsersSocialServiceServer is the server API for UsersSocialService service. // All implementations should embed UnimplementedUsersSocialServiceServer // for forward compatibility. +// +// * +// Users Social Service allow users be active with others users type UsersSocialServiceServer interface { + // Method for asking another user be friends. It adds requested user request message on friendship AddFriend(context.Context, *AddFriendRequest) (*emptypb.Empty, error) + // Method that set message on friendship active and adds users in shared relation (make users mutual related) AcceptFriend(context.Context, *AcceptFriendRequest) (*emptypb.Empty, error) + // Method that reject message on friendship from requester RejectFriend(context.Context, *RejectFriendRequest) (*emptypb.Empty, error) + // Method removes already created and active friendship between two users RemoveFriend(context.Context, *RemoveFriendRequest) (*emptypb.Empty, error) + // Method for get all relations for specified user, result is users list with any relation (active/inactive) ListFriends(context.Context, *ListFriendsRequest) (*FriendsList, error) + // Method for blocking friend (they will be not able to communicate witch each other) + // Auth: Self BlockFriend(context.Context, *BlockFriendRequest) (*emptypb.Empty, error) + // Method is reverse action of blocking. Allows user remove friend from black list + // Auth: Self UnblockFriend(context.Context, *UnblockFriendRequest) (*emptypb.Empty, error) } diff --git a/go.mod b/go.mod index 2a1b6e0..0109e06 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 github.com/jackc/pgx/v5 v5.7.4 + github.com/redis/go-redis/v9 v9.7.3 github.com/stretchr/testify v1.10.0 github.com/testcontainers/testcontainers-go v0.36.0 go.uber.org/zap v1.27.0 @@ -101,7 +102,6 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect - github.com/redis/go-redis/v9 v9.7.3 // indirect github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/shirou/gopsutil/v4 v4.25.3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect diff --git a/internal/apis/handler/admin.go b/internal/apis/handler/admin.go index 1519a6e..40c848f 100644 --- a/internal/apis/handler/admin.go +++ b/internal/apis/handler/admin.go @@ -85,6 +85,30 @@ func (h *Handler) CreateQuestion(ctx context.Context, request *questionsv1.Creat return Empty, nil } +func (h *Handler) CreateQuestionOption(ctx context.Context, request *questionsv1.CreateQuestionOptionRequest) (*emptypb.Empty, error) { + err := h.auth.ValidateRoleWithContext(ctx, string(jwt.Admin)) + if err != nil { + return nil, err + } + + req, err := abstractions.MakeRequest[admin.CreateQuestionOptionRequest](request) + if err != nil { + return nil, err + } + + questionID, err := uuid.Parse(request.GetQuestionId()) + if err != nil { + return nil, apperrors.BadRequestHidden(err, "provided wrong uuid format") + } + + err = h.service.CreateQuestionOption(ctx, questionID, req) + if err != nil { + return nil, err + } + + return Empty, nil +} + func (h *Handler) UpdateCategory(ctx context.Context, request *questionsv1.UpdateCategoryRequest) (*emptypb.Empty, error) { err := h.auth.ValidateRoleWithContext(ctx, string(jwt.Admin)) if err != nil { diff --git a/internal/apis/service/admin.go b/internal/apis/service/admin.go index b13214e..cb5b4ef 100644 --- a/internal/apis/service/admin.go +++ b/internal/apis/service/admin.go @@ -26,6 +26,10 @@ func (s *Service) CreateQuestion(ctx context.Context, req *questions.CreateQuest return s.store.SaveQuestion(ctx, req.Hashed) } +func (s *Service) CreateQuestionOption(ctx context.Context, questionID uuid.UUID, req *admin.CreateQuestionOptionRequest) error { + return s.store.SaveQuestionOption(ctx, questionID, req) +} + func (s *Service) UpdateCategory(ctx context.Context, id int32, name string) error { return s.store.UpdateCategory(ctx, id, name) } diff --git a/internal/apis/service/service.go b/internal/apis/service/service.go index 000b04d..0242dfb 100644 --- a/internal/apis/service/service.go +++ b/internal/apis/service/service.go @@ -18,6 +18,7 @@ type IService interface { GetFilteredQuestions(ctx context.Context, filter *admin.QuestionsFilter) ([]*questions.Question, int, error) CreateCategory(ctx context.Context, name string) (int32, error) CreateQuestion(ctx context.Context, req *questions.CreateQuestionRequest) error + CreateQuestionOption(ctx context.Context, questionID uuid.UUID, req *admin.CreateQuestionOptionRequest) error UpdateCategory(ctx context.Context, id int32, name string) error UpdateQuestion(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionRequest) error UpdateQuestionOption(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionOptionRequest) error @@ -25,6 +26,8 @@ type IService interface { DeleteQuestionOption(ctx context.Context, id uuid.UUID) error } +var _ IService = (*Service)(nil) + type Service struct { store store.IStore logger *zap.Logger diff --git a/internal/apis/store/abstractions.go b/internal/apis/store/abstractions.go index 46ea791..3a6ba3b 100644 --- a/internal/apis/store/abstractions.go +++ b/internal/apis/store/abstractions.go @@ -17,6 +17,7 @@ type IStore interface { GetFilteredQuestions(ctx context.Context, filter *admin.QuestionsFilter) ([]*questions.Question, int, error) SaveCategory(ctx context.Context, name string) (int32, error) SaveQuestion(ctx context.Context, question *questions.Hashed) error + SaveQuestionOption(ctx context.Context, questionID uuid.UUID, req *admin.CreateQuestionOptionRequest) error UpdateCategory(ctx context.Context, id int32, name string) error UpdateQuestion(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionRequest) error UpdateQuestionOption(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionOptionRequest) error @@ -36,8 +37,11 @@ type IClientDatabase interface { type IAdminDatabase interface { GetFilteredQuestions(ctx context.Context, filter *admin.QuestionsFilter) ([]*questions.Question, int, error) + GetCategoryByID(ctx context.Context, id int32) (*questions.Category, error) + GetCategoryByName(ctx context.Context, name string) (*questions.Category, error) SaveCategory(ctx context.Context, name string) (int32, error) SaveQuestion(ctx context.Context, question *questions.Hashed) error + SaveQuestionOption(ctx context.Context, questionID uuid.UUID, req *admin.CreateQuestionOptionRequest) error UpdateCategory(ctx context.Context, id int32, name string) error UpdateQuestion(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionRequest) error UpdateQuestionOption(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionOptionRequest) error @@ -55,4 +59,6 @@ type ICache interface { GetCachedIDs(ctx context.Context, language, difficulty string, categoryID, amount int32) ([]uuid.UUID, int, error) GetBatchCachedIDs(ctx context.Context, language string, difficulties []string, categoryIDs []int32, amount int32) ([]uuid.UUID, int, error) AddCachedIDs(ctx context.Context, metas []*questions.Meta, timeout time.Duration) error + GetCategory(ctx context.Context, id int32) (*questions.Category, error) + AddCategory(ctx context.Context, category *questions.Category) error } diff --git a/internal/apis/store/admin.go b/internal/apis/store/admin.go index bc297d8..5ad0452 100644 --- a/internal/apis/store/admin.go +++ b/internal/apis/store/admin.go @@ -2,6 +2,9 @@ package store import ( "context" + "errors" + + apperrors "github.com/QuizWars-Ecosystem/go-common/pkg/error" "go.uber.org/zap" @@ -21,15 +24,62 @@ func (s *Store) GetFilteredQuestions(ctx context.Context, filter *admin.Question } func (s *Store) SaveCategory(ctx context.Context, name string) (int32, error) { - return s.db.SaveCategory(ctx, name) + id, err := s.db.SaveCategory(ctx, name) + if err != nil { + s.logger.Error("failed to save category", zap.Error(err)) + return 0, err + } + + err = s.cache.AddCategory(ctx, &questions.Category{ID: id, Name: name}) + if err != nil { + s.logger.Error("failed to cache category", zap.Error(err)) + } + + return id, nil } func (s *Store) SaveQuestion(ctx context.Context, question *questions.Hashed) error { + category, err := s.cache.GetCategory(ctx, question.Category.ID) + + var apperror *apperrors.Error + if errors.Is(err, apperror) || category == nil { + category, err = s.db.GetCategoryByID(ctx, question.Category.ID) + if errors.Is(err, apperror) || category == nil { + question.Category.ID, err = s.db.SaveCategory(ctx, question.Category.Name) + if err != nil { + s.logger.Error("failed to save category", zap.Error(err)) + return err + } + + err = s.cache.AddCategory(ctx, &question.Category) + if err != nil { + s.logger.Error("failed to cache category", zap.Error(err)) + } + } else { + return err + } + } + return s.db.SaveQuestion(ctx, question) } +func (s *Store) SaveQuestionOption(ctx context.Context, questionID uuid.UUID, req *admin.CreateQuestionOptionRequest) error { + return s.db.SaveQuestionOption(ctx, questionID, req) +} + func (s *Store) UpdateCategory(ctx context.Context, id int32, name string) error { - return s.db.UpdateCategory(ctx, id, name) + err := s.db.UpdateCategory(ctx, id, name) + if err != nil { + s.logger.Error("failed to update category", zap.Error(err)) + return err + } + + err = s.cache.AddCategory(ctx, &questions.Category{ID: id, Name: name}) + if err != nil { + s.logger.Error("failed to cache category", zap.Error(err)) + } + + return nil } func (s *Store) UpdateQuestion(ctx context.Context, id uuid.UUID, req *admin.UpdateQuestionRequest) error { diff --git a/internal/apis/store/cache/categories.go b/internal/apis/store/cache/categories.go new file mode 100644 index 0000000..22bbf42 --- /dev/null +++ b/internal/apis/store/cache/categories.go @@ -0,0 +1,43 @@ +package cache + +import ( + "context" + "encoding/json" + "errors" + "time" + + apperrors "github.com/QuizWars-Ecosystem/go-common/pkg/error" + "github.com/QuizWars-Ecosystem/questions-service/internal/models/questions" + "github.com/redis/go-redis/v9" +) + +func (c *Cache) GetCategory(ctx context.Context, id int32) (*questions.Category, error) { + data, err := c.db.Get(ctx, categoryKey(id)).Bytes() + + switch { + case errors.Is(err, redis.Nil): + return nil, apperrors.NotFound("category", "id", id) + case err != nil: + return nil, apperrors.Internal(err) + } + + var category questions.Category + if err = json.Unmarshal(data, &category); err != nil { + return nil, apperrors.Internal(err) + } + + return &category, nil +} + +func (c *Cache) AddCategory(ctx context.Context, category *questions.Category) error { + data, err := json.Marshal(category) + if err != nil { + return apperrors.Internal(err) + } + + if err = c.db.Set(ctx, categoryKey(category.ID), data, time.Hour*24).Err(); err != nil { + return apperrors.Internal(err) + } + + return nil +} diff --git a/internal/apis/store/cache/keys.go b/internal/apis/store/cache/keys.go index 4830fae..2e0f3ff 100644 --- a/internal/apis/store/cache/keys.go +++ b/internal/apis/store/cache/keys.go @@ -7,6 +7,7 @@ import ( const ( QuestionsCacheScheme = "questions:%s:%s:%d" + CategoryCacheScheme = "category:%d" ) func key(language, difficulty string, categoryID int32) string { @@ -28,3 +29,7 @@ func keyList(language string, difficulties []string, categoryIDs []int32) []stri func destinationKey() string { return fmt.Sprintf("temp:%d", time.Now().UnixMilli()) } + +func categoryKey(categoryID int32) string { + return fmt.Sprintf(CategoryCacheScheme, categoryID) +} diff --git a/internal/apis/store/db/admin.go b/internal/apis/store/db/admin.go index 0ea3126..de6bfff 100644 --- a/internal/apis/store/db/admin.go +++ b/internal/apis/store/db/admin.go @@ -138,6 +138,54 @@ func (db *Database) GetFilteredQuestions(ctx context.Context, filter *admin.Ques return qs, total, nil } +func (db *Database) GetCategoryByID(ctx context.Context, id int32) (*questions.Category, error) { + builder := dbx.StatementBuilder. + Select("id", "name"). + From("categories"). + Where(squirrel.Eq{"id": id}) + + query, args, err := builder.ToSql() + if err != nil { + return nil, apperrors.Internal(err) + } + + var category questions.Category + err = db.pool.QueryRow(ctx, query, args...).Scan(&category.ID, &category.Name) + + switch { + case dbx.IsNoRows(err): + return nil, apperrors.NotFound("category", "id", id) + case err != nil: + return nil, apperrors.Internal(err) + } + + return &category, nil +} + +func (db *Database) GetCategoryByName(ctx context.Context, name string) (*questions.Category, error) { + builder := dbx.StatementBuilder. + Select("id", "name"). + From("categories"). + Where(squirrel.Eq{"name": name}) + + query, args, err := builder.ToSql() + if err != nil { + return nil, apperrors.Internal(err) + } + + var category questions.Category + err = db.pool.QueryRow(ctx, query, args...).Scan(&category.ID, &category.Name) + + switch { + case dbx.IsNoRows(err): + return nil, apperrors.NotFound("category", "name", name) + case err != nil: + return nil, apperrors.Internal(err) + } + + return &category, nil +} + func (db *Database) SaveCategory(ctx context.Context, name string) (int32, error) { builder := dbx.StatementBuilder. Insert("categories"). @@ -226,6 +274,30 @@ func (db *Database) SaveQuestion(ctx context.Context, question *questions.Hashed return nil } +func (db *Database) SaveQuestionOption(ctx context.Context, questionID uuid.UUID, req *admin.CreateQuestionOptionRequest) error { + builder := dbx.StatementBuilder. + Insert("question_options"). + Columns("id", "question_id", "text", "is_correct"). + Values(req.ID, questionID, req.Text, req.IsCorrect). + Suffix("ON CONFLICT (id, question_id) DO NOTHING") + + query, args, err := builder.ToSql() + if err != nil { + return apperrors.Internal(err) + } + + _, err = db.pool.Exec(ctx, query, args...) + + switch { + case dbx.IsForeignKeyViolation(err, "question_id"): + return apperrors.NotFound("question", "id", questionID.String()) + case err != nil: + return apperrors.Internal(err) + } + + return nil +} + func (db *Database) UpdateCategory(ctx context.Context, id int32, name string) error { builder := dbx.StatementBuilder. Update("categories"). diff --git a/internal/apis/store/store.go b/internal/apis/store/store.go index 8645338..e52cac1 100644 --- a/internal/apis/store/store.go +++ b/internal/apis/store/store.go @@ -9,6 +9,8 @@ import ( "go.uber.org/zap" ) +var _ IStore = (*Store)(nil) + type Store struct { db IDatabase cache ICache @@ -24,7 +26,7 @@ func NewStore(pool *pgxpool.Pool, client abstractions.RedisClient, logger *zap.L if cfg.WarmUp { go func() { if err := store.warmUpStore(cfg.WarmUpAmount, cfg.WarmUpTimeout); err != nil { - store.logger.Warn("failed to warm up store", zap.Error(err)) + logger.Warn("failed to warm up store", zap.Error(err)) } }() } diff --git a/internal/models/admin/models.go b/internal/models/admin/models.go index 70b349f..4af152b 100644 --- a/internal/models/admin/models.go +++ b/internal/models/admin/models.go @@ -3,6 +3,8 @@ package admin import ( "time" + "github.com/google/uuid" + questionspb "github.com/QuizWars-Ecosystem/questions-service/gen/external/questions/v1" "github.com/QuizWars-Ecosystem/questions-service/internal/models/questions" ) @@ -22,6 +24,12 @@ const ( DESC Sort = "DESC" ) +type CreateQuestionOptionRequest struct { + ID uuid.UUID + Text string + IsCorrect bool +} + type UpdateQuestionRequest struct { Type *questions.Type Difficulty *questions.Difficulty diff --git a/internal/models/admin/requests.go b/internal/models/admin/requests.go index d967135..4ce8ace 100644 --- a/internal/models/admin/requests.go +++ b/internal/models/admin/requests.go @@ -6,6 +6,8 @@ import ( "strings" "time" + "github.com/google/uuid" + "github.com/QuizWars-Ecosystem/go-common/pkg/abstractions" questionsv1 "github.com/QuizWars-Ecosystem/questions-service/gen/external/questions/v1" "github.com/QuizWars-Ecosystem/questions-service/internal/models/questions" @@ -63,12 +65,30 @@ func (q QuestionsFilter) Request(req *questionsv1.GetFilteredQuestionsRequest) ( } func offsetLimit(page, size uint64) (uint64, uint64) { + if page <= 0 { + page = 1 + } + + if size < 10 { + size = 10 + } + offset := (page - 1) * size limit := size return offset, limit } +var _ abstractions.Requestable[CreateQuestionOptionRequest, *questionsv1.CreateQuestionOptionRequest] = (*CreateQuestionOptionRequest)(nil) + +func (c CreateQuestionOptionRequest) Request(req *questionsv1.CreateQuestionOptionRequest) (*CreateQuestionOptionRequest, error) { + c.ID = uuid.New() + c.Text = req.Text + c.IsCorrect = req.IsCorrect + + return &c, nil +} + var _ abstractions.Requestable[UpdateQuestionRequest, *questionsv1.UpdateQuestionRequest] = (*UpdateQuestionRequest)(nil) func (u UpdateQuestionRequest) Request(req *questionsv1.UpdateQuestionRequest) (*UpdateQuestionRequest, error) { diff --git a/internal/models/questions/models.go b/internal/models/questions/models.go index 39a15ac..9ff645c 100644 --- a/internal/models/questions/models.go +++ b/internal/models/questions/models.go @@ -7,8 +7,8 @@ import ( ) type Category struct { - ID int32 - Name string + ID int32 `json:"id"` + Name string `json:"name"` } type Question struct { diff --git a/protobuf b/protobuf index ead5e0c..1dea247 160000 --- a/protobuf +++ b/protobuf @@ -1 +1 @@ -Subproject commit ead5e0cd48f99b7b28adadd5d169db8f61c738c2 +Subproject commit 1dea247a6f9bcf7aa02dd8301c3cdb74cb041bee diff --git a/tests/integration_tests/modules/admin.go b/tests/integration_tests/modules/admin.go index a8ec206..0594074 100644 --- a/tests/integration_tests/modules/admin.go +++ b/tests/integration_tests/modules/admin.go @@ -251,6 +251,57 @@ func AdminServiceTest(t *testing.T, client questionsv1.QuestionsAdminServiceClie } }) + t.Run("admin.CreateQuestionOption: access token not provided", func(t *testing.T) { + _, err := client.CreateQuestionOption(emptyCtx, &questionsv1.CreateQuestionOptionRequest{}) + + require.Error(t, err) + testerror.RequireForbiddenError(t, err, jwt.AuthAccessTokenNotProvidedError) + }) + + t.Run("admin.CreateQuestionOption: invalid token", func(t *testing.T) { + _, err := client.CreateQuestionOption(invalidCtx, &questionsv1.CreateQuestionOptionRequest{}) + + require.Error(t, err) + testerror.RequireForbiddenError(t, err, jwt.AuthInvalidTokenError) + }) + + t.Run("admin.CreateQuestionOption: permission denied", func(t *testing.T) { + _, err := client.CreateQuestionOption(userCtx, &questionsv1.CreateQuestionOptionRequest{}) + + require.Error(t, err) + testerror.RequireForbiddenError(t, err, jwt.AuthPermissionDeniedError) + }) + + t.Run("admin.CreateQuestionOption: not found", func(t *testing.T) { + testID := uuid.New().String() + _, err := client.CreateQuestionOption(adminCtx, &questionsv1.CreateQuestionOptionRequest{ + QuestionId: testID, + Text: "New Text", + IsCorrect: false, + }) + + require.Error(t, err) + testerror.RequireNotFoundError(t, err, "question", "id", testID) + }) + + t.Run("admin.CreateQuestionOption: successful", func(t *testing.T) { + question := questionsMap[countriesRusQuestionsKey] + + req := &questionsv1.CreateQuestionOptionRequest{ + QuestionId: question.Id, + Text: "New option text", + IsCorrect: false, + } + + _, err := client.CreateQuestionOption(adminCtx, req) + + require.NoError(t, err) + question.Options = append(question.Options, &questionsv1.Option{ + Text: req.Text, + IsCorrect: req.IsCorrect, + }) + }) + t.Run("admin.UpdateQuestion: access token not provided", func(t *testing.T) { _, err := client.UpdateQuestion(emptyCtx, &questionsv1.UpdateQuestionRequest{})