From f478b2cb63ece5d5a7ad791c0e5696850b0d1f12 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Thu, 12 Dec 2024 16:32:30 +0900 Subject: [PATCH] fix oneof type name in nested message (#251) --- .../10_oneof/federation/federation.pb.go | 438 ++++++++++++------ .../federation_grpc_federation.pb.go | 224 +++++++-- _examples/10_oneof/main_test.go | 5 + .../proto/federation/federation.proto | 17 + generator/code_generator.go | 2 +- 5 files changed, 514 insertions(+), 172 deletions(-) diff --git a/_examples/10_oneof/federation/federation.pb.go b/_examples/10_oneof/federation/federation.pb.go index db6e4f61..6e259f93 100644 --- a/_examples/10_oneof/federation/federation.pb.go +++ b/_examples/10_oneof/federation/federation.pb.go @@ -64,8 +64,9 @@ type GetResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + NestedMsg *NestedMessageSelection_Nest `protobuf:"bytes,3,opt,name=nested_msg,json=nestedMsg,proto3" json:"nested_msg,omitempty"` } func (x *GetResponse) Reset() { @@ -114,6 +115,13 @@ func (x *GetResponse) GetMsg() string { return "" } +func (x *GetResponse) GetNestedMsg() *NestedMessageSelection_Nest { + if x != nil { + return x.NestedMsg + } + return nil +} + type GetNoValueRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -470,6 +478,44 @@ func (*NoValueSelection_MA) isNoValueSelection_NoValue() {} func (*NoValueSelection_MB) isNoValueSelection_NoValue() {} +type NestedMessageSelection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NestedMessageSelection) Reset() { + *x = NestedMessageSelection{} + if protoimpl.UnsafeEnabled { + mi := &file_federation_federation_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NestedMessageSelection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NestedMessageSelection) ProtoMessage() {} + +func (x *NestedMessageSelection) ProtoReflect() protoreflect.Message { + mi := &file_federation_federation_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NestedMessageSelection.ProtoReflect.Descriptor instead. +func (*NestedMessageSelection) Descriptor() ([]byte, []int) { + return file_federation_federation_proto_rawDescGZIP(), []int{7} +} + type M struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -481,7 +527,7 @@ type M struct { func (x *M) Reset() { *x = M{} if protoimpl.UnsafeEnabled { - mi := &file_federation_federation_proto_msgTypes[7] + mi := &file_federation_federation_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -494,7 +540,7 @@ func (x *M) String() string { func (*M) ProtoMessage() {} func (x *M) ProtoReflect() protoreflect.Message { - mi := &file_federation_federation_proto_msgTypes[7] + mi := &file_federation_federation_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -507,7 +553,7 @@ func (x *M) ProtoReflect() protoreflect.Message { // Deprecated: Use M.ProtoReflect.Descriptor instead. func (*M) Descriptor() ([]byte, []int) { - return file_federation_federation_proto_rawDescGZIP(), []int{7} + return file_federation_federation_proto_rawDescGZIP(), []int{8} } func (x *M) GetValue() string { @@ -528,7 +574,7 @@ type User struct { func (x *User) Reset() { *x = User{} if protoimpl.UnsafeEnabled { - mi := &file_federation_federation_proto_msgTypes[8] + mi := &file_federation_federation_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -541,7 +587,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_federation_federation_proto_msgTypes[8] + mi := &file_federation_federation_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -554,7 +600,7 @@ func (x *User) ProtoReflect() protoreflect.Message { // Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return file_federation_federation_proto_rawDescGZIP(), []int{8} + return file_federation_federation_proto_rawDescGZIP(), []int{9} } func (x *User) GetId() string { @@ -564,6 +610,87 @@ func (x *User) GetId() string { return "" } +type NestedMessageSelection_Nest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // + // *NestedMessageSelection_Nest_Int + // *NestedMessageSelection_Nest_Text + Value isNestedMessageSelection_Nest_Value `protobuf_oneof:"value"` +} + +func (x *NestedMessageSelection_Nest) Reset() { + *x = NestedMessageSelection_Nest{} + if protoimpl.UnsafeEnabled { + mi := &file_federation_federation_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NestedMessageSelection_Nest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NestedMessageSelection_Nest) ProtoMessage() {} + +func (x *NestedMessageSelection_Nest) ProtoReflect() protoreflect.Message { + mi := &file_federation_federation_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NestedMessageSelection_Nest.ProtoReflect.Descriptor instead. +func (*NestedMessageSelection_Nest) Descriptor() ([]byte, []int) { + return file_federation_federation_proto_rawDescGZIP(), []int{7, 0} +} + +func (m *NestedMessageSelection_Nest) GetValue() isNestedMessageSelection_Nest_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *NestedMessageSelection_Nest) GetInt() int64 { + if x, ok := x.GetValue().(*NestedMessageSelection_Nest_Int); ok { + return x.Int + } + return 0 +} + +func (x *NestedMessageSelection_Nest) GetText() string { + if x, ok := x.GetValue().(*NestedMessageSelection_Nest_Text); ok { + return x.Text + } + return "" +} + +type isNestedMessageSelection_Nest_Value interface { + isNestedMessageSelection_Nest_Value() +} + +type NestedMessageSelection_Nest_Int struct { + Int int64 `protobuf:"varint,1,opt,name=int,proto3,oneof"` +} + +type NestedMessageSelection_Nest_Text struct { + Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"` +} + +func (*NestedMessageSelection_Nest_Int) isNestedMessageSelection_Nest_Value() {} + +func (*NestedMessageSelection_Nest_Text) isNestedMessageSelection_Nest_Value() {} + var File_federation_federation_proto protoreflect.FileDescriptor var file_federation_federation_proto_rawDesc = []byte{ @@ -572,108 +699,124 @@ var file_federation_federation_proto_rawDesc = []byte{ 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x0c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xba, 0x01, + 0x0c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc4, 0x02, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x0d, 0x9a, 0x4a, 0x0a, 0x12, 0x08, 0x73, 0x65, 0x6c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0x9a, 0x4a, 0x11, 0x12, 0x0f, 0x6d, 0x73, 0x67, 0x5f, 0x73, 0x65, - 0x6c, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x3a, 0x4a, - 0x9a, 0x4a, 0x47, 0x0a, 0x26, 0x0a, 0x03, 0x73, 0x65, 0x6c, 0x6a, 0x1f, 0x0a, 0x0d, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x05, 0x27, 0x66, 0x6f, 0x6f, 0x27, 0x0a, 0x1d, 0x0a, 0x07, 0x6d, - 0x73, 0x67, 0x5f, 0x73, 0x65, 0x6c, 0x6a, 0x12, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x87, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, - 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x42, 0x1a, 0x9a, 0x4a, 0x17, - 0x12, 0x15, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x2e, 0x6e, - 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x6e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x27, 0x9a, 0x4a, 0x24, 0x0a, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x6a, 0x12, 0x0a, 0x10, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x03, 0x0a, 0x0d, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, - 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x42, 0x48, 0x9a, 0x4a, 0x45, 0x22, 0x43, 0x1a, 0x36, 0x0a, 0x02, 0x75, 0x61, 0x6a, 0x30, - 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x12, 0x03, 0x27, 0x61, 0x27, 0x12, 0x08, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x01, 0x30, - 0x12, 0x0e, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x12, 0x07, 0x27, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x27, - 0x22, 0x02, 0x75, 0x61, 0x0a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x75, - 0x73, 0x65, 0x72, 0x41, 0x12, 0x76, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x62, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x47, 0x9a, 0x4a, 0x44, 0x22, - 0x42, 0x1a, 0x36, 0x0a, 0x02, 0x75, 0x62, 0x6a, 0x30, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x0e, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x03, 0x27, 0x62, 0x27, 0x12, - 0x08, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x01, 0x30, 0x12, 0x0e, 0x0a, 0x03, 0x62, 0x61, 0x72, - 0x12, 0x07, 0x27, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x27, 0x22, 0x02, 0x75, 0x62, 0x0a, 0x04, 0x74, - 0x72, 0x75, 0x65, 0x48, 0x00, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x42, 0x12, 0x76, 0x0a, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x42, 0x47, 0x9a, 0x4a, 0x44, 0x22, 0x42, 0x1a, 0x3a, 0x0a, 0x02, 0x75, 0x63, 0x6a, - 0x34, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x12, 0x07, 0x24, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x08, 0x0a, 0x03, 0x66, - 0x6f, 0x6f, 0x12, 0x01, 0x30, 0x12, 0x0e, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x12, 0x07, 0x27, 0x68, - 0x65, 0x6c, 0x6c, 0x6f, 0x27, 0x22, 0x02, 0x75, 0x63, 0x10, 0x01, 0x48, 0x00, 0x52, 0x05, 0x75, - 0x73, 0x65, 0x72, 0x43, 0x42, 0x06, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x9b, 0x01, 0x0a, - 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2a, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x13, 0x9a, 0x4a, 0x10, 0x22, 0x0e, 0x22, 0x05, 0x27, 0x61, 0x61, 0x61, 0x27, 0x0a, 0x05, - 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x41, 0x12, 0x29, 0x0a, - 0x05, 0x6d, 0x73, 0x67, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0x9a, 0x4a, - 0x0f, 0x22, 0x0d, 0x22, 0x05, 0x27, 0x62, 0x62, 0x62, 0x27, 0x0a, 0x04, 0x74, 0x72, 0x75, 0x65, - 0x48, 0x00, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x42, 0x12, 0x25, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x5f, - 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0x9a, 0x4a, 0x0b, 0x22, 0x09, 0x22, 0x05, - 0x27, 0x63, 0x63, 0x63, 0x27, 0x10, 0x01, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x43, 0x42, - 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x10, 0x4e, - 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x03, 0x6d, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x42, - 0x1b, 0x9a, 0x4a, 0x18, 0x22, 0x16, 0x22, 0x0d, 0x4d, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x20, 0x27, 0x61, 0x27, 0x7d, 0x0a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x02, - 0x6d, 0x41, 0x12, 0x41, 0x0a, 0x03, 0x6d, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x4d, 0x42, 0x1b, 0x9a, 0x4a, 0x18, 0x22, 0x16, 0x22, 0x0d, 0x4d, 0x7b, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x20, 0x27, 0x62, 0x27, 0x7d, 0x0a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, - 0x00, 0x52, 0x02, 0x6d, 0x42, 0x42, 0x0a, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x25, 0x0a, 0x01, 0x4d, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0x9a, 0x4a, 0x07, 0x12, 0x05, 0x27, 0x66, 0x6f, 0x6f, - 0x27, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0x9a, - 0x4a, 0x0b, 0x12, 0x09, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x52, 0x02, 0x69, - 0x64, 0x3a, 0x67, 0x9a, 0x4a, 0x64, 0x0a, 0x62, 0x72, 0x60, 0x0a, 0x18, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x09, 0x24, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x05, 0x24, 0x2e, - 0x66, 0x6f, 0x6f, 0x1a, 0x0a, 0x24, 0x2e, 0x66, 0x6f, 0x6f, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x12, - 0x19, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x12, 0x05, 0x24, 0x2e, 0x62, 0x61, 0x72, 0x1a, 0x0b, 0x24, - 0x2e, 0x62, 0x61, 0x72, 0x20, 0x21, 0x3d, 0x20, 0x27, 0x27, 0x32, 0xb1, 0x01, 0x0a, 0x11, 0x46, - 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x40, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, - 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x21, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x1a, 0x03, 0x9a, 0x4a, 0x00, 0x42, 0xb1, - 0x01, 0x9a, 0x4a, 0x11, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, - 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x46, 0x65, 0x64, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x3b, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x4f, 0x46, - 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x72, 0x67, 0x2e, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0xca, 0x02, 0x0e, 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1a, 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0f, 0x4f, 0x72, 0x67, 0x3a, 0x3a, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x5b, + 0x0a, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x42, + 0x0f, 0x9a, 0x4a, 0x0c, 0x12, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, + 0x52, 0x09, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x3a, 0x77, 0x9a, 0x4a, 0x74, + 0x0a, 0x26, 0x0a, 0x03, 0x73, 0x65, 0x6c, 0x6a, 0x1f, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x05, 0x27, 0x66, 0x6f, 0x6f, 0x27, 0x0a, 0x1d, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, + 0x73, 0x65, 0x6c, 0x6a, 0x12, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x2b, 0x0a, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x6a, 0x1d, 0x0a, 0x1b, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x4e, 0x65, 0x73, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x87, 0x01, 0x0a, 0x12, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x48, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x42, 0x1a, 0x9a, 0x4a, 0x17, 0x12, 0x15, 0x6e, 0x6f, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x2e, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x07, 0x6e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x27, 0x9a, 0x4a, 0x24, 0x0a, + 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x65, 0x6c, 0x6a, + 0x12, 0x0a, 0x10, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x03, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x77, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x48, 0x9a, 0x4a, 0x45, + 0x22, 0x43, 0x1a, 0x36, 0x0a, 0x02, 0x75, 0x61, 0x6a, 0x30, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x0e, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x03, 0x27, 0x61, 0x27, + 0x12, 0x08, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x01, 0x30, 0x12, 0x0e, 0x0a, 0x03, 0x62, 0x61, + 0x72, 0x12, 0x07, 0x27, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x27, 0x22, 0x02, 0x75, 0x61, 0x0a, 0x05, + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x41, 0x12, 0x76, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x42, 0x47, 0x9a, 0x4a, 0x44, 0x22, 0x42, 0x1a, 0x36, 0x0a, 0x02, 0x75, + 0x62, 0x6a, 0x30, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x07, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x12, 0x03, 0x27, 0x62, 0x27, 0x12, 0x08, 0x0a, 0x03, 0x66, 0x6f, 0x6f, + 0x12, 0x01, 0x30, 0x12, 0x0e, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x12, 0x07, 0x27, 0x68, 0x65, 0x6c, + 0x6c, 0x6f, 0x27, 0x22, 0x02, 0x75, 0x62, 0x0a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x48, 0x00, 0x52, + 0x05, 0x75, 0x73, 0x65, 0x72, 0x42, 0x12, 0x76, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x47, 0x9a, 0x4a, + 0x44, 0x22, 0x42, 0x1a, 0x3a, 0x0a, 0x02, 0x75, 0x63, 0x6a, 0x34, 0x0a, 0x04, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x12, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x07, 0x24, 0x2e, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x08, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x01, 0x30, 0x12, + 0x0e, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x12, 0x07, 0x27, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x27, 0x22, + 0x02, 0x75, 0x63, 0x10, 0x01, 0x48, 0x00, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x43, 0x42, 0x06, + 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x9b, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x05, 0x6d, + 0x73, 0x67, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0x9a, 0x4a, 0x10, 0x22, + 0x0e, 0x22, 0x05, 0x27, 0x61, 0x61, 0x61, 0x27, 0x0a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, + 0x00, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x41, 0x12, 0x29, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x5f, 0x62, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0x9a, 0x4a, 0x0f, 0x22, 0x0d, 0x22, 0x05, 0x27, + 0x62, 0x62, 0x62, 0x27, 0x0a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x73, + 0x67, 0x42, 0x12, 0x25, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x5f, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0x9a, 0x4a, 0x0b, 0x22, 0x09, 0x22, 0x05, 0x27, 0x63, 0x63, 0x63, 0x27, 0x10, + 0x01, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x43, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x10, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x03, 0x6d, 0x5f, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x42, 0x1b, 0x9a, 0x4a, 0x18, 0x22, 0x16, + 0x22, 0x0d, 0x4d, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x27, 0x61, 0x27, 0x7d, 0x0a, + 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x02, 0x6d, 0x41, 0x12, 0x41, 0x0a, 0x03, + 0x6d, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x67, 0x2e, + 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x42, 0x1b, 0x9a, 0x4a, + 0x18, 0x22, 0x16, 0x22, 0x0d, 0x4d, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x27, 0x62, + 0x27, 0x7d, 0x0a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x02, 0x6d, 0x42, 0x42, + 0x0a, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x78, 0x0a, 0x16, 0x4e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x5e, 0x0a, 0x04, 0x4e, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, + 0x03, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0e, 0x9a, 0x4a, 0x0b, 0x22, + 0x09, 0x22, 0x01, 0x31, 0x0a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x48, 0x00, 0x52, 0x03, 0x69, 0x6e, + 0x74, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x13, 0x9a, 0x4a, 0x10, 0x22, 0x0e, 0x22, 0x05, 0x27, 0x66, 0x6f, 0x6f, 0x27, 0x0a, 0x05, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x42, 0x07, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x25, 0x0a, 0x01, 0x4d, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0x9a, 0x4a, 0x07, 0x12, 0x05, + 0x27, 0x66, 0x6f, 0x6f, 0x27, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8f, 0x01, 0x0a, + 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0x9a, 0x4a, 0x0b, 0x12, 0x09, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x67, 0x9a, 0x4a, 0x64, 0x0a, 0x62, 0x72, 0x60, 0x0a, 0x18, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x09, + 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x03, 0x66, 0x6f, 0x6f, + 0x12, 0x05, 0x24, 0x2e, 0x66, 0x6f, 0x6f, 0x1a, 0x0a, 0x24, 0x2e, 0x66, 0x6f, 0x6f, 0x20, 0x21, + 0x3d, 0x20, 0x30, 0x12, 0x19, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x12, 0x05, 0x24, 0x2e, 0x62, 0x61, + 0x72, 0x1a, 0x0b, 0x24, 0x2e, 0x62, 0x61, 0x72, 0x20, 0x21, 0x3d, 0x20, 0x27, 0x27, 0x32, 0xb1, + 0x01, 0x0a, 0x11, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x72, + 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, + 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x66, 0x65, + 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x1a, 0x03, 0x9a, + 0x4a, 0x00, 0x42, 0xb1, 0x01, 0x9a, 0x4a, 0x11, 0x12, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x46, + 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x1d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x66, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, + 0x02, 0x03, 0x4f, 0x46, 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x72, 0x67, 0x2e, 0x46, 0x65, 0x64, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x0e, 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, 0x64, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1a, 0x4f, 0x72, 0x67, 0x5c, 0x46, 0x65, + 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x4f, 0x72, 0x67, 0x3a, 0x3a, 0x46, 0x65, 0x64, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -688,35 +831,38 @@ func file_federation_federation_proto_rawDescGZIP() []byte { return file_federation_federation_proto_rawDescData } -var file_federation_federation_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_federation_federation_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_federation_federation_proto_goTypes = []interface{}{ - (*GetRequest)(nil), // 0: org.federation.GetRequest - (*GetResponse)(nil), // 1: org.federation.GetResponse - (*GetNoValueRequest)(nil), // 2: org.federation.GetNoValueRequest - (*GetNoValueResponse)(nil), // 3: org.federation.GetNoValueResponse - (*UserSelection)(nil), // 4: org.federation.UserSelection - (*MessageSelection)(nil), // 5: org.federation.MessageSelection - (*NoValueSelection)(nil), // 6: org.federation.NoValueSelection - (*M)(nil), // 7: org.federation.M - (*User)(nil), // 8: org.federation.User + (*GetRequest)(nil), // 0: org.federation.GetRequest + (*GetResponse)(nil), // 1: org.federation.GetResponse + (*GetNoValueRequest)(nil), // 2: org.federation.GetNoValueRequest + (*GetNoValueResponse)(nil), // 3: org.federation.GetNoValueResponse + (*UserSelection)(nil), // 4: org.federation.UserSelection + (*MessageSelection)(nil), // 5: org.federation.MessageSelection + (*NoValueSelection)(nil), // 6: org.federation.NoValueSelection + (*NestedMessageSelection)(nil), // 7: org.federation.NestedMessageSelection + (*M)(nil), // 8: org.federation.M + (*User)(nil), // 9: org.federation.User + (*NestedMessageSelection_Nest)(nil), // 10: org.federation.NestedMessageSelection.Nest } var file_federation_federation_proto_depIdxs = []int32{ - 8, // 0: org.federation.GetResponse.user:type_name -> org.federation.User - 7, // 1: org.federation.GetNoValueResponse.no_value:type_name -> org.federation.M - 8, // 2: org.federation.UserSelection.user_a:type_name -> org.federation.User - 8, // 3: org.federation.UserSelection.user_b:type_name -> org.federation.User - 8, // 4: org.federation.UserSelection.user_c:type_name -> org.federation.User - 7, // 5: org.federation.NoValueSelection.m_a:type_name -> org.federation.M - 7, // 6: org.federation.NoValueSelection.m_b:type_name -> org.federation.M - 0, // 7: org.federation.FederationService.Get:input_type -> org.federation.GetRequest - 2, // 8: org.federation.FederationService.GetNoValue:input_type -> org.federation.GetNoValueRequest - 1, // 9: org.federation.FederationService.Get:output_type -> org.federation.GetResponse - 3, // 10: org.federation.FederationService.GetNoValue:output_type -> org.federation.GetNoValueResponse - 9, // [9:11] is the sub-list for method output_type - 7, // [7:9] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 9, // 0: org.federation.GetResponse.user:type_name -> org.federation.User + 10, // 1: org.federation.GetResponse.nested_msg:type_name -> org.federation.NestedMessageSelection.Nest + 8, // 2: org.federation.GetNoValueResponse.no_value:type_name -> org.federation.M + 9, // 3: org.federation.UserSelection.user_a:type_name -> org.federation.User + 9, // 4: org.federation.UserSelection.user_b:type_name -> org.federation.User + 9, // 5: org.federation.UserSelection.user_c:type_name -> org.federation.User + 8, // 6: org.federation.NoValueSelection.m_a:type_name -> org.federation.M + 8, // 7: org.federation.NoValueSelection.m_b:type_name -> org.federation.M + 0, // 8: org.federation.FederationService.Get:input_type -> org.federation.GetRequest + 2, // 9: org.federation.FederationService.GetNoValue:input_type -> org.federation.GetNoValueRequest + 1, // 10: org.federation.FederationService.Get:output_type -> org.federation.GetResponse + 3, // 11: org.federation.FederationService.GetNoValue:output_type -> org.federation.GetNoValueResponse + 10, // [10:12] is the sub-list for method output_type + 8, // [8:10] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_federation_federation_proto_init() } @@ -810,7 +956,7 @@ func file_federation_federation_proto_init() { } } file_federation_federation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*M); i { + switch v := v.(*NestedMessageSelection); i { case 0: return &v.state case 1: @@ -822,6 +968,18 @@ func file_federation_federation_proto_init() { } } file_federation_federation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*M); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_federation_federation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*User); i { case 0: return &v.state @@ -833,6 +991,18 @@ func file_federation_federation_proto_init() { return nil } } + file_federation_federation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NestedMessageSelection_Nest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_federation_federation_proto_msgTypes[4].OneofWrappers = []interface{}{ (*UserSelection_UserA)(nil), @@ -848,13 +1018,17 @@ func file_federation_federation_proto_init() { (*NoValueSelection_MA)(nil), (*NoValueSelection_MB)(nil), } + file_federation_federation_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*NestedMessageSelection_Nest_Int)(nil), + (*NestedMessageSelection_Nest_Text)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_federation_federation_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/_examples/10_oneof/federation/federation_grpc_federation.pb.go b/_examples/10_oneof/federation/federation_grpc_federation.pb.go index 4b48e0b2..9ef92ac7 100644 --- a/_examples/10_oneof/federation/federation_grpc_federation.pb.go +++ b/_examples/10_oneof/federation/federation_grpc_federation.pb.go @@ -31,14 +31,19 @@ type FederationService_Org_Federation_GetNoValueResponseArgument struct { // Org_Federation_GetResponseArgument is argument for "org.federation.GetResponse" message. type FederationService_Org_Federation_GetResponseArgument struct { - MsgSel *MessageSelection - Sel *UserSelection + MsgSel *MessageSelection + NestedMsg *NestedMessageSelection_Nest + Sel *UserSelection } // Org_Federation_MessageSelectionArgument is argument for "org.federation.MessageSelection" message. type FederationService_Org_Federation_MessageSelectionArgument struct { } +// Org_Federation_NestedMessageSelection_NestArgument is argument for "org.federation.Nest" message. +type FederationService_Org_Federation_NestedMessageSelection_NestArgument struct { +} + // Org_Federation_NoValueSelectionArgument is argument for "org.federation.NoValueSelection" message. type FederationService_Org_Federation_NoValueSelectionArgument struct { } @@ -144,10 +149,11 @@ func NewFederationService(cfg FederationServiceConfig) (*FederationService, erro errorHandler = func(ctx context.Context, methodName string, err error) error { return err } } celTypeHelperFieldMap := grpcfed.CELTypeHelperFieldMap{ - "grpc.federation.private.GetNoValueResponseArgument": {}, - "grpc.federation.private.GetResponseArgument": {}, - "grpc.federation.private.MessageSelectionArgument": {}, - "grpc.federation.private.NoValueSelectionArgument": {}, + "grpc.federation.private.GetNoValueResponseArgument": {}, + "grpc.federation.private.GetResponseArgument": {}, + "grpc.federation.private.MessageSelectionArgument": {}, + "grpc.federation.private.NestedMessageSelection_NestArgument": {}, + "grpc.federation.private.NoValueSelectionArgument": {}, "grpc.federation.private.UserArgument": { "user_id": grpcfed.NewCELFieldType(grpcfed.CELStringType, "UserId"), "foo": grpcfed.NewCELFieldType(grpcfed.CELIntType, "Foo"), @@ -319,15 +325,17 @@ func (s *FederationService) resolve_Org_Federation_GetResponse(ctx context.Conte type localValueType struct { *grpcfed.LocalValue vars struct { - msg_sel *MessageSelection - sel *UserSelection + msg_sel *MessageSelection + nested_msg *NestedMessageSelection_Nest + sel *UserSelection } } value := &localValueType{LocalValue: grpcfed.NewLocalValue(ctx, s.celEnvOpts, "grpc.federation.private.GetResponseArgument", req)} // A tree view of message dependencies is shown below. /* - msg_sel ─┐ - sel ─┤ + msg_sel ─┐ + nested_msg ─┤ + sel ─┤ */ eg, ctx1 := grpcfed.ErrorGroupWithContext(ctx) @@ -364,6 +372,39 @@ func (s *FederationService) resolve_Org_Federation_GetResponse(ctx context.Conte return nil, nil }) + grpcfed.GoWithRecover(eg, func() (any, error) { + + // This section's codes are generated by the following proto definition. + /* + def { + name: "nested_msg" + message { + name: "Nest" + } + } + */ + if err := grpcfed.EvalDef(ctx1, value, grpcfed.Def[*NestedMessageSelection_Nest, *localValueType]{ + Name: `nested_msg`, + Type: grpcfed.CELObjectType("org.federation.NestedMessageSelection.Nest"), + Setter: func(value *localValueType, v *NestedMessageSelection_Nest) error { + value.vars.nested_msg = v + return nil + }, + Message: func(ctx context.Context, value *localValueType) (any, error) { + args := &FederationService_Org_Federation_NestedMessageSelection_NestArgument{} + ret, err := s.resolve_Org_Federation_NestedMessageSelection_Nest(ctx, args) + if err != nil { + return nil, err + } + return ret, nil + }, + }); err != nil { + grpcfed.RecordErrorToSpan(ctx1, err) + return nil, err + } + return nil, nil + }) + grpcfed.GoWithRecover(eg, func() (any, error) { // This section's codes are generated by the following proto definition. @@ -416,6 +457,7 @@ func (s *FederationService) resolve_Org_Federation_GetResponse(ctx context.Conte // assign named parameters to message arguments to pass to the custom resolver. req.MsgSel = value.vars.msg_sel + req.NestedMsg = value.vars.nested_msg req.Sel = value.vars.sel // create a message value to be returned. @@ -448,6 +490,19 @@ func (s *FederationService) resolve_Org_Federation_GetResponse(ctx context.Conte grpcfed.RecordErrorToSpan(ctx, err) return nil, err } + // (grpc.federation.field).by = "nested_msg" + if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*NestedMessageSelection_Nest]{ + Value: value, + Expr: `nested_msg`, + CacheIndex: 5, + Setter: func(v *NestedMessageSelection_Nest) error { + ret.NestedMsg = v + return nil + }, + }); err != nil { + grpcfed.RecordErrorToSpan(ctx, err) + return nil, err + } grpcfed.Logger(ctx).DebugContext(ctx, "resolved org.federation.GetResponse", slog.Any("org.federation.GetResponse", s.logvalue_Org_Federation_GetResponse(ret))) return ret, nil @@ -475,7 +530,7 @@ func (s *FederationService) resolve_Org_Federation_MessageSelection(ctx context. Value: value, Expr: `false`, OutType: reflect.TypeOf(true), - CacheIndex: 5, + CacheIndex: 6, }) if err != nil { grpcfed.RecordErrorToSpan(ctx, err) @@ -485,7 +540,7 @@ func (s *FederationService) resolve_Org_Federation_MessageSelection(ctx context. Value: value, Expr: `true`, OutType: reflect.TypeOf(true), - CacheIndex: 6, + CacheIndex: 7, }) if err != nil { grpcfed.RecordErrorToSpan(ctx, err) @@ -497,7 +552,7 @@ func (s *FederationService) resolve_Org_Federation_MessageSelection(ctx context. if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'aaa'`, - CacheIndex: 7, + CacheIndex: 8, Setter: func(v string) error { ret.Message = &MessageSelection_MsgA{MsgA: v} return nil @@ -511,7 +566,7 @@ func (s *FederationService) resolve_Org_Federation_MessageSelection(ctx context. if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'bbb'`, - CacheIndex: 8, + CacheIndex: 9, Setter: func(v string) error { ret.Message = &MessageSelection_MsgB{MsgB: v} return nil @@ -525,7 +580,7 @@ func (s *FederationService) resolve_Org_Federation_MessageSelection(ctx context. if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'ccc'`, - CacheIndex: 9, + CacheIndex: 10, Setter: func(v string) error { ret.Message = &MessageSelection_MsgC{MsgC: v} return nil @@ -540,6 +595,79 @@ func (s *FederationService) resolve_Org_Federation_MessageSelection(ctx context. return ret, nil } +// resolve_Org_Federation_NestedMessageSelection_Nest resolve "org.federation.NestedMessageSelection.Nest" message. +func (s *FederationService) resolve_Org_Federation_NestedMessageSelection_Nest(ctx context.Context, req *FederationService_Org_Federation_NestedMessageSelection_NestArgument) (*NestedMessageSelection_Nest, error) { + ctx, span := s.tracer.Start(ctx, "org.federation.NestedMessageSelection.Nest") + defer span.End() + ctx = grpcfed.WithLogger(ctx, grpcfed.Logger(ctx), grpcfed.LogAttrs(ctx)...) + + grpcfed.Logger(ctx).DebugContext(ctx, "resolve org.federation.NestedMessageSelection.Nest", slog.Any("message_args", s.logvalue_Org_Federation_NestedMessageSelection_NestArgument(req))) + type localValueType struct { + *grpcfed.LocalValue + vars struct { + } + } + value := &localValueType{LocalValue: grpcfed.NewLocalValue(ctx, s.celEnvOpts, "grpc.federation.private.NestedMessageSelection_NestArgument", req)} + + // create a message value to be returned. + ret := &NestedMessageSelection_Nest{} + + // field binding section. + oneof_Int, err := grpcfed.EvalCEL(ctx, &grpcfed.EvalCELRequest{ + Value: value, + Expr: `true`, + OutType: reflect.TypeOf(true), + CacheIndex: 11, + }) + if err != nil { + grpcfed.RecordErrorToSpan(ctx, err) + return nil, err + } + oneof_Text, err := grpcfed.EvalCEL(ctx, &grpcfed.EvalCELRequest{ + Value: value, + Expr: `false`, + OutType: reflect.TypeOf(true), + CacheIndex: 12, + }) + if err != nil { + grpcfed.RecordErrorToSpan(ctx, err) + return nil, err + } + switch { + case oneof_Int.(bool): + + if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[int64]{ + Value: value, + Expr: `1`, + CacheIndex: 13, + Setter: func(v int64) error { + ret.Value = &NestedMessageSelection_Nest_Int{Int: v} + return nil + }, + }); err != nil { + grpcfed.RecordErrorToSpan(ctx, err) + return nil, err + } + case oneof_Text.(bool): + + if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ + Value: value, + Expr: `'foo'`, + CacheIndex: 14, + Setter: func(v string) error { + ret.Value = &NestedMessageSelection_Nest_Text{Text: v} + return nil + }, + }); err != nil { + grpcfed.RecordErrorToSpan(ctx, err) + return nil, err + } + } + + grpcfed.Logger(ctx).DebugContext(ctx, "resolved org.federation.NestedMessageSelection.Nest", slog.Any("org.federation.NestedMessageSelection.Nest", s.logvalue_Org_Federation_NestedMessageSelection_Nest(ret))) + return ret, nil +} + // resolve_Org_Federation_NoValueSelection resolve "org.federation.NoValueSelection" message. func (s *FederationService) resolve_Org_Federation_NoValueSelection(ctx context.Context, req *FederationService_Org_Federation_NoValueSelectionArgument) (*NoValueSelection, error) { ctx, span := s.tracer.Start(ctx, "org.federation.NoValueSelection") @@ -562,7 +690,7 @@ func (s *FederationService) resolve_Org_Federation_NoValueSelection(ctx context. Value: value, Expr: `false`, OutType: reflect.TypeOf(true), - CacheIndex: 10, + CacheIndex: 15, }) if err != nil { grpcfed.RecordErrorToSpan(ctx, err) @@ -572,7 +700,7 @@ func (s *FederationService) resolve_Org_Federation_NoValueSelection(ctx context. Value: value, Expr: `false`, OutType: reflect.TypeOf(true), - CacheIndex: 11, + CacheIndex: 16, }) if err != nil { grpcfed.RecordErrorToSpan(ctx, err) @@ -584,7 +712,7 @@ func (s *FederationService) resolve_Org_Federation_NoValueSelection(ctx context. if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*M]{ Value: value, Expr: `M{value: 'a'}`, - CacheIndex: 12, + CacheIndex: 17, Setter: func(v *M) error { ret.NoValue = &NoValueSelection_MA{MA: v} return nil @@ -598,7 +726,7 @@ func (s *FederationService) resolve_Org_Federation_NoValueSelection(ctx context. if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*M]{ Value: value, Expr: `M{value: 'b'}`, - CacheIndex: 13, + CacheIndex: 18, Setter: func(v *M) error { ret.NoValue = &NoValueSelection_MB{MB: v} return nil @@ -655,7 +783,7 @@ func (s *FederationService) resolve_Org_Federation_User(ctx context.Context, req if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `$.user_id`, - CacheIndex: 14, + CacheIndex: 19, Setter: func(v string) error { args.Id = v return nil @@ -667,12 +795,12 @@ func (s *FederationService) resolve_Org_Federation_User(ctx context.Context, req if err := grpcfed.If(ctx, &grpcfed.IfParam[*localValueType]{ Value: value, Expr: `$.foo != 0`, - CacheIndex: 15, + CacheIndex: 20, Body: func(value *localValueType) error { return grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[int64]{ Value: value, Expr: `$.foo`, - CacheIndex: 16, + CacheIndex: 21, Setter: func(v int64) error { args.Foobar = &user.GetUserRequest_Foo{ Foo: v, @@ -688,12 +816,12 @@ func (s *FederationService) resolve_Org_Federation_User(ctx context.Context, req if err := grpcfed.If(ctx, &grpcfed.IfParam[*localValueType]{ Value: value, Expr: `$.bar != ''`, - CacheIndex: 17, + CacheIndex: 22, Body: func(value *localValueType) error { return grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `$.bar`, - CacheIndex: 18, + CacheIndex: 23, Setter: func(v string) error { args.Foobar = &user.GetUserRequest_Bar{ Bar: v, @@ -727,7 +855,7 @@ func (s *FederationService) resolve_Org_Federation_User(ctx context.Context, req if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `$.user_id`, - CacheIndex: 19, + CacheIndex: 24, Setter: func(v string) error { ret.Id = v return nil @@ -771,7 +899,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con Value: value, Expr: `false`, OutType: reflect.TypeOf(true), - CacheIndex: 20, + CacheIndex: 25, }) if err != nil { grpcfed.RecordErrorToSpan(ctx, err) @@ -781,7 +909,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con Value: value, Expr: `true`, OutType: reflect.TypeOf(true), - CacheIndex: 21, + CacheIndex: 26, }) if err != nil { grpcfed.RecordErrorToSpan(ctx, err) @@ -817,7 +945,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'a'`, - CacheIndex: 22, + CacheIndex: 27, Setter: func(v string) error { args.UserId = v return nil @@ -829,7 +957,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[int64]{ Value: value, Expr: `0`, - CacheIndex: 23, + CacheIndex: 28, Setter: func(v int64) error { args.Foo = v return nil @@ -841,7 +969,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'hello'`, - CacheIndex: 24, + CacheIndex: 29, Setter: func(v string) error { args.Bar = v return nil @@ -862,7 +990,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*User]{ Value: value, Expr: `ua`, - CacheIndex: 25, + CacheIndex: 30, Setter: func(v *User) error { ret.User = &UserSelection_UserA{UserA: v} return nil @@ -900,7 +1028,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'b'`, - CacheIndex: 26, + CacheIndex: 31, Setter: func(v string) error { args.UserId = v return nil @@ -912,7 +1040,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[int64]{ Value: value, Expr: `0`, - CacheIndex: 27, + CacheIndex: 32, Setter: func(v int64) error { args.Foo = v return nil @@ -924,7 +1052,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'hello'`, - CacheIndex: 28, + CacheIndex: 33, Setter: func(v string) error { args.Bar = v return nil @@ -945,7 +1073,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*User]{ Value: value, Expr: `ub`, - CacheIndex: 29, + CacheIndex: 34, Setter: func(v *User) error { ret.User = &UserSelection_UserB{UserB: v} return nil @@ -983,7 +1111,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `$.value`, - CacheIndex: 30, + CacheIndex: 35, Setter: func(v string) error { args.UserId = v return nil @@ -995,7 +1123,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[int64]{ Value: value, Expr: `0`, - CacheIndex: 31, + CacheIndex: 36, Setter: func(v int64) error { args.Foo = v return nil @@ -1007,7 +1135,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[string]{ Value: value, Expr: `'hello'`, - CacheIndex: 32, + CacheIndex: 37, Setter: func(v string) error { args.Bar = v return nil @@ -1028,7 +1156,7 @@ func (s *FederationService) resolve_Org_Federation_UserSelection(ctx context.Con if err := grpcfed.SetCELValue(ctx, &grpcfed.SetCELValueParam[*User]{ Value: value, Expr: `uc`, - CacheIndex: 33, + CacheIndex: 38, Setter: func(v *User) error { ret.User = &UserSelection_UserC{UserC: v} return nil @@ -1066,6 +1194,7 @@ func (s *FederationService) logvalue_Org_Federation_GetResponse(v *GetResponse) return slog.GroupValue( slog.Any("user", s.logvalue_Org_Federation_User(v.GetUser())), slog.String("msg", v.GetMsg()), + slog.Any("nested_msg", s.logvalue_Org_Federation_NestedMessageSelection_Nest(v.GetNestedMsg())), ) } @@ -1103,6 +1232,23 @@ func (s *FederationService) logvalue_Org_Federation_MessageSelectionArgument(v * return slog.GroupValue() } +func (s *FederationService) logvalue_Org_Federation_NestedMessageSelection_Nest(v *NestedMessageSelection_Nest) slog.Value { + if v == nil { + return slog.GroupValue() + } + return slog.GroupValue( + slog.Int64("int", v.GetInt()), + slog.String("text", v.GetText()), + ) +} + +func (s *FederationService) logvalue_Org_Federation_NestedMessageSelection_NestArgument(v *FederationService_Org_Federation_NestedMessageSelection_NestArgument) slog.Value { + if v == nil { + return slog.GroupValue() + } + return slog.GroupValue() +} + func (s *FederationService) logvalue_Org_Federation_NoValueSelection(v *NoValueSelection) slog.Value { if v == nil { return slog.GroupValue() diff --git a/_examples/10_oneof/main_test.go b/_examples/10_oneof/main_test.go index ddf93699..1b8c6918 100644 --- a/_examples/10_oneof/main_test.go +++ b/_examples/10_oneof/main_test.go @@ -119,9 +119,14 @@ func TestFederation(t *testing.T) { Id: "b", }, Msg: "bbb", + NestedMsg: &federation.NestedMessageSelection_Nest{ + Value: &federation.NestedMessageSelection_Nest_Int{Int: 1}, + }, }, cmpopts.IgnoreUnexported( federation.GetResponse{}, federation.User{}, + federation.NestedMessageSelection_Nest{}, + federation.NestedMessageSelection_Nest_Int{}, )); diff != "" { t.Errorf("(-got, +want)\n%s", diff) } diff --git a/_examples/10_oneof/proto/federation/federation.proto b/_examples/10_oneof/proto/federation/federation.proto index ac2b8a7e..ca7e5b79 100644 --- a/_examples/10_oneof/proto/federation/federation.proto +++ b/_examples/10_oneof/proto/federation/federation.proto @@ -28,9 +28,11 @@ message GetResponse { } } def { name: "msg_sel" message { name: "MessageSelection" } } + def { name: "nested_msg" message { name: "NestedMessageSelection.Nest" }} }; User user = 1 [(grpc.federation.field).by = "sel.user"]; string msg = 2 [(grpc.federation.field).by = "msg_sel.message"]; + NestedMessageSelection.Nest nested_msg = 3 [(grpc.federation.field).by = "nested_msg"]; } message GetNoValueRequest {} @@ -140,6 +142,21 @@ message NoValueSelection { } } +message NestedMessageSelection { + message Nest { + oneof value { + int64 int = 1 [(grpc.federation.field).oneof = { + if: "true" + by: "1" + }]; + string text = 2 [(grpc.federation.field).oneof = { + if: "false" + by: "'foo'" + }]; + } + } +} + message M { string value = 1 [(grpc.federation.field).by = "'foo'"]; } diff --git a/generator/code_generator.go b/generator/code_generator.go index a16cc870..cab3675c 100644 --- a/generator/code_generator.go +++ b/generator/code_generator.go @@ -2378,7 +2378,7 @@ func (m *Message) oneofValueToReturnField(oneof *resolver.Oneof) (*OneofReturnFi toType := field.Type fieldName := util.ToPublicGoVariable(field.Name) - oneofTypeName := m.Message.Name + "_" + fieldName + oneofTypeName := strings.TrimPrefix(m.file.messageTypeToText(m.Message), "*") + "_" + fieldName if toType.OneofField.IsConflict() { oneofTypeName += "_" }