diff --git a/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.go b/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.go index b40bf7d05eb..10aecccbd45 100644 --- a/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.go +++ b/examples/internal/proto/examplepb/visibility_rule_echo_service.pb.go @@ -33,6 +33,52 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// EnumInPreviewMethod doesn't define its own visibility restrictions, +// but is only included in a method marked as "PREVIEW", so it will only +// appear if `visibility_restriction_selectors` include "PREVIEW". +type VisibilityRuleEnumInPreviewMethod int32 + +const ( + VisibilityRuleEnumInPreviewMethod_VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED VisibilityRuleEnumInPreviewMethod = 0 +) + +// Enum value maps for VisibilityRuleEnumInPreviewMethod. +var ( + VisibilityRuleEnumInPreviewMethod_name = map[int32]string{ + 0: "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED", + } + VisibilityRuleEnumInPreviewMethod_value = map[string]int32{ + "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED": 0, + } +) + +func (x VisibilityRuleEnumInPreviewMethod) Enum() *VisibilityRuleEnumInPreviewMethod { + p := new(VisibilityRuleEnumInPreviewMethod) + *p = x + return p +} + +func (x VisibilityRuleEnumInPreviewMethod) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VisibilityRuleEnumInPreviewMethod) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes[0].Descriptor() +} + +func (VisibilityRuleEnumInPreviewMethod) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes[0] +} + +func (x VisibilityRuleEnumInPreviewMethod) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use VisibilityRuleEnumInPreviewMethod.Descriptor instead. +func (VisibilityRuleEnumInPreviewMethod) EnumDescriptor() ([]byte, []int) { + return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescGZIP(), []int{0} +} + type VisibilityRuleSimpleMessage_VisibilityEnum int32 const ( @@ -69,11 +115,11 @@ func (x VisibilityRuleSimpleMessage_VisibilityEnum) String() string { } func (VisibilityRuleSimpleMessage_VisibilityEnum) Descriptor() protoreflect.EnumDescriptor { - return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes[0].Descriptor() + return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes[1].Descriptor() } func (VisibilityRuleSimpleMessage_VisibilityEnum) Type() protoreflect.EnumType { - return &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes[0] + return &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes[1] } func (x VisibilityRuleSimpleMessage_VisibilityEnum) Number() protoreflect.EnumNumber { @@ -365,6 +411,122 @@ func (*VisibilityRuleSimpleMessage_En) isVisibilityRuleSimpleMessage_Ext() {} func (*VisibilityRuleSimpleMessage_No) isVisibilityRuleSimpleMessage_Ext() {} +// MessageInPreviewMethod doesn't define its own visibility restrictions, +// but is only included in a method marked as "PREVIEW", so it will only +// appear if `visibility_restriction_selectors` include "PREVIEW". +type VisibilityRuleMessageInPreviewMethod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + SubMessage *VisibilityRuleSubMessageInPreviewMethod `protobuf:"bytes,2,opt,name=sub_message,json=subMessage,proto3" json:"sub_message,omitempty"` + Enum VisibilityRuleEnumInPreviewMethod `protobuf:"varint,3,opt,name=enum,proto3,enum=grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEnumInPreviewMethod" json:"enum,omitempty"` +} + +func (x *VisibilityRuleMessageInPreviewMethod) Reset() { + *x = VisibilityRuleMessageInPreviewMethod{} + if protoimpl.UnsafeEnabled { + mi := &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisibilityRuleMessageInPreviewMethod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisibilityRuleMessageInPreviewMethod) ProtoMessage() {} + +func (x *VisibilityRuleMessageInPreviewMethod) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[2] + 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 VisibilityRuleMessageInPreviewMethod.ProtoReflect.Descriptor instead. +func (*VisibilityRuleMessageInPreviewMethod) Descriptor() ([]byte, []int) { + return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescGZIP(), []int{2} +} + +func (x *VisibilityRuleMessageInPreviewMethod) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *VisibilityRuleMessageInPreviewMethod) GetSubMessage() *VisibilityRuleSubMessageInPreviewMethod { + if x != nil { + return x.SubMessage + } + return nil +} + +func (x *VisibilityRuleMessageInPreviewMethod) GetEnum() VisibilityRuleEnumInPreviewMethod { + if x != nil { + return x.Enum + } + return VisibilityRuleEnumInPreviewMethod_VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED +} + +// SubMessageInPreviewMethod doesn't define its own visibility restrictions, +// but is only included in a method marked as "PREVIEW", so it will only +// appear if `visibility_restriction_selectors` include "PREVIEW". +type VisibilityRuleSubMessageInPreviewMethod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *VisibilityRuleSubMessageInPreviewMethod) Reset() { + *x = VisibilityRuleSubMessageInPreviewMethod{} + if protoimpl.UnsafeEnabled { + mi := &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisibilityRuleSubMessageInPreviewMethod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisibilityRuleSubMessageInPreviewMethod) ProtoMessage() {} + +func (x *VisibilityRuleSubMessageInPreviewMethod) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[3] + 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 VisibilityRuleSubMessageInPreviewMethod.ProtoReflect.Descriptor instead. +func (*VisibilityRuleSubMessageInPreviewMethod) Descriptor() ([]byte, []int) { + return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescGZIP(), []int{3} +} + +func (x *VisibilityRuleSubMessageInPreviewMethod) GetId() string { + if x != nil { + return x.Id + } + return "" +} + var File_examples_internal_proto_examplepb_visibility_rule_echo_service_proto protoreflect.FileDescriptor var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDesc = []byte{ @@ -439,87 +601,114 @@ var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_ra 0x59, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x03, 0x1a, 0x18, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x2c, 0x50, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x42, 0x06, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x65, 0x78, 0x74, 0x32, 0x92, 0x07, 0x0a, 0x19, 0x56, 0x69, - 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x63, 0x68, 0x6f, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xbf, 0x01, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, - 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, - 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, - 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x17, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, - 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xdb, 0x01, 0x0a, 0x0c, 0x45, 0x63, - 0x68, 0x6f, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x76, - 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, - 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0xd8, 0x01, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, - 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x64, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x65, 0x78, 0x74, 0x22, 0x97, 0x02, 0x0a, 0x24, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x78, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x57, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x70, 0x72, 0x65, 0x76, - 0x69, 0x65, 0x77, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x50, 0x52, 0x45, 0x56, 0x49, - 0x45, 0x57, 0x12, 0xf9, 0x01, 0x0a, 0x16, 0x45, 0x63, 0x68, 0x6f, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x4b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, - 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, - 0x6f, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x49, 0x4e, - 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x2c, 0x50, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x32, 0x80, - 0x02, 0x0a, 0x21, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, - 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0xc8, 0x01, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x4b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, + 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x49, 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x52, 0x0a, 0x73, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x65, 0x0a, 0x04, + 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x51, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, - 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x1a, - 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, - 0x4c, 0x42, 0x57, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, - 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x49, 0x6e, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x22, 0x39, 0x0a, 0x27, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, + 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x2a, 0x5b, + 0x0a, 0x21, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, + 0x45, 0x6e, 0x75, 0x6d, 0x49, 0x6e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x12, 0x36, 0x0a, 0x32, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, + 0x59, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x49, 0x4e, 0x5f, 0x50, + 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x32, 0x9b, 0x07, 0x0a, 0x19, + 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x63, + 0x68, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xbf, 0x01, 0x0a, 0x04, 0x45, 0x63, + 0x68, 0x6f, 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, + 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, + 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x1d, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x17, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xdb, 0x01, 0x0a, 0x0c, + 0x45, 0x63, 0x68, 0x6f, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x4b, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, + 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, + 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, + 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0xe1, 0x01, 0x0a, 0x0b, 0x45, 0x63, + 0x68, 0x6f, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x54, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x50, + 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x2f, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0xfa, 0xd2, + 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x50, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x12, 0xf9, 0x01, + 0x0a, 0x16, 0x45, 0x63, 0x68, 0x6f, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x6e, + 0x64, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, + 0x77, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, + 0x4c, 0x2c, 0x50, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x32, 0x80, 0x02, 0x0a, 0x21, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0xc8, 0x01, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x4b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, + 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0x57, 0x5a, 0x55, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, + 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x3b, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -534,32 +723,37 @@ func file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_r return file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDescData } -var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_goTypes = []interface{}{ - (VisibilityRuleSimpleMessage_VisibilityEnum)(0), // 0: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.VisibilityEnum - (*VisibilityRuleEmbedded)(nil), // 1: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEmbedded - (*VisibilityRuleSimpleMessage)(nil), // 2: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + (VisibilityRuleEnumInPreviewMethod)(0), // 0: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEnumInPreviewMethod + (VisibilityRuleSimpleMessage_VisibilityEnum)(0), // 1: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.VisibilityEnum + (*VisibilityRuleEmbedded)(nil), // 2: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEmbedded + (*VisibilityRuleSimpleMessage)(nil), // 3: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + (*VisibilityRuleMessageInPreviewMethod)(nil), // 4: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleMessageInPreviewMethod + (*VisibilityRuleSubMessageInPreviewMethod)(nil), // 5: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSubMessageInPreviewMethod } var file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_depIdxs = []int32{ - 1, // 0: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.status:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEmbedded - 1, // 1: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.no:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEmbedded - 0, // 2: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.an_enum:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.VisibilityEnum - 2, // 3: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.Echo:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 4: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternal:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 5: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoPreview:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 6: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternalAndPreview:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 7: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService.Echo:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 8: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.Echo:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 9: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternal:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 10: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoPreview:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 11: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternalAndPreview:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 2, // 12: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService.Echo:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage - 8, // [8:13] is the sub-list for method output_type - 3, // [3:8] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 2, // 0: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.status:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEmbedded + 2, // 1: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.no:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEmbedded + 1, // 2: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.an_enum:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage.VisibilityEnum + 5, // 3: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleMessageInPreviewMethod.sub_message:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSubMessageInPreviewMethod + 0, // 4: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleMessageInPreviewMethod.enum:type_name -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEnumInPreviewMethod + 3, // 5: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.Echo:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 6: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternal:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 7: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoPreview:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 8: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternalAndPreview:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 9: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService.Echo:input_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 10: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.Echo:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 11: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternal:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 4, // 12: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoPreview:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleMessageInPreviewMethod + 3, // 13: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService.EchoInternalAndPreview:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 3, // 14: grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleInternalEchoService.Echo:output_type -> grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleSimpleMessage + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_init() } @@ -592,6 +786,30 @@ func file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_i return nil } } + file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisibilityRuleMessageInPreviewMethod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisibilityRuleSubMessageInPreviewMethod); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_msgTypes[0].OneofWrappers = []interface{}{ (*VisibilityRuleEmbedded_Progress)(nil), @@ -610,8 +828,8 @@ func file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_i File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_examples_internal_proto_examplepb_visibility_rule_echo_service_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, + NumEnums: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 2, }, diff --git a/examples/internal/proto/examplepb/visibility_rule_echo_service.proto b/examples/internal/proto/examplepb/visibility_rule_echo_service.proto index 7aa78470b88..06fb642d952 100644 --- a/examples/internal/proto/examplepb/visibility_rule_echo_service.proto +++ b/examples/internal/proto/examplepb/visibility_rule_echo_service.proto @@ -53,6 +53,29 @@ message VisibilityRuleSimpleMessage { VisibilityEnum an_enum = 10; } +// MessageInPreviewMethod doesn't define its own visibility restrictions, +// but is only included in a method marked as "PREVIEW", so it will only +// appear if `visibility_restriction_selectors` include "PREVIEW". +message VisibilityRuleMessageInPreviewMethod { + string id = 1; + VisibilityRuleSubMessageInPreviewMethod sub_message = 2; + VisibilityRuleEnumInPreviewMethod enum = 3; +} + +// SubMessageInPreviewMethod doesn't define its own visibility restrictions, +// but is only included in a method marked as "PREVIEW", so it will only +// appear if `visibility_restriction_selectors` include "PREVIEW". +message VisibilityRuleSubMessageInPreviewMethod { + string id = 1; +} + +// EnumInPreviewMethod doesn't define its own visibility restrictions, +// but is only included in a method marked as "PREVIEW", so it will only +// appear if `visibility_restriction_selectors` include "PREVIEW". +enum VisibilityRuleEnumInPreviewMethod { + VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED = 0; +} + // VisibilityRuleEchoService service responds to incoming echo requests. // Different services will be available in the swagger documentation depending // based on `google.api.VisibilityRule`s and the set `visibility_restriction_selectors` @@ -75,7 +98,7 @@ service VisibilityRuleEchoService { } // EchoPreview is a preview API that should only be visible in the OpenAPI spec // if `visibility_restriction_selectors` includes "PREVIEW". - rpc EchoPreview(VisibilityRuleSimpleMessage) returns (VisibilityRuleSimpleMessage) { + rpc EchoPreview(VisibilityRuleSimpleMessage) returns (VisibilityRuleMessageInPreviewMethod) { option (google.api.method_visibility).restriction = "PREVIEW"; option (google.api.http) = { get: "/v1/example/echo_preview" diff --git a/examples/internal/proto/examplepb/visibility_rule_echo_service_grpc.pb.go b/examples/internal/proto/examplepb/visibility_rule_echo_service_grpc.pb.go index a7e90ea15da..09d89c532e3 100644 --- a/examples/internal/proto/examplepb/visibility_rule_echo_service_grpc.pb.go +++ b/examples/internal/proto/examplepb/visibility_rule_echo_service_grpc.pb.go @@ -26,7 +26,7 @@ type VisibilityRuleEchoServiceClient interface { EchoInternal(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) // EchoPreview is a preview API that should only be visible in the OpenAPI spec // if `visibility_restriction_selectors` includes "PREVIEW". - EchoPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) + EchoPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleMessageInPreviewMethod, error) // EchoInternalAndPreview is a internal and preview API that should only be visible in the OpenAPI spec // if `visibility_restriction_selectors` includes "PREVIEW" or "INTERNAL". EchoInternalAndPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) @@ -58,8 +58,8 @@ func (c *visibilityRuleEchoServiceClient) EchoInternal(ctx context.Context, in * return out, nil } -func (c *visibilityRuleEchoServiceClient) EchoPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleSimpleMessage, error) { - out := new(VisibilityRuleSimpleMessage) +func (c *visibilityRuleEchoServiceClient) EchoPreview(ctx context.Context, in *VisibilityRuleSimpleMessage, opts ...grpc.CallOption) (*VisibilityRuleMessageInPreviewMethod, error) { + out := new(VisibilityRuleMessageInPreviewMethod) err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.VisibilityRuleEchoService/EchoPreview", in, out, opts...) if err != nil { return nil, err @@ -88,7 +88,7 @@ type VisibilityRuleEchoServiceServer interface { EchoInternal(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) // EchoPreview is a preview API that should only be visible in the OpenAPI spec // if `visibility_restriction_selectors` includes "PREVIEW". - EchoPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) + EchoPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleMessageInPreviewMethod, error) // EchoInternalAndPreview is a internal and preview API that should only be visible in the OpenAPI spec // if `visibility_restriction_selectors` includes "PREVIEW" or "INTERNAL". EchoInternalAndPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) @@ -104,7 +104,7 @@ func (UnimplementedVisibilityRuleEchoServiceServer) Echo(context.Context, *Visib func (UnimplementedVisibilityRuleEchoServiceServer) EchoInternal(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) { return nil, status.Errorf(codes.Unimplemented, "method EchoInternal not implemented") } -func (UnimplementedVisibilityRuleEchoServiceServer) EchoPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) { +func (UnimplementedVisibilityRuleEchoServiceServer) EchoPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleMessageInPreviewMethod, error) { return nil, status.Errorf(codes.Unimplemented, "method EchoPreview not implemented") } func (UnimplementedVisibilityRuleEchoServiceServer) EchoInternalAndPreview(context.Context, *VisibilityRuleSimpleMessage) (*VisibilityRuleSimpleMessage, error) { diff --git a/examples/internal/proto/examplepb/visibility_rule_preview_and_internal_echo_service.swagger.json b/examples/internal/proto/examplepb/visibility_rule_preview_and_internal_echo_service.swagger.json index 94f44fdfb9b..adac8e77ee8 100644 --- a/examples/internal/proto/examplepb/visibility_rule_preview_and_internal_echo_service.swagger.json +++ b/examples/internal/proto/examplepb/visibility_rule_preview_and_internal_echo_service.swagger.json @@ -430,7 +430,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage" + "$ref": "#/definitions/examplepbVisibilityRuleMessageInPreviewMethod" } }, "default": { @@ -721,6 +721,29 @@ }, "description": "Embedded represents a message embedded in SimpleMessage." }, + "examplepbVisibilityRuleEnumInPreviewMethod": { + "type": "string", + "enum": [ + "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED" + ], + "default": "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED", + "description": "EnumInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." + }, + "examplepbVisibilityRuleMessageInPreviewMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "subMessage": { + "$ref": "#/definitions/examplepbVisibilityRuleSubMessageInPreviewMethod" + }, + "enum": { + "$ref": "#/definitions/examplepbVisibilityRuleEnumInPreviewMethod" + } + }, + "description": "MessageInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." + }, "examplepbVisibilityRuleSimpleMessage": { "type": "object", "properties": { @@ -761,6 +784,15 @@ }, "description": "SimpleMessage represents a simple message sent to the Echo service." }, + "examplepbVisibilityRuleSubMessageInPreviewMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "description": "SubMessageInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." + }, "protobufAny": { "type": "object", "properties": { diff --git a/examples/internal/proto/examplepb/visibility_rule_preview_echo_service.swagger.json b/examples/internal/proto/examplepb/visibility_rule_preview_echo_service.swagger.json index 1f977554d69..c3ae74b42e1 100644 --- a/examples/internal/proto/examplepb/visibility_rule_preview_echo_service.swagger.json +++ b/examples/internal/proto/examplepb/visibility_rule_preview_echo_service.swagger.json @@ -255,7 +255,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/examplepbVisibilityRuleSimpleMessage" + "$ref": "#/definitions/examplepbVisibilityRuleMessageInPreviewMethod" } }, "default": { @@ -389,6 +389,29 @@ }, "description": "Embedded represents a message embedded in SimpleMessage." }, + "examplepbVisibilityRuleEnumInPreviewMethod": { + "type": "string", + "enum": [ + "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED" + ], + "default": "VISIBILITY_RULE_ENUM_IN_PREVIEW_METHOD_UNSPECIFIED", + "description": "EnumInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." + }, + "examplepbVisibilityRuleMessageInPreviewMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "subMessage": { + "$ref": "#/definitions/examplepbVisibilityRuleSubMessageInPreviewMethod" + }, + "enum": { + "$ref": "#/definitions/examplepbVisibilityRuleEnumInPreviewMethod" + } + }, + "description": "MessageInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." + }, "examplepbVisibilityRuleSimpleMessage": { "type": "object", "properties": { @@ -426,6 +449,15 @@ }, "description": "SimpleMessage represents a simple message sent to the Echo service." }, + "examplepbVisibilityRuleSubMessageInPreviewMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "description": "SubMessageInPreviewMethod doesn't define its own visibility restrictions,\nbut is only included in a method marked as \"PREVIEW\", so it will only\nappear if `visibility_restriction_selectors` include \"PREVIEW\"." + }, "protobufAny": { "type": "object", "properties": { diff --git a/protoc-gen-openapiv2/internal/genopenapi/template.go b/protoc-gen-openapiv2/internal/genopenapi/template.go index fc4cf85fab7..3412be362db 100644 --- a/protoc-gen-openapiv2/internal/genopenapi/template.go +++ b/protoc-gen-openapiv2/internal/genopenapi/template.go @@ -367,6 +367,10 @@ func findServicesMessagesAndEnumerations(s []*descriptor.Service, reg *descripto for _, meth := range svc.Methods { // Request may be fully included in query { + if !isVisible(getMethodVisibilityOption(meth), reg) { + continue + } + swgReqName, ok := fullyQualifiedNameToOpenAPIName(meth.RequestType.FQMN(), reg) if !ok { glog.Errorf("couldn't resolve OpenAPI name for FQMN '%v'", meth.RequestType.FQMN())