From b951862f9675823dacbdadfcb04544e1711507bd Mon Sep 17 00:00:00 2001 From: oscarmuhr Date: Fri, 12 Apr 2024 08:20:13 +0200 Subject: [PATCH] fix(fieldbehavior): traverse messages and collections to clear nested field behaviors TRA-1320 --- fieldbehavior/fieldbehavior.go | 85 ++- fieldbehavior/fieldbehavior_test.go | 268 +++++++++ .../example/syntax/v1/fieldbehaviors.proto | 37 ++ .../example/syntax/v1/fieldbehaviors.pb.go | 535 ++++++++++++++++++ 4 files changed, 902 insertions(+), 23 deletions(-) create mode 100644 proto/einride/example/syntax/v1/fieldbehaviors.proto create mode 100644 proto/gen/einride/example/syntax/v1/fieldbehaviors.pb.go diff --git a/fieldbehavior/fieldbehavior.go b/fieldbehavior/fieldbehavior.go index 2024d60c21..3e204a1213 100644 --- a/fieldbehavior/fieldbehavior.go +++ b/fieldbehavior/fieldbehavior.go @@ -109,33 +109,72 @@ func isPresent(v protoreflect.Value, f protoreflect.FieldDescriptor) bool { } func clearFieldsWithBehaviors(m proto.Message, behaviorsToClear ...annotations.FieldBehavior) { - rangeFieldsWithBehaviors(m, func( - m protoreflect.Message, - f protoreflect.FieldDescriptor, - _ protoreflect.Value, - behaviors []annotations.FieldBehavior, - ) bool { - if hasAnyBehavior(behaviors, behaviorsToClear) { - m.Clear(f) - } - return true - }) + rangeFieldsWithBehaviors( + m.ProtoReflect(), + func( + m protoreflect.Message, + f protoreflect.FieldDescriptor, + _ protoreflect.Value, + behaviors []annotations.FieldBehavior, + ) bool { + if hasAnyBehavior(behaviors, behaviorsToClear) { + m.Clear(f) + } + return true + }, + ) } func rangeFieldsWithBehaviors( - m proto.Message, - fn func(protoreflect.Message, protoreflect.FieldDescriptor, protoreflect.Value, []annotations.FieldBehavior) bool, + m protoreflect.Message, + fn func( + protoreflect.Message, + protoreflect.FieldDescriptor, + protoreflect.Value, + []annotations.FieldBehavior, + ) bool, ) { - d := m.ProtoReflect() - d.Range(func(f protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if behaviors, ok := proto.GetExtension( - f.Options(), - annotations.E_FieldBehavior, - ).([]annotations.FieldBehavior); ok { - return fn(d, f, v, behaviors) - } - return true - }) + m.Range( + func(f protoreflect.FieldDescriptor, v protoreflect.Value) bool { + if behaviors, ok := proto.GetExtension( + f.Options(), + annotations.E_FieldBehavior, + ).([]annotations.FieldBehavior); ok { + fn(m, f, v, behaviors) + } + + switch { + // if field is repeated, traverse the nested message for field behaviors + case f.IsList() && f.Kind() == protoreflect.MessageKind: + for i := 0; i < v.List().Len(); i++ { + rangeFieldsWithBehaviors( + v.List().Get(i).Message(), + fn, + ) + } + return true + // if field is map, traverse the nested message for field behaviors + case f.IsMap() && f.MapValue().Kind() == protoreflect.MessageKind: + v.Map().Range(func(_ protoreflect.MapKey, mv protoreflect.Value) bool { + rangeFieldsWithBehaviors( + mv.Message(), + fn, + ) + return true + }) + return true + // if field is message, traverse the message + // maps are also treated as Kind message and should not be traversed as messages + case f.Kind() == protoreflect.MessageKind && !f.IsMap(): + rangeFieldsWithBehaviors( + v.Message(), + fn, + ) + return true + default: + return true + } + }) } func hasAnyBehavior(haystack, needles []annotations.FieldBehavior) bool { diff --git a/fieldbehavior/fieldbehavior_test.go b/fieldbehavior/fieldbehavior_test.go index 2b48b700dc..0443acf9d4 100644 --- a/fieldbehavior/fieldbehavior_test.go +++ b/fieldbehavior/fieldbehavior_test.go @@ -4,8 +4,10 @@ import ( "testing" examplefreightv1 "go.einride.tech/aip/proto/gen/einride/example/freight/v1" + syntaxv1 "go.einride.tech/aip/proto/gen/einride/example/syntax/v1" "google.golang.org/genproto/googleapis/api/annotations" "google.golang.org/genproto/googleapis/example/library/v1" + "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/fieldmaskpb" "google.golang.org/protobuf/types/known/timestamppb" "gotest.tools/v3/assert" @@ -26,6 +28,272 @@ func TestClearFields(t *testing.T) { assert.Equal(t, site.GetDisplayName(), "site one") assert.Equal(t, site.GetName(), "site1") }) + t.Run("clear field with set field_behavior on nested message", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + MessageWithoutFieldBehavior: &syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + MessageWithoutFieldBehavior: &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual(t, input, expected, protocmp.Transform()) + }) + + t.Run("clear field with set field_behavior on multiple levels of nested messages", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + MessageWithoutFieldBehavior: &syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + MessageWithoutFieldBehavior: &syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + }, + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + MessageWithoutFieldBehavior: &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + MessageWithoutFieldBehavior: &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + }, + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual(t, input, expected, protocmp.Transform()) + }) + + t.Run("clear fields with set field_behavior on repeated message", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + { + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + }, + }, + StringList: []string{ // not a message type, should not be traversed + "string", + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ + { + Field: "field", + OptionalField: "optional", + }, + }, + StringList: []string{ + "string", + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual(t, input, expected, protocmp.Transform()) + }) + + t.Run("clear fields with set field_behavior on multiple levels of repeated messages", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + { + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + { + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + }, + }, + }, + }, + StringList: []string{ // not a message type, should not be traversed + "string", + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ + { + Field: "field", + OptionalField: "optional", + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ + { + Field: "field", + OptionalField: "optional", + }, + }, + }, + }, + StringList: []string{ + "string", + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual(t, input, expected, protocmp.Transform()) + }) + + t.Run("clear repeated field with set field_behavior", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + { + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + }, + }, + RepeatedOutputOnlyMessage: []*syntaxv1.FieldBehaviorMessage{ // has OUTPUT_ONLY field_behavior; should be cleared. + { + Field: "field", + OptionalField: "optional", + OutputOnlyField: "output_only", + }, + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + RepeatedMessage: []*syntaxv1.FieldBehaviorMessage{ // has no field_behaviors; should not be cleared. + { + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + }, + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual(t, input, expected, protocmp.Transform()) + }) + + t.Run("clear fields with set field_behavior on message in map", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + MapOptionalMessage: map[string]*syntaxv1.FieldBehaviorMessage{ + "key_1": { + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + }, + }, + StringMap: map[string]string{ + "string_key": "string", // not a message type, should not be traversed + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + OptionalField: "optional", + MapOptionalMessage: map[string]*syntaxv1.FieldBehaviorMessage{ + "key_1": { + OptionalField: "optional", + }, + }, + StringMap: map[string]string{ + "string_key": "string", + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual( + t, + input, + expected, + protocmp.Transform(), + ) + }) + + t.Run("clear map field with set field_behavior", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + OptionalField: "optional", + // has OUTPUT_ONLY field_behavior; should be cleared. + MapOutputOnlyMessage: map[string]*syntaxv1.FieldBehaviorMessage{ + "key_1": { + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; but should be cleared with parent message. + }, + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + OptionalField: "optional", + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual( + t, + input, + expected, + protocmp.Transform(), + ) + }) + + t.Run("clear field with set field_behavior on oneof message", func(t *testing.T) { + t.Parallel() + input := &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + Oneof: &syntaxv1.FieldBehaviorMessage_FieldBehaviorMessage{ + FieldBehaviorMessage: &syntaxv1.FieldBehaviorMessage{ + Field: "field", // has no field_behaviors; should not be cleared. + OptionalField: "optional", // has OPTIONAL field_behavior; should not be cleared. + OutputOnlyField: "output_only", // has OUTPUT_ONLY field_behavior; should be cleared. + }, + }, + } + + expected := &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + Oneof: &syntaxv1.FieldBehaviorMessage_FieldBehaviorMessage{ + FieldBehaviorMessage: &syntaxv1.FieldBehaviorMessage{ + Field: "field", + OptionalField: "optional", + }, + }, + } + + ClearFields(input, annotations.FieldBehavior_OUTPUT_ONLY) + assert.DeepEqual(t, input, expected, protocmp.Transform()) + }) } func TestCopyFields(t *testing.T) { diff --git a/proto/einride/example/syntax/v1/fieldbehaviors.proto b/proto/einride/example/syntax/v1/fieldbehaviors.proto new file mode 100644 index 0000000000..f2a0ce0181 --- /dev/null +++ b/proto/einride/example/syntax/v1/fieldbehaviors.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; + +package einride.example.syntax.v1; + +import "google/api/field_behavior.proto"; + +message FieldBehaviorMessage { + string field = 1; + string output_only_field = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + string optional_field = 3 [(google.api.field_behavior) = OPTIONAL]; + + FieldBehaviorMessage message_without_field_behavior = 12; + FieldBehaviorMessage output_only_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + FieldBehaviorMessage optional_message = 14 [(google.api.field_behavior) = OPTIONAL]; + + repeated FieldBehaviorMessage repeated_message = 4; + repeated FieldBehaviorMessage repeated_output_only_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated FieldBehaviorMessage repeated_optional_message = 6 [(google.api.field_behavior) = OPTIONAL]; + + map map_message = 7; + map map_output_only_message = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + map map_optional_message = 9 [(google.api.field_behavior) = OPTIONAL]; + + map string_map = 10; + repeated string string_list = 11; + + oneof oneof { + FieldBehaviorMessage field_behavior_message = 15; + SmallFieldBehaviorMessage small_field_behavior_message = 16; + } +} + +message SmallFieldBehaviorMessage { + string field = 1; + string output_only_field = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + string optional_field = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/proto/gen/einride/example/syntax/v1/fieldbehaviors.pb.go b/proto/gen/einride/example/syntax/v1/fieldbehaviors.pb.go new file mode 100644 index 0000000000..46ba26cbd5 --- /dev/null +++ b/proto/gen/einride/example/syntax/v1/fieldbehaviors.pb.go @@ -0,0 +1,535 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: einride/example/syntax/v1/fieldbehaviors.proto + +package syntaxv1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FieldBehaviorMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + OutputOnlyField string `protobuf:"bytes,2,opt,name=output_only_field,json=outputOnlyField,proto3" json:"output_only_field,omitempty"` + OptionalField string `protobuf:"bytes,3,opt,name=optional_field,json=optionalField,proto3" json:"optional_field,omitempty"` + MessageWithoutFieldBehavior *FieldBehaviorMessage `protobuf:"bytes,12,opt,name=message_without_field_behavior,json=messageWithoutFieldBehavior,proto3" json:"message_without_field_behavior,omitempty"` + OutputOnlyMessage *FieldBehaviorMessage `protobuf:"bytes,13,opt,name=output_only_message,json=outputOnlyMessage,proto3" json:"output_only_message,omitempty"` + OptionalMessage *FieldBehaviorMessage `protobuf:"bytes,14,opt,name=optional_message,json=optionalMessage,proto3" json:"optional_message,omitempty"` + RepeatedMessage []*FieldBehaviorMessage `protobuf:"bytes,4,rep,name=repeated_message,json=repeatedMessage,proto3" json:"repeated_message,omitempty"` + RepeatedOutputOnlyMessage []*FieldBehaviorMessage `protobuf:"bytes,5,rep,name=repeated_output_only_message,json=repeatedOutputOnlyMessage,proto3" json:"repeated_output_only_message,omitempty"` + RepeatedOptionalMessage []*FieldBehaviorMessage `protobuf:"bytes,6,rep,name=repeated_optional_message,json=repeatedOptionalMessage,proto3" json:"repeated_optional_message,omitempty"` + MapMessage map[string]*FieldBehaviorMessage `protobuf:"bytes,7,rep,name=map_message,json=mapMessage,proto3" json:"map_message,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + MapOutputOnlyMessage map[string]*FieldBehaviorMessage `protobuf:"bytes,8,rep,name=map_output_only_message,json=mapOutputOnlyMessage,proto3" json:"map_output_only_message,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + MapOptionalMessage map[string]*FieldBehaviorMessage `protobuf:"bytes,9,rep,name=map_optional_message,json=mapOptionalMessage,proto3" json:"map_optional_message,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringMap map[string]string `protobuf:"bytes,10,rep,name=string_map,json=stringMap,proto3" json:"string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringList []string `protobuf:"bytes,11,rep,name=string_list,json=stringList,proto3" json:"string_list,omitempty"` + // Types that are assignable to Oneof: + // + // *FieldBehaviorMessage_FieldBehaviorMessage + // *FieldBehaviorMessage_SmallFieldBehaviorMessage + Oneof isFieldBehaviorMessage_Oneof `protobuf_oneof:"oneof"` +} + +func (x *FieldBehaviorMessage) Reset() { + *x = FieldBehaviorMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldBehaviorMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldBehaviorMessage) ProtoMessage() {} + +func (x *FieldBehaviorMessage) ProtoReflect() protoreflect.Message { + mi := &file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldBehaviorMessage.ProtoReflect.Descriptor instead. +func (*FieldBehaviorMessage) Descriptor() ([]byte, []int) { + return file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescGZIP(), []int{0} +} + +func (x *FieldBehaviorMessage) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +func (x *FieldBehaviorMessage) GetOutputOnlyField() string { + if x != nil { + return x.OutputOnlyField + } + return "" +} + +func (x *FieldBehaviorMessage) GetOptionalField() string { + if x != nil { + return x.OptionalField + } + return "" +} + +func (x *FieldBehaviorMessage) GetMessageWithoutFieldBehavior() *FieldBehaviorMessage { + if x != nil { + return x.MessageWithoutFieldBehavior + } + return nil +} + +func (x *FieldBehaviorMessage) GetOutputOnlyMessage() *FieldBehaviorMessage { + if x != nil { + return x.OutputOnlyMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetOptionalMessage() *FieldBehaviorMessage { + if x != nil { + return x.OptionalMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetRepeatedMessage() []*FieldBehaviorMessage { + if x != nil { + return x.RepeatedMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetRepeatedOutputOnlyMessage() []*FieldBehaviorMessage { + if x != nil { + return x.RepeatedOutputOnlyMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetRepeatedOptionalMessage() []*FieldBehaviorMessage { + if x != nil { + return x.RepeatedOptionalMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetMapMessage() map[string]*FieldBehaviorMessage { + if x != nil { + return x.MapMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetMapOutputOnlyMessage() map[string]*FieldBehaviorMessage { + if x != nil { + return x.MapOutputOnlyMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetMapOptionalMessage() map[string]*FieldBehaviorMessage { + if x != nil { + return x.MapOptionalMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetStringMap() map[string]string { + if x != nil { + return x.StringMap + } + return nil +} + +func (x *FieldBehaviorMessage) GetStringList() []string { + if x != nil { + return x.StringList + } + return nil +} + +func (m *FieldBehaviorMessage) GetOneof() isFieldBehaviorMessage_Oneof { + if m != nil { + return m.Oneof + } + return nil +} + +func (x *FieldBehaviorMessage) GetFieldBehaviorMessage() *FieldBehaviorMessage { + if x, ok := x.GetOneof().(*FieldBehaviorMessage_FieldBehaviorMessage); ok { + return x.FieldBehaviorMessage + } + return nil +} + +func (x *FieldBehaviorMessage) GetSmallFieldBehaviorMessage() *SmallFieldBehaviorMessage { + if x, ok := x.GetOneof().(*FieldBehaviorMessage_SmallFieldBehaviorMessage); ok { + return x.SmallFieldBehaviorMessage + } + return nil +} + +type isFieldBehaviorMessage_Oneof interface { + isFieldBehaviorMessage_Oneof() +} + +type FieldBehaviorMessage_FieldBehaviorMessage struct { + FieldBehaviorMessage *FieldBehaviorMessage `protobuf:"bytes,15,opt,name=field_behavior_message,json=fieldBehaviorMessage,proto3,oneof"` +} + +type FieldBehaviorMessage_SmallFieldBehaviorMessage struct { + SmallFieldBehaviorMessage *SmallFieldBehaviorMessage `protobuf:"bytes,16,opt,name=small_field_behavior_message,json=smallFieldBehaviorMessage,proto3,oneof"` +} + +func (*FieldBehaviorMessage_FieldBehaviorMessage) isFieldBehaviorMessage_Oneof() {} + +func (*FieldBehaviorMessage_SmallFieldBehaviorMessage) isFieldBehaviorMessage_Oneof() {} + +type SmallFieldBehaviorMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + OutputOnlyField string `protobuf:"bytes,2,opt,name=output_only_field,json=outputOnlyField,proto3" json:"output_only_field,omitempty"` + OptionalField string `protobuf:"bytes,3,opt,name=optional_field,json=optionalField,proto3" json:"optional_field,omitempty"` +} + +func (x *SmallFieldBehaviorMessage) Reset() { + *x = SmallFieldBehaviorMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SmallFieldBehaviorMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SmallFieldBehaviorMessage) ProtoMessage() {} + +func (x *SmallFieldBehaviorMessage) ProtoReflect() protoreflect.Message { + mi := &file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SmallFieldBehaviorMessage.ProtoReflect.Descriptor instead. +func (*SmallFieldBehaviorMessage) Descriptor() ([]byte, []int) { + return file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescGZIP(), []int{1} +} + +func (x *SmallFieldBehaviorMessage) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +func (x *SmallFieldBehaviorMessage) GetOutputOnlyField() string { + if x != nil { + return x.OutputOnlyField + } + return "" +} + +func (x *SmallFieldBehaviorMessage) GetOptionalField() string { + if x != nil { + return x.OptionalField + } + return "" +} + +var File_einride_example_syntax_v1_fieldbehaviors_proto protoreflect.FileDescriptor + +var file_einride_example_syntax_v1_fieldbehaviors_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2f, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x19, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x0f, 0x0a, + 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2f, 0x0a, 0x11, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2a, 0x0a, 0x0e, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x74, 0x0a, 0x1e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x1b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x64, + 0x0a, 0x13, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x69, + 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, + 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x11, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x5f, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, + 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x5a, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x0f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x75, 0x0a, 0x1c, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, + 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, + 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x19, 0x72, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x70, 0x0a, 0x19, 0x72, 0x65, 0x70, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x69, + 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, + 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x60, 0x0a, 0x0b, 0x6d, 0x61, + 0x70, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x4d, 0x61, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0a, 0x6d, 0x61, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x85, 0x01, 0x0a, + 0x17, 0x6d, 0x61, 0x70, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, + 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x4d, 0x61, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x14, + 0x6d, 0x61, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x7e, 0x0a, 0x14, 0x6d, 0x61, 0x70, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x12, 0x6d, 0x61, 0x70, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x5d, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, + 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, + 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, + 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x16, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x77, 0x0a, + 0x1c, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, + 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x19, 0x73, 0x6d, 0x61, + 0x6c, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x6e, 0x0a, 0x0f, 0x4d, 0x61, 0x70, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x45, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x69, 0x6e, + 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, + 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, + 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x78, 0x0a, 0x19, 0x4d, 0x61, 0x70, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x45, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x76, 0x0a, 0x17, 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x45, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, + 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, + 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, + 0x8e, 0x01, 0x0a, 0x19, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x12, 0x2f, 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6f, 0x6e, + 0x6c, 0x79, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x6e, 0x6c, 0x79, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2a, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x42, 0xfd, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, + 0x76, 0x31, 0x42, 0x13, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, + 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x6f, 0x2e, 0x65, 0x69, + 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x61, 0x69, 0x70, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2f, + 0x76, 0x31, 0x3b, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x45, + 0x53, 0xaa, 0x02, 0x19, 0x45, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, + 0x45, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x5c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, + 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x45, 0x69, 0x6e, 0x72, + 0x69, 0x64, 0x65, 0x5c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x53, 0x79, 0x6e, 0x74, + 0x61, 0x78, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1c, 0x45, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x3a, 0x3a, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescOnce sync.Once + file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescData = file_einride_example_syntax_v1_fieldbehaviors_proto_rawDesc +) + +func file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescGZIP() []byte { + file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescOnce.Do(func() { + file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescData) + }) + return file_einride_example_syntax_v1_fieldbehaviors_proto_rawDescData +} + +var file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_einride_example_syntax_v1_fieldbehaviors_proto_goTypes = []interface{}{ + (*FieldBehaviorMessage)(nil), // 0: einride.example.syntax.v1.FieldBehaviorMessage + (*SmallFieldBehaviorMessage)(nil), // 1: einride.example.syntax.v1.SmallFieldBehaviorMessage + nil, // 2: einride.example.syntax.v1.FieldBehaviorMessage.MapMessageEntry + nil, // 3: einride.example.syntax.v1.FieldBehaviorMessage.MapOutputOnlyMessageEntry + nil, // 4: einride.example.syntax.v1.FieldBehaviorMessage.MapOptionalMessageEntry + nil, // 5: einride.example.syntax.v1.FieldBehaviorMessage.StringMapEntry +} +var file_einride_example_syntax_v1_fieldbehaviors_proto_depIdxs = []int32{ + 0, // 0: einride.example.syntax.v1.FieldBehaviorMessage.message_without_field_behavior:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 1: einride.example.syntax.v1.FieldBehaviorMessage.output_only_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 2: einride.example.syntax.v1.FieldBehaviorMessage.optional_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 3: einride.example.syntax.v1.FieldBehaviorMessage.repeated_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 4: einride.example.syntax.v1.FieldBehaviorMessage.repeated_output_only_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 5: einride.example.syntax.v1.FieldBehaviorMessage.repeated_optional_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 2, // 6: einride.example.syntax.v1.FieldBehaviorMessage.map_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage.MapMessageEntry + 3, // 7: einride.example.syntax.v1.FieldBehaviorMessage.map_output_only_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage.MapOutputOnlyMessageEntry + 4, // 8: einride.example.syntax.v1.FieldBehaviorMessage.map_optional_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage.MapOptionalMessageEntry + 5, // 9: einride.example.syntax.v1.FieldBehaviorMessage.string_map:type_name -> einride.example.syntax.v1.FieldBehaviorMessage.StringMapEntry + 0, // 10: einride.example.syntax.v1.FieldBehaviorMessage.field_behavior_message:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 1, // 11: einride.example.syntax.v1.FieldBehaviorMessage.small_field_behavior_message:type_name -> einride.example.syntax.v1.SmallFieldBehaviorMessage + 0, // 12: einride.example.syntax.v1.FieldBehaviorMessage.MapMessageEntry.value:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 13: einride.example.syntax.v1.FieldBehaviorMessage.MapOutputOnlyMessageEntry.value:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 0, // 14: einride.example.syntax.v1.FieldBehaviorMessage.MapOptionalMessageEntry.value:type_name -> einride.example.syntax.v1.FieldBehaviorMessage + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_einride_example_syntax_v1_fieldbehaviors_proto_init() } +func file_einride_example_syntax_v1_fieldbehaviors_proto_init() { + if File_einride_example_syntax_v1_fieldbehaviors_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldBehaviorMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SmallFieldBehaviorMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*FieldBehaviorMessage_FieldBehaviorMessage)(nil), + (*FieldBehaviorMessage_SmallFieldBehaviorMessage)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_einride_example_syntax_v1_fieldbehaviors_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_einride_example_syntax_v1_fieldbehaviors_proto_goTypes, + DependencyIndexes: file_einride_example_syntax_v1_fieldbehaviors_proto_depIdxs, + MessageInfos: file_einride_example_syntax_v1_fieldbehaviors_proto_msgTypes, + }.Build() + File_einride_example_syntax_v1_fieldbehaviors_proto = out.File + file_einride_example_syntax_v1_fieldbehaviors_proto_rawDesc = nil + file_einride_example_syntax_v1_fieldbehaviors_proto_goTypes = nil + file_einride_example_syntax_v1_fieldbehaviors_proto_depIdxs = nil +}