diff --git a/datastores/datastore.go b/datastores/datastore.go index 7d63ee6..78a6c87 100644 --- a/datastores/datastore.go +++ b/datastores/datastore.go @@ -35,4 +35,5 @@ type Datastore interface { FindProfilesByUsername(username string) ([]*proto.Profile, error) FindRosterByType(rosterType proto.RosterType) (*proto.Roster, error) FindProfileByKeycloakID(keycloakId string) (*proto.Profile, error) + FindProfileByDiscordID(discordId string) (*proto.Profile, error) } diff --git a/datastores/mysql.go b/datastores/mysql.go index 7af697a..9ac53ee 100644 --- a/datastores/mysql.go +++ b/datastores/mysql.go @@ -120,6 +120,28 @@ func (ds Mysql) FindProfileByKeycloakID(keycloakId string) (*proto.Profile, erro return milpac, nil } +func (ds Mysql) FindProfileByDiscordID(discordId string) (*proto.Profile, error) { + var profile milpacs.Profile + + Info.Println("Searching for milpac profiles with discord IDs of: %s", discordId) + + query := map[string]interface{}{"xf_user_connected_account.provider_key": discordId, "xf_user_connected_account.provider": "nfDiscord"} + + ds.Db.Preload(clause.Associations). + Preload("AwardRecords.Award"). + Joins(xenforo.ConnectedAccountJoin). + Where(query). + First(&profile) + + milpac, err := ds.generateProtoProfile(profile) + + if err != nil { + return nil, fmt.Errorf("error generating profile") + } + + return milpac, nil +} + func (ds Mysql) generateProtoProfile(profile milpacs.Profile) (*proto.Profile, error) { milpac := &proto.Profile{ User: &proto.User{ @@ -197,7 +219,7 @@ func collectRecords(recordRows []milpacs.Record) []*proto.Record { RecordDetails: recordRow.Details, RecordType: proto.RecordType(recordRow.RecordTypeId), RecordDate: stringToTime(strconv.Itoa(int(recordRow.RecordDate))).Format(layoutISO), - RecordId: recordRow.RecordID, + RecordUid: recordRow.RecordID, } records = append(records, record) } @@ -214,7 +236,7 @@ func collectAwards(awardRows []milpacs.AwardRecord) []*proto.Award { AwardDetails: awardRow.Details, AwardDate: stringToTime(strconv.Itoa(int(awardRow.AwardDate))).Format(layoutISO), AwardImageUrl: awardRow.Award.ImageURL(), - RecordId: awardRow.RecordID, + AwardUid: awardRow.RecordID, } awards = append(awards, award) } diff --git a/proto/milpacs.pb.go b/proto/milpacs.pb.go index c3cb131..be31bb3 100644 --- a/proto/milpacs.pb.go +++ b/proto/milpacs.pb.go @@ -396,6 +396,50 @@ func (x *KeycloakIdRequest) GetKeycloakId() string { return "" } +type DiscordIdRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + DiscordId string `protobuf:"bytes,1,opt,name=discord_id,json=discordId,proto3" json:"discord_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DiscordIdRequest) Reset() { + *x = DiscordIdRequest{} + mi := &file_milpacs_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DiscordIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiscordIdRequest) ProtoMessage() {} + +func (x *DiscordIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_milpacs_proto_msgTypes[2] + 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 DiscordIdRequest.ProtoReflect.Descriptor instead. +func (*DiscordIdRequest) Descriptor() ([]byte, []int) { + return file_milpacs_proto_rawDescGZIP(), []int{2} +} + +func (x *DiscordIdRequest) GetDiscordId() string { + if x != nil { + return x.DiscordId + } + return "" +} + type Rank struct { state protoimpl.MessageState `protogen:"open.v1"` RankShort string `protobuf:"bytes,1,opt,name=rank_short,json=rankShort,proto3" json:"rank_short,omitempty"` @@ -408,7 +452,7 @@ type Rank struct { func (x *Rank) Reset() { *x = Rank{} - mi := &file_milpacs_proto_msgTypes[2] + mi := &file_milpacs_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -420,7 +464,7 @@ func (x *Rank) String() string { func (*Rank) ProtoMessage() {} func (x *Rank) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[2] + mi := &file_milpacs_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -433,7 +477,7 @@ func (x *Rank) ProtoReflect() protoreflect.Message { // Deprecated: Use Rank.ProtoReflect.Descriptor instead. func (*Rank) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{2} + return file_milpacs_proto_rawDescGZIP(), []int{3} } func (x *Rank) GetRankShort() string { @@ -473,7 +517,7 @@ type Thingy struct { func (x *Thingy) Reset() { *x = Thingy{} - mi := &file_milpacs_proto_msgTypes[3] + mi := &file_milpacs_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -485,7 +529,7 @@ func (x *Thingy) String() string { func (*Thingy) ProtoMessage() {} func (x *Thingy) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[3] + mi := &file_milpacs_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -498,7 +542,7 @@ func (x *Thingy) ProtoReflect() protoreflect.Message { // Deprecated: Use Thingy.ProtoReflect.Descriptor instead. func (*Thingy) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{3} + return file_milpacs_proto_rawDescGZIP(), []int{4} } func (x *Thingy) GetAck() string { @@ -529,7 +573,7 @@ type Profile struct { func (x *Profile) Reset() { *x = Profile{} - mi := &file_milpacs_proto_msgTypes[4] + mi := &file_milpacs_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -541,7 +585,7 @@ func (x *Profile) String() string { func (*Profile) ProtoMessage() {} func (x *Profile) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[4] + mi := &file_milpacs_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -554,7 +598,7 @@ func (x *Profile) ProtoReflect() protoreflect.Message { // Deprecated: Use Profile.ProtoReflect.Descriptor instead. func (*Profile) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{4} + return file_milpacs_proto_rawDescGZIP(), []int{5} } func (x *Profile) GetUser() *User { @@ -657,7 +701,7 @@ type RosterRequest struct { func (x *RosterRequest) Reset() { *x = RosterRequest{} - mi := &file_milpacs_proto_msgTypes[5] + mi := &file_milpacs_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -669,7 +713,7 @@ func (x *RosterRequest) String() string { func (*RosterRequest) ProtoMessage() {} func (x *RosterRequest) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[5] + mi := &file_milpacs_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -682,7 +726,7 @@ func (x *RosterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RosterRequest.ProtoReflect.Descriptor instead. func (*RosterRequest) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{5} + return file_milpacs_proto_rawDescGZIP(), []int{6} } func (x *RosterRequest) GetRoster() RosterType { @@ -701,7 +745,7 @@ type Roster struct { func (x *Roster) Reset() { *x = Roster{} - mi := &file_milpacs_proto_msgTypes[6] + mi := &file_milpacs_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -713,7 +757,7 @@ func (x *Roster) String() string { func (*Roster) ProtoMessage() {} func (x *Roster) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[6] + mi := &file_milpacs_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -726,7 +770,7 @@ func (x *Roster) ProtoReflect() protoreflect.Message { // Deprecated: Use Roster.ProtoReflect.Descriptor instead. func (*Roster) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{6} + return file_milpacs_proto_rawDescGZIP(), []int{7} } func (x *Roster) GetProfiles() map[uint64]*Profile { @@ -746,7 +790,7 @@ type User struct { func (x *User) Reset() { *x = User{} - mi := &file_milpacs_proto_msgTypes[7] + mi := &file_milpacs_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -758,7 +802,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[7] + mi := &file_milpacs_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -771,7 +815,7 @@ func (x *User) ProtoReflect() protoreflect.Message { // Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{7} + return file_milpacs_proto_rawDescGZIP(), []int{8} } func (x *User) GetUserId() uint64 { @@ -793,14 +837,14 @@ type Record struct { RecordDetails string `protobuf:"bytes,1,opt,name=record_details,json=recordDetails,proto3" json:"record_details,omitempty"` RecordType RecordType `protobuf:"varint,2,opt,name=record_type,json=recordType,proto3,enum=proto.RecordType" json:"record_type,omitempty"` RecordDate string `protobuf:"bytes,3,opt,name=record_date,json=recordDate,proto3" json:"record_date,omitempty"` - RecordId uint64 `protobuf:"varint,4,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` + RecordUid uint64 `protobuf:"varint,4,opt,name=record_uid,json=recordUid,proto3" json:"record_uid,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Record) Reset() { *x = Record{} - mi := &file_milpacs_proto_msgTypes[8] + mi := &file_milpacs_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -812,7 +856,7 @@ func (x *Record) String() string { func (*Record) ProtoMessage() {} func (x *Record) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[8] + mi := &file_milpacs_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -825,7 +869,7 @@ func (x *Record) ProtoReflect() protoreflect.Message { // Deprecated: Use Record.ProtoReflect.Descriptor instead. func (*Record) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{8} + return file_milpacs_proto_rawDescGZIP(), []int{9} } func (x *Record) GetRecordDetails() string { @@ -849,9 +893,9 @@ func (x *Record) GetRecordDate() string { return "" } -func (x *Record) GetRecordId() uint64 { +func (x *Record) GetRecordUid() uint64 { if x != nil { - return x.RecordId + return x.RecordUid } return 0 } @@ -862,14 +906,14 @@ type Award struct { AwardName string `protobuf:"bytes,2,opt,name=award_name,json=awardName,proto3" json:"award_name,omitempty"` AwardDate string `protobuf:"bytes,3,opt,name=award_date,json=awardDate,proto3" json:"award_date,omitempty"` AwardImageUrl string `protobuf:"bytes,4,opt,name=award_image_url,json=awardImageUrl,proto3" json:"award_image_url,omitempty"` - RecordId uint64 `protobuf:"varint,5,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` + AwardUid uint64 `protobuf:"varint,5,opt,name=award_uid,json=awardUid,proto3" json:"award_uid,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Award) Reset() { *x = Award{} - mi := &file_milpacs_proto_msgTypes[9] + mi := &file_milpacs_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -881,7 +925,7 @@ func (x *Award) String() string { func (*Award) ProtoMessage() {} func (x *Award) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[9] + mi := &file_milpacs_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -894,7 +938,7 @@ func (x *Award) ProtoReflect() protoreflect.Message { // Deprecated: Use Award.ProtoReflect.Descriptor instead. func (*Award) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{9} + return file_milpacs_proto_rawDescGZIP(), []int{10} } func (x *Award) GetAwardDetails() string { @@ -925,9 +969,9 @@ func (x *Award) GetAwardImageUrl() string { return "" } -func (x *Award) GetRecordId() uint64 { +func (x *Award) GetAwardUid() uint64 { if x != nil { - return x.RecordId + return x.AwardUid } return 0 } @@ -942,7 +986,7 @@ type Position struct { func (x *Position) Reset() { *x = Position{} - mi := &file_milpacs_proto_msgTypes[10] + mi := &file_milpacs_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -954,7 +998,7 @@ func (x *Position) String() string { func (*Position) ProtoMessage() {} func (x *Position) ProtoReflect() protoreflect.Message { - mi := &file_milpacs_proto_msgTypes[10] + mi := &file_milpacs_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -967,7 +1011,7 @@ func (x *Position) ProtoReflect() protoreflect.Message { // Deprecated: Use Position.ProtoReflect.Descriptor instead. func (*Position) Descriptor() ([]byte, []int) { - return file_milpacs_proto_rawDescGZIP(), []int{10} + return file_milpacs_proto_rawDescGZIP(), []int{11} } func (x *Position) GetPositionTitle() string { @@ -1001,214 +1045,233 @@ var file_milpacs_proto_rawDesc = []byte{ 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, - 0x64, 0x22, 0x81, 0x01, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, - 0x6e, 0x6b, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x61, 0x6e, 0x6b, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x6e, - 0x6b, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x61, - 0x6e, 0x6b, 0x46, 0x75, 0x6c, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x72, 0x61, 0x6e, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, - 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x72, - 0x61, 0x6e, 0x6b, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x06, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x63, - 0x6b, 0x22, 0xe5, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1f, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1f, - 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, - 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x72, 0x6c, 0x12, 0x29, 0x0a, - 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, + 0x64, 0x22, 0x31, 0x0a, 0x10, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x72, 0x64, 0x49, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x6b, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x46, 0x75, 0x6c, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x61, 0x6e, + 0x6b, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, + 0x17, 0x0a, 0x07, 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x72, 0x61, 0x6e, 0x6b, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x06, 0x54, 0x68, 0x69, 0x6e, + 0x67, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x61, 0x63, 0x6b, 0x22, 0xe5, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x12, 0x1f, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x12, 0x1f, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x04, 0x72, 0x61, + 0x6e, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x72, 0x6c, + 0x12, 0x29, 0x0a, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x07, 0x70, + 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x70, + 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x61, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x06, 0x61, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x0d, + 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, + 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x70, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x73, 0x65, 0x63, 0x6f, 0x6e, - 0x64, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, - 0x24, 0x0a, 0x06, 0x61, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x61, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x64, 0x61, - 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x44, 0x61, - 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x64, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6d, - 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x79, - 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x0d, 0x52, 0x6f, 0x73, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x06, 0x72, 0x6f, - 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x72, - 0x6f, 0x73, 0x74, 0x65, 0x72, 0x22, 0x8e, 0x01, 0x0a, 0x06, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x37, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x73, 0x74, 0x65, - 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x4b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3b, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x25, - 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x72, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x22, 0xaf, 0x01, 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, - 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x77, 0x61, 0x72, 0x64, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, - 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, - 0x44, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, - 0x77, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x22, 0x52, 0x0a, 0x08, 0x50, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x2a, 0xc8, 0x01, - 0x0a, 0x0a, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, - 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x4f, 0x53, - 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x42, 0x41, 0x54, 0x10, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, - 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4f, 0x41, 0x10, 0x03, - 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x57, 0x41, 0x4c, 0x4c, 0x5f, 0x4f, 0x46, 0x5f, 0x48, 0x4f, 0x4e, 0x4f, 0x52, 0x10, 0x04, 0x12, - 0x19, 0x0a, 0x15, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, - 0x52, 0x4c, 0x49, 0x4e, 0x47, 0x54, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, - 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x41, 0x53, 0x54, 0x5f, 0x4d, - 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x10, 0x06, 0x2a, 0x9d, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x45, 0x43, 0x4f, 0x52, - 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4d, 0x4f, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, - 0x19, 0x0a, 0x15, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, - 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x45, - 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, - 0x45, 0x52, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x43, 0x49, 0x50, 0x4c, 0x49, 0x4e, 0x41, 0x52, 0x59, - 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x44, 0x49, 0x53, 0x43, 0x48, 0x41, 0x52, 0x47, 0x45, 0x10, 0x05, 0x12, 0x1a, 0x0a, - 0x16, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x53, 0x53, - 0x49, 0x47, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x06, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x45, 0x43, - 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x43, 0x48, - 0x41, 0x4e, 0x47, 0x45, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4f, 0x41, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, - 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x41, 0x44, - 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x2a, 0xc9, 0x04, 0x0a, 0x08, 0x52, 0x61, 0x6e, - 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x4f, - 0x41, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x47, 0x45, 0x4e, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x54, 0x47, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x41, 0x4e, - 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x47, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x52, - 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x47, 0x10, 0x05, 0x12, 0x11, 0x0a, - 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4c, 0x10, 0x06, - 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x54, - 0x43, 0x10, 0x07, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4d, 0x41, 0x4a, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x43, 0x50, 0x54, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, - 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x31, 0x4c, 0x54, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, - 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x32, 0x4c, 0x54, 0x10, 0x0b, 0x12, - 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x53, 0x4d, - 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x53, 0x47, 0x4d, 0x10, 0x0d, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x31, 0x53, 0x47, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x53, 0x47, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x52, - 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x43, 0x10, 0x10, 0x12, 0x11, - 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x53, 0x47, 0x10, - 0x11, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, - 0x47, 0x54, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x43, 0x50, 0x4c, 0x10, 0x13, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x50, 0x43, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, - 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x46, 0x43, 0x10, 0x15, 0x12, 0x11, 0x0a, - 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x56, 0x54, 0x10, 0x16, - 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x43, - 0x54, 0x10, 0x17, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x43, 0x57, 0x35, 0x10, 0x1a, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x34, 0x10, 0x1b, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, - 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x33, 0x10, 0x1c, 0x12, 0x11, 0x0a, 0x0d, - 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x10, 0x1d, 0x12, - 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x4f, 0x31, - 0x10, 0x1e, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x41, 0x52, 0x10, 0x1f, 0x32, 0xb3, 0x05, 0x0a, 0x0d, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xf9, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xc3, 0x01, 0x92, - 0x41, 0x65, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, - 0x63, 0x73, 0x2c, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x47, 0x65, 0x74, - 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x6d, 0x69, 0x6c, 0x70, - 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0x2b, 0x47, 0x65, 0x74, 0x20, - 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, - 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x55, 0x5a, 0x2d, 0x12, - 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x24, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, 0x2f, 0x70, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x69, 0x64, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, - 0x6f, 0x73, 0x74, 0x65, 0x72, 0x22, 0x77, 0x92, 0x41, 0x55, 0x0a, 0x0f, 0x52, 0x6f, 0x73, 0x74, - 0x65, 0x72, 0x2c, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, 0x12, 0x12, 0x47, 0x65, 0x74, - 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x1a, - 0x2e, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, - 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x72, - 0x6f, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x7b, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x7d, 0x12, 0xf9, - 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x56, 0x69, 0x61, 0x4b, 0x65, 0x79, - 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x4b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x52, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x22, 0x8e, 0x01, 0x0a, 0x06, 0x52, 0x6f, 0x73, + 0x74, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, + 0x73, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x4b, 0x0a, 0x0d, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3b, 0x0a, 0x04, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x0a, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x55, 0x69, 0x64, 0x22, 0xaf, 0x01, 0x0a, + 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, + 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x77, 0x61, 0x72, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x61, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x77, 0x61, 0x72, 0x64, 0x55, 0x69, 0x64, 0x22, 0x52, + 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x2a, 0xc8, 0x01, 0x0a, 0x0a, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, + 0x0a, 0x12, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, + 0x4d, 0x42, 0x41, 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x10, 0x02, 0x12, + 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, + 0x4c, 0x4f, 0x41, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x5f, 0x4f, 0x46, 0x5f, 0x48, 0x4f, 0x4e, + 0x4f, 0x52, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x41, 0x52, 0x4c, 0x49, 0x4e, 0x47, 0x54, 0x4f, 0x4e, 0x10, 0x05, 0x12, + 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, + 0x41, 0x53, 0x54, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x10, 0x06, 0x2a, 0x9d, 0x02, + 0x0a, 0x0a, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, + 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x43, + 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4d, 0x4f, 0x54, 0x49, + 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, + 0x18, 0x0a, 0x14, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, + 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x45, 0x43, + 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x43, 0x49, 0x50, 0x4c, + 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x43, 0x4f, 0x52, + 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x43, 0x48, 0x41, 0x52, 0x47, 0x45, + 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x41, 0x53, 0x53, 0x49, 0x47, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x06, 0x12, 0x1b, + 0x0a, 0x17, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, + 0x4d, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, 0x52, + 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4f, 0x41, 0x10, + 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x47, 0x52, 0x41, 0x44, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x2a, 0xc9, 0x04, + 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x41, + 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x47, 0x4f, 0x41, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x52, + 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x54, 0x47, 0x10, 0x03, 0x12, 0x10, + 0x0a, 0x0c, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x47, 0x10, 0x04, + 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x47, + 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x43, 0x4f, 0x4c, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4c, 0x54, 0x43, 0x10, 0x07, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4a, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x52, + 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x50, 0x54, 0x10, 0x09, 0x12, 0x11, + 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x31, 0x4c, 0x54, 0x10, + 0x0a, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x32, + 0x4c, 0x54, 0x10, 0x0b, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x43, 0x53, 0x4d, 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x47, 0x4d, 0x10, 0x0d, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, + 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x31, 0x53, 0x47, 0x10, 0x0e, 0x12, 0x11, 0x0a, + 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x53, 0x47, 0x10, 0x0f, + 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, + 0x43, 0x10, 0x10, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x53, 0x53, 0x47, 0x10, 0x11, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x53, 0x47, 0x54, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, + 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x50, 0x4c, 0x10, 0x13, 0x12, 0x11, 0x0a, 0x0d, + 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x50, 0x43, 0x10, 0x14, 0x12, + 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x46, 0x43, + 0x10, 0x15, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x50, 0x56, 0x54, 0x10, 0x16, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x52, 0x43, 0x54, 0x10, 0x17, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x35, 0x10, 0x1a, 0x12, 0x11, 0x0a, 0x0d, 0x52, + 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x34, 0x10, 0x1b, 0x12, 0x11, + 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x33, 0x10, + 0x1c, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, + 0x57, 0x32, 0x10, 0x1d, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x57, 0x4f, 0x31, 0x10, 0x1e, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x41, 0x4e, 0x4b, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x52, 0x10, 0x1f, 0x32, 0xa8, 0x07, 0x0a, 0x0d, 0x4d, 0x69, + 0x6c, 0x70, 0x61, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xf9, 0x01, 0x0a, 0x0a, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x22, 0xb6, 0x01, 0x92, 0x41, 0x85, 0x01, 0x0a, 0x19, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, - 0x2c, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, 0x2c, 0x20, 0x4b, 0x65, 0x79, 0x63, 0x6c, - 0x6f, 0x61, 0x6b, 0x12, 0x24, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, - 0x63, 0x20, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x76, 0x69, 0x61, 0x20, 0x6b, 0x65, - 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x20, 0x49, 0x44, 0x1a, 0x42, 0x47, 0x65, 0x74, 0x20, 0x61, - 0x6c, 0x6c, 0x20, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, - 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x76, 0x69, 0x61, 0x20, 0x74, 0x68, 0x65, 0x69, - 0x72, 0x20, 0x4b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x20, 0x49, 0x44, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6c, - 0x70, 0x61, 0x63, 0x2f, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x2f, 0x7b, 0x6b, 0x65, - 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xc6, 0x01, 0x92, 0x41, 0xa7, - 0x01, 0x12, 0x05, 0x32, 0x03, 0x31, 0x2e, 0x31, 0x2a, 0x01, 0x02, 0x5a, 0x59, 0x0a, 0x57, 0x0a, - 0x06, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x4d, 0x08, 0x02, 0x12, 0x38, 0x41, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x42, - 0x65, 0x61, 0x72, 0x65, 0x72, 0x3a, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x20, 0x3c, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x3e, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x62, 0x0c, 0x0a, 0x0a, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x12, 0x00, 0x72, 0x32, 0x0a, 0x13, 0x37, 0x43, 0x61, 0x76, 0x20, 0x41, 0x50, 0x49, - 0x20, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1b, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x37, 0x63, 0x61, 0x76, 0x2f, 0x61, 0x70, 0x69, 0x5a, 0x19, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x37, 0x63, 0x61, 0x76, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0xc3, 0x01, 0x92, 0x41, 0x65, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x73, 0x2c, 0x20, + 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, 0x2c, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x12, 0x1d, 0x47, 0x65, 0x74, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, + 0x20, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x1a, + 0x2b, 0x47, 0x65, 0x74, 0x20, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x55, 0x5a, 0x2d, 0x12, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, + 0x6c, 0x70, 0x61, 0x63, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6c, 0x70, 0x61, + 0x63, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2f, 0x69, 0x64, 0x2f, 0x7b, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, + 0x6f, 0x73, 0x74, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, + 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x22, 0x77, 0x92, 0x41, 0x55, 0x0a, + 0x0f, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, + 0x12, 0x12, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x72, 0x6f, + 0x73, 0x74, 0x65, 0x72, 0x1a, 0x2e, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x69, + 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x61, 0x74, + 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x72, 0x6f, + 0x73, 0x74, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x7b, 0x72, 0x6f, 0x73, 0x74, + 0x65, 0x72, 0x7d, 0x12, 0xf9, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x56, + 0x69, 0x61, 0x4b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x49, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xb6, 0x01, 0x92, 0x41, 0x85, 0x01, 0x0a, 0x19, 0x52, + 0x6f, 0x73, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, 0x2c, 0x20, + 0x4b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x12, 0x24, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, + 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x76, + 0x69, 0x61, 0x20, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x20, 0x49, 0x44, 0x1a, 0x42, + 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x76, 0x69, 0x61, + 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x4b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x20, + 0x49, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x2f, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, + 0x6b, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x63, 0x6c, 0x6f, 0x61, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x12, + 0xf2, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x56, 0x69, 0x61, 0x44, 0x69, + 0x73, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x22, 0xb1, 0x01, 0x92, 0x41, 0x82, 0x01, 0x0a, 0x18, 0x52, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x2c, + 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x73, 0x2c, 0x20, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x23, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x4d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x76, 0x69, 0x61, 0x20, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x72, 0x64, 0x20, 0x49, 0x44, 0x1a, 0x41, 0x47, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, + 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, + 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, + 0x75, 0x73, 0x65, 0x72, 0x20, 0x76, 0x69, 0x61, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x44, + 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x20, 0x49, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, + 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6c, 0x70, 0x61, 0x63, 0x2f, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xc6, 0x01, 0x92, 0x41, 0xa7, 0x01, 0x12, 0x05, 0x32, 0x03, 0x31, + 0x2e, 0x31, 0x2a, 0x01, 0x02, 0x5a, 0x59, 0x0a, 0x57, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x12, 0x4d, 0x08, 0x02, 0x12, 0x38, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2c, 0x20, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x3a, + 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x20, 0x3c, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3e, 0x1a, + 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, + 0x62, 0x0c, 0x0a, 0x0a, 0x0a, 0x06, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x72, 0x32, + 0x0a, 0x13, 0x37, 0x43, 0x61, 0x76, 0x20, 0x41, 0x50, 0x49, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x37, 0x63, 0x61, 0x76, 0x2f, 0x61, + 0x70, 0x69, 0x5a, 0x19, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x37, + 0x63, 0x61, 0x76, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1224,44 +1287,47 @@ func file_milpacs_proto_rawDescGZIP() []byte { } var file_milpacs_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_milpacs_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_milpacs_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_milpacs_proto_goTypes = []any{ (RosterType)(0), // 0: proto.RosterType (RecordType)(0), // 1: proto.RecordType (RankType)(0), // 2: proto.RankType (*ProfileRequest)(nil), // 3: proto.ProfileRequest (*KeycloakIdRequest)(nil), // 4: proto.KeycloakIdRequest - (*Rank)(nil), // 5: proto.Rank - (*Thingy)(nil), // 6: proto.Thingy - (*Profile)(nil), // 7: proto.Profile - (*RosterRequest)(nil), // 8: proto.RosterRequest - (*Roster)(nil), // 9: proto.Roster - (*User)(nil), // 10: proto.User - (*Record)(nil), // 11: proto.Record - (*Award)(nil), // 12: proto.Award - (*Position)(nil), // 13: proto.Position - nil, // 14: proto.Roster.ProfilesEntry + (*DiscordIdRequest)(nil), // 5: proto.DiscordIdRequest + (*Rank)(nil), // 6: proto.Rank + (*Thingy)(nil), // 7: proto.Thingy + (*Profile)(nil), // 8: proto.Profile + (*RosterRequest)(nil), // 9: proto.RosterRequest + (*Roster)(nil), // 10: proto.Roster + (*User)(nil), // 11: proto.User + (*Record)(nil), // 12: proto.Record + (*Award)(nil), // 13: proto.Award + (*Position)(nil), // 14: proto.Position + nil, // 15: proto.Roster.ProfilesEntry } var file_milpacs_proto_depIdxs = []int32{ - 10, // 0: proto.Profile.user:type_name -> proto.User - 5, // 1: proto.Profile.rank:type_name -> proto.Rank + 11, // 0: proto.Profile.user:type_name -> proto.User + 6, // 1: proto.Profile.rank:type_name -> proto.Rank 0, // 2: proto.Profile.roster:type_name -> proto.RosterType - 13, // 3: proto.Profile.primary:type_name -> proto.Position - 13, // 4: proto.Profile.secondaries:type_name -> proto.Position - 11, // 5: proto.Profile.records:type_name -> proto.Record - 12, // 6: proto.Profile.awards:type_name -> proto.Award + 14, // 3: proto.Profile.primary:type_name -> proto.Position + 14, // 4: proto.Profile.secondaries:type_name -> proto.Position + 12, // 5: proto.Profile.records:type_name -> proto.Record + 13, // 6: proto.Profile.awards:type_name -> proto.Award 0, // 7: proto.RosterRequest.roster:type_name -> proto.RosterType - 14, // 8: proto.Roster.profiles:type_name -> proto.Roster.ProfilesEntry + 15, // 8: proto.Roster.profiles:type_name -> proto.Roster.ProfilesEntry 1, // 9: proto.Record.record_type:type_name -> proto.RecordType - 7, // 10: proto.Roster.ProfilesEntry.value:type_name -> proto.Profile + 8, // 10: proto.Roster.ProfilesEntry.value:type_name -> proto.Profile 3, // 11: proto.MilpacService.GetProfile:input_type -> proto.ProfileRequest - 8, // 12: proto.MilpacService.GetRoster:input_type -> proto.RosterRequest + 9, // 12: proto.MilpacService.GetRoster:input_type -> proto.RosterRequest 4, // 13: proto.MilpacService.GetUserViaKeycloakId:input_type -> proto.KeycloakIdRequest - 7, // 14: proto.MilpacService.GetProfile:output_type -> proto.Profile - 9, // 15: proto.MilpacService.GetRoster:output_type -> proto.Roster - 7, // 16: proto.MilpacService.GetUserViaKeycloakId:output_type -> proto.Profile - 14, // [14:17] is the sub-list for method output_type - 11, // [11:14] is the sub-list for method input_type + 5, // 14: proto.MilpacService.GetUserViaDiscordId:input_type -> proto.DiscordIdRequest + 8, // 15: proto.MilpacService.GetProfile:output_type -> proto.Profile + 10, // 16: proto.MilpacService.GetRoster:output_type -> proto.Roster + 8, // 17: proto.MilpacService.GetUserViaKeycloakId:output_type -> proto.Profile + 8, // 18: proto.MilpacService.GetUserViaDiscordId:output_type -> proto.Profile + 15, // [15:19] is the sub-list for method output_type + 11, // [11:15] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension extendee 0, // [0:11] is the sub-list for field type_name @@ -1278,7 +1344,7 @@ func file_milpacs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_milpacs_proto_rawDesc, NumEnums: 3, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/milpacs.pb.gw.go b/proto/milpacs.pb.gw.go index 0b27e7e..45fcffd 100644 --- a/proto/milpacs.pb.gw.go +++ b/proto/milpacs.pb.gw.go @@ -211,6 +211,42 @@ func local_request_MilpacService_GetUserViaKeycloakId_0(ctx context.Context, mar return msg, metadata, err } +func request_MilpacService_GetUserViaDiscordId_0(ctx context.Context, marshaler runtime.Marshaler, client MilpacServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DiscordIdRequest + metadata runtime.ServerMetadata + err error + ) + val, ok := pathParams["discord_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "discord_id") + } + protoReq.DiscordId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "discord_id", err) + } + msg, err := client.GetUserViaDiscordId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_MilpacService_GetUserViaDiscordId_0(ctx context.Context, marshaler runtime.Marshaler, server MilpacServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq DiscordIdRequest + metadata runtime.ServerMetadata + err error + ) + val, ok := pathParams["discord_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "discord_id") + } + protoReq.DiscordId, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "discord_id", err) + } + msg, err := server.GetUserViaDiscordId(ctx, &protoReq) + return msg, metadata, err +} + // RegisterMilpacServiceHandlerServer registers the http handlers for service MilpacService to "mux". // UnaryRPC :call MilpacServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -297,6 +333,26 @@ func RegisterMilpacServiceHandlerServer(ctx context.Context, mux *runtime.ServeM } forward_MilpacService_GetUserViaKeycloakId_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodGet, pattern_MilpacService_GetUserViaDiscordId_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, "/proto.MilpacService/GetUserViaDiscordId", runtime.WithHTTPPathPattern("/api/v1/milpac/discord/{discord_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MilpacService_GetUserViaDiscordId_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_MilpacService_GetUserViaDiscordId_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -405,6 +461,23 @@ func RegisterMilpacServiceHandlerClient(ctx context.Context, mux *runtime.ServeM } forward_MilpacService_GetUserViaKeycloakId_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle(http.MethodGet, pattern_MilpacService_GetUserViaDiscordId_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, "/proto.MilpacService/GetUserViaDiscordId", runtime.WithHTTPPathPattern("/api/v1/milpac/discord/{discord_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MilpacService_GetUserViaDiscordId_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + forward_MilpacService_GetUserViaDiscordId_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } @@ -413,6 +486,7 @@ var ( pattern_MilpacService_GetProfile_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"api", "v1", "milpacs", "profile", "username"}, "")) pattern_MilpacService_GetRoster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2}, []string{"api", "v1", "roster"}, "")) pattern_MilpacService_GetUserViaKeycloakId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"api", "v1", "milpac", "keycloak", "keycloak_id"}, "")) + pattern_MilpacService_GetUserViaDiscordId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"api", "v1", "milpac", "discord", "discord_id"}, "")) ) var ( @@ -420,4 +494,5 @@ var ( forward_MilpacService_GetProfile_1 = runtime.ForwardResponseMessage forward_MilpacService_GetRoster_0 = runtime.ForwardResponseMessage forward_MilpacService_GetUserViaKeycloakId_0 = runtime.ForwardResponseMessage + forward_MilpacService_GetUserViaDiscordId_0 = runtime.ForwardResponseMessage ) diff --git a/proto/milpacs.proto b/proto/milpacs.proto index 96dadc2..49efb4b 100644 --- a/proto/milpacs.proto +++ b/proto/milpacs.proto @@ -89,6 +89,16 @@ service MilpacService { tags: "Roster, Milpacs, Keycloak" }; }; + rpc GetUserViaDiscordId(DiscordIdRequest) returns (Profile){ + option(google.api.http) = { + get: "/api/v1/milpac/discord/{discord_id}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Get a Milpac profile via Discord ID" + description: "Get all milpac Profile data for a given user via their Discord ID" + tags: "Roster, Milpacs, Discord" + }; + }; } enum RosterType { @@ -156,6 +166,10 @@ message KeycloakIdRequest { string keycloak_id = 1; } +message DiscordIdRequest { + string discord_id = 1; +} + message Rank { string rank_short = 1; string rank_full = 2; @@ -200,7 +214,7 @@ message Record { string record_details = 1; RecordType record_type = 2; string record_date = 3; - uint64 record_id = 4; + uint64 record_uid = 4; } message Award { @@ -208,7 +222,7 @@ message Award { string award_name = 2; string award_date = 3; string award_image_url = 4; - uint64 record_id = 5; + uint64 award_uid = 5; } message Position { diff --git a/proto/milpacs_grpc.pb.go b/proto/milpacs_grpc.pb.go index 93de661..8ec9359 100644 --- a/proto/milpacs_grpc.pb.go +++ b/proto/milpacs_grpc.pb.go @@ -39,6 +39,7 @@ const ( MilpacService_GetProfile_FullMethodName = "/proto.MilpacService/GetProfile" MilpacService_GetRoster_FullMethodName = "/proto.MilpacService/GetRoster" MilpacService_GetUserViaKeycloakId_FullMethodName = "/proto.MilpacService/GetUserViaKeycloakId" + MilpacService_GetUserViaDiscordId_FullMethodName = "/proto.MilpacService/GetUserViaDiscordId" ) // MilpacServiceClient is the client API for MilpacService service. @@ -48,6 +49,7 @@ type MilpacServiceClient interface { GetProfile(ctx context.Context, in *ProfileRequest, opts ...grpc.CallOption) (*Profile, error) GetRoster(ctx context.Context, in *RosterRequest, opts ...grpc.CallOption) (*Roster, error) GetUserViaKeycloakId(ctx context.Context, in *KeycloakIdRequest, opts ...grpc.CallOption) (*Profile, error) + GetUserViaDiscordId(ctx context.Context, in *DiscordIdRequest, opts ...grpc.CallOption) (*Profile, error) } type milpacServiceClient struct { @@ -88,6 +90,16 @@ func (c *milpacServiceClient) GetUserViaKeycloakId(ctx context.Context, in *Keyc return out, nil } +func (c *milpacServiceClient) GetUserViaDiscordId(ctx context.Context, in *DiscordIdRequest, opts ...grpc.CallOption) (*Profile, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Profile) + err := c.cc.Invoke(ctx, MilpacService_GetUserViaDiscordId_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // MilpacServiceServer is the server API for MilpacService service. // All implementations should embed UnimplementedMilpacServiceServer // for forward compatibility. @@ -95,6 +107,7 @@ type MilpacServiceServer interface { GetProfile(context.Context, *ProfileRequest) (*Profile, error) GetRoster(context.Context, *RosterRequest) (*Roster, error) GetUserViaKeycloakId(context.Context, *KeycloakIdRequest) (*Profile, error) + GetUserViaDiscordId(context.Context, *DiscordIdRequest) (*Profile, error) } // UnimplementedMilpacServiceServer should be embedded to have @@ -113,6 +126,9 @@ func (UnimplementedMilpacServiceServer) GetRoster(context.Context, *RosterReques func (UnimplementedMilpacServiceServer) GetUserViaKeycloakId(context.Context, *KeycloakIdRequest) (*Profile, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserViaKeycloakId not implemented") } +func (UnimplementedMilpacServiceServer) GetUserViaDiscordId(context.Context, *DiscordIdRequest) (*Profile, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserViaDiscordId not implemented") +} func (UnimplementedMilpacServiceServer) testEmbeddedByValue() {} // UnsafeMilpacServiceServer may be embedded to opt out of forward compatibility for this service. @@ -187,6 +203,24 @@ func _MilpacService_GetUserViaKeycloakId_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _MilpacService_GetUserViaDiscordId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DiscordIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MilpacServiceServer).GetUserViaDiscordId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MilpacService_GetUserViaDiscordId_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MilpacServiceServer).GetUserViaDiscordId(ctx, req.(*DiscordIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + // MilpacService_ServiceDesc is the grpc.ServiceDesc for MilpacService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -206,6 +240,10 @@ var MilpacService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetUserViaKeycloakId", Handler: _MilpacService_GetUserViaKeycloakId_Handler, }, + { + MethodName: "GetUserViaDiscordId", + Handler: _MilpacService_GetUserViaDiscordId_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "milpacs.proto", diff --git a/servers/grpc/grpc.go b/servers/grpc/grpc.go index f19953f..132f778 100644 --- a/servers/grpc/grpc.go +++ b/servers/grpc/grpc.go @@ -80,7 +80,7 @@ func (server *MilpacsService) GetRoster(ctx context.Context, request *proto.Rost func (server *MilpacsService) GetUserViaKeycloakId(ctx context.Context, request *proto.KeycloakIdRequest) (*proto.Profile, error) { if request.GetKeycloakId() == "" { - Warn.Println("Empty discord ID provided, cannot return profile") + Warn.Println("Empty Keycloak ID provided, cannot return profile") } profile, err := server.Datastore.FindProfileByKeycloakID(request.GetKeycloakId()) @@ -91,3 +91,18 @@ func (server *MilpacsService) GetUserViaKeycloakId(ctx context.Context, request return profile, nil } + +func (server *MilpacsService) GetUserViaDiscordId(ctx context.Context, request *proto.DiscordIdRequest) (*proto.Profile, error) { + + if request.GetDiscordId() == "" { + Warn.Println("Empty Discord ID provided, cannot return profile") + } + + profile, err := server.Datastore.FindProfileByDiscordID(request.GetDiscordId()) + + if err != nil { + return &proto.Profile{}, status.Errorf(codes.NotFound, "no user found for %", request.GetDiscordId()) + } + + return profile, nil +} diff --git a/third_party/OpenAPI/milpacs.swagger.json b/third_party/OpenAPI/milpacs.swagger.json index ed83e5a..581fc38 100644 --- a/third_party/OpenAPI/milpacs.swagger.json +++ b/third_party/OpenAPI/milpacs.swagger.json @@ -19,6 +19,38 @@ "application/json" ], "paths": { + "/api/v1/milpac/discord/{discordId}": { + "get": { + "summary": "Get a Milpac profile via Discord ID", + "description": "Get all milpac Profile data for a given user via their Discord ID", + "operationId": "MilpacService_GetUserViaDiscordId", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/protoProfile" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "discordId", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Roster, Milpacs, Discord" + ] + } + }, "/api/v1/milpac/keycloak/{keycloakId}": { "get": { "summary": "Get a Milpac profile via keycloak ID", @@ -187,7 +219,7 @@ "awardImageUrl": { "type": "string" }, - "recordId": { + "awardUid": { "type": "string", "format": "uint64" } @@ -291,7 +323,7 @@ "recordDate": { "type": "string" }, - "recordId": { + "recordUid": { "type": "string", "format": "uint64" }