| 1 |
// Copyright 2024 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
// Code generated by protoc-gen-go. DO NOT EDIT. |
| 6 |
// source: cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.proto |
| 7 |
|
| 8 |
package protoeditions |
| 9 |
|
| 10 |
import ( |
| 11 |
protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| 12 |
protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 13 |
_ "google.golang.org/protobuf/types/gofeaturespb" |
| 14 |
reflect "reflect" |
| 15 |
sync "sync" |
| 16 |
unsafe "unsafe" |
| 17 |
) |
| 18 |
|
| 19 |
// EnumTypeWithLegacyUnmarshalJSON comment. |
| 20 |
type EnumTypeWithLegacyUnmarshalJSON int32 |
| 21 |
|
| 22 |
const ( |
| 23 |
// EnumTypeWithLegacyUnmarshalJSON_ONE comment. |
| 24 |
EnumTypeWithLegacyUnmarshalJSON_FIRST EnumTypeWithLegacyUnmarshalJSON = 1 |
| 25 |
// EnumTypeWithLegacyUnmarshalJSON_TWO comment. |
| 26 |
EnumTypeWithLegacyUnmarshalJSON_SECOND EnumTypeWithLegacyUnmarshalJSON = 2 |
| 27 |
) |
| 28 |
|
| 29 |
// Enum value maps for EnumTypeWithLegacyUnmarshalJSON. |
| 30 |
var ( |
| 31 |
EnumTypeWithLegacyUnmarshalJSON_name = map[int32]string{ |
| 32 |
1: "FIRST", |
| 33 |
2: "SECOND", |
| 34 |
} |
| 35 |
EnumTypeWithLegacyUnmarshalJSON_value = map[string]int32{ |
| 36 |
"FIRST": 1, |
| 37 |
"SECOND": 2, |
| 38 |
} |
| 39 |
) |
| 40 |
|
| 41 |
func (x EnumTypeWithLegacyUnmarshalJSON) Enum() *EnumTypeWithLegacyUnmarshalJSON { |
| 42 |
p := new(EnumTypeWithLegacyUnmarshalJSON) |
| 43 |
*p = x |
| 44 |
return p |
| 45 |
} |
| 46 |
|
| 47 |
func (x EnumTypeWithLegacyUnmarshalJSON) String() string { |
| 48 |
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
| 49 |
} |
| 50 |
|
| 51 |
func (EnumTypeWithLegacyUnmarshalJSON) Descriptor() protoreflect.EnumDescriptor { |
| 52 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes[0].Descriptor() |
| 53 |
} |
| 54 |
|
| 55 |
func (EnumTypeWithLegacyUnmarshalJSON) Type() protoreflect.EnumType { |
| 56 |
return &file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes[0] |
| 57 |
} |
| 58 |
|
| 59 |
func (x EnumTypeWithLegacyUnmarshalJSON) Number() protoreflect.EnumNumber { |
| 60 |
return protoreflect.EnumNumber(x) |
| 61 |
} |
| 62 |
|
| 63 |
// Deprecated: Do not use. |
| 64 |
func (x *EnumTypeWithLegacyUnmarshalJSON) UnmarshalJSON(b []byte) error { |
| 65 |
num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) |
| 66 |
if err != nil { |
| 67 |
return err |
| 68 |
} |
| 69 |
*x = EnumTypeWithLegacyUnmarshalJSON(num) |
| 70 |
return nil |
| 71 |
} |
| 72 |
|
| 73 |
// Deprecated: Use EnumTypeWithLegacyUnmarshalJSON.Descriptor instead. |
| 74 |
func (EnumTypeWithLegacyUnmarshalJSON) EnumDescriptor() ([]byte, []int) { |
| 75 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescGZIP(), []int{0} |
| 76 |
} |
| 77 |
|
| 78 |
type EnumWithoutUnmarshalJSON int32 |
| 79 |
|
| 80 |
const ( |
| 81 |
EnumWithoutUnmarshalJSON_WITHOUT_UNMARSHAL_JSON_FOO EnumWithoutUnmarshalJSON = 0 |
| 82 |
EnumWithoutUnmarshalJSON_WITHOUT_UNMARSHAL_JSON_BAR EnumWithoutUnmarshalJSON = 1 |
| 83 |
EnumWithoutUnmarshalJSON_WITHOUT_UNMARSHAL_JSON_BAZ EnumWithoutUnmarshalJSON = 2 |
| 84 |
) |
| 85 |
|
| 86 |
// Enum value maps for EnumWithoutUnmarshalJSON. |
| 87 |
var ( |
| 88 |
EnumWithoutUnmarshalJSON_name = map[int32]string{ |
| 89 |
0: "WITHOUT_UNMARSHAL_JSON_FOO", |
| 90 |
1: "WITHOUT_UNMARSHAL_JSON_BAR", |
| 91 |
2: "WITHOUT_UNMARSHAL_JSON_BAZ", |
| 92 |
} |
| 93 |
EnumWithoutUnmarshalJSON_value = map[string]int32{ |
| 94 |
"WITHOUT_UNMARSHAL_JSON_FOO": 0, |
| 95 |
"WITHOUT_UNMARSHAL_JSON_BAR": 1, |
| 96 |
"WITHOUT_UNMARSHAL_JSON_BAZ": 2, |
| 97 |
} |
| 98 |
) |
| 99 |
|
| 100 |
func (x EnumWithoutUnmarshalJSON) Enum() *EnumWithoutUnmarshalJSON { |
| 101 |
p := new(EnumWithoutUnmarshalJSON) |
| 102 |
*p = x |
| 103 |
return p |
| 104 |
} |
| 105 |
|
| 106 |
func (x EnumWithoutUnmarshalJSON) String() string { |
| 107 |
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
| 108 |
} |
| 109 |
|
| 110 |
func (EnumWithoutUnmarshalJSON) Descriptor() protoreflect.EnumDescriptor { |
| 111 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes[1].Descriptor() |
| 112 |
} |
| 113 |
|
| 114 |
func (EnumWithoutUnmarshalJSON) Type() protoreflect.EnumType { |
| 115 |
return &file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes[1] |
| 116 |
} |
| 117 |
|
| 118 |
func (x EnumWithoutUnmarshalJSON) Number() protoreflect.EnumNumber { |
| 119 |
return protoreflect.EnumNumber(x) |
| 120 |
} |
| 121 |
|
| 122 |
// Deprecated: Use EnumWithoutUnmarshalJSON.Descriptor instead. |
| 123 |
func (EnumWithoutUnmarshalJSON) EnumDescriptor() ([]byte, []int) { |
| 124 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescGZIP(), []int{1} |
| 125 |
} |
| 126 |
|
| 127 |
// NestedEnumType1A comment. |
| 128 |
type ContainerForNestedEnum_NestedEnum int32 |
| 129 |
|
| 130 |
const ( |
| 131 |
// NestedEnum_VALUE comment. |
| 132 |
ContainerForNestedEnum_VALUE ContainerForNestedEnum_NestedEnum = 0 |
| 133 |
) |
| 134 |
|
| 135 |
// Enum value maps for ContainerForNestedEnum_NestedEnum. |
| 136 |
var ( |
| 137 |
ContainerForNestedEnum_NestedEnum_name = map[int32]string{ |
| 138 |
0: "VALUE", |
| 139 |
} |
| 140 |
ContainerForNestedEnum_NestedEnum_value = map[string]int32{ |
| 141 |
"VALUE": 0, |
| 142 |
} |
| 143 |
) |
| 144 |
|
| 145 |
func (x ContainerForNestedEnum_NestedEnum) Enum() *ContainerForNestedEnum_NestedEnum { |
| 146 |
p := new(ContainerForNestedEnum_NestedEnum) |
| 147 |
*p = x |
| 148 |
return p |
| 149 |
} |
| 150 |
|
| 151 |
func (x ContainerForNestedEnum_NestedEnum) String() string { |
| 152 |
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
| 153 |
} |
| 154 |
|
| 155 |
func (ContainerForNestedEnum_NestedEnum) Descriptor() protoreflect.EnumDescriptor { |
| 156 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes[2].Descriptor() |
| 157 |
} |
| 158 |
|
| 159 |
func (ContainerForNestedEnum_NestedEnum) Type() protoreflect.EnumType { |
| 160 |
return &file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes[2] |
| 161 |
} |
| 162 |
|
| 163 |
func (x ContainerForNestedEnum_NestedEnum) Number() protoreflect.EnumNumber { |
| 164 |
return protoreflect.EnumNumber(x) |
| 165 |
} |
| 166 |
|
| 167 |
// Deprecated: Do not use. |
| 168 |
func (x *ContainerForNestedEnum_NestedEnum) UnmarshalJSON(b []byte) error { |
| 169 |
num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) |
| 170 |
if err != nil { |
| 171 |
return err |
| 172 |
} |
| 173 |
*x = ContainerForNestedEnum_NestedEnum(num) |
| 174 |
return nil |
| 175 |
} |
| 176 |
|
| 177 |
// Deprecated: Use ContainerForNestedEnum_NestedEnum.Descriptor instead. |
| 178 |
func (ContainerForNestedEnum_NestedEnum) EnumDescriptor() ([]byte, []int) { |
| 179 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescGZIP(), []int{0, 0} |
| 180 |
} |
| 181 |
|
| 182 |
type ContainerForNestedEnum struct { |
| 183 |
state protoimpl.MessageState `protogen:"open.v1"` |
| 184 |
unknownFields protoimpl.UnknownFields |
| 185 |
sizeCache protoimpl.SizeCache |
| 186 |
} |
| 187 |
|
| 188 |
func (x *ContainerForNestedEnum) Reset() { |
| 189 |
*x = ContainerForNestedEnum{} |
| 190 |
mi := &file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_msgTypes[0] |
| 191 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 192 |
ms.StoreMessageInfo(mi) |
| 193 |
} |
| 194 |
|
| 195 |
func (x *ContainerForNestedEnum) String() string { |
| 196 |
return protoimpl.X.MessageStringOf(x) |
| 197 |
} |
| 198 |
|
| 199 |
func (*ContainerForNestedEnum) ProtoMessage() {} |
| 200 |
|
| 201 |
func (x *ContainerForNestedEnum) ProtoReflect() protoreflect.Message { |
| 202 |
mi := &file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_msgTypes[0] |
| 203 |
if x != nil { |
| 204 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 205 |
if ms.LoadMessageInfo() == nil { |
| 206 |
ms.StoreMessageInfo(mi) |
| 207 |
} |
| 208 |
return ms |
| 209 |
} |
| 210 |
return mi.MessageOf(x) |
| 211 |
} |
| 212 |
|
| 213 |
// Deprecated: Use ContainerForNestedEnum.ProtoReflect.Descriptor instead. |
| 214 |
func (*ContainerForNestedEnum) Descriptor() ([]byte, []int) { |
| 215 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescGZIP(), []int{0} |
| 216 |
} |
| 217 |
|
| 218 |
var File_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto protoreflect.FileDescriptor |
| 219 |
|
| 220 |
const file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDesc = "" + |
| 221 |
"\n" + |
| 222 |
":cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.proto\x12\x1cgoproto.protoc.protoeditions\x1a!google/protobuf/go_features.proto\"1\n" + |
| 223 |
"\x16ContainerForNestedEnum\"\x17\n" + |
| 224 |
"\n" + |
| 225 |
"NestedEnum\x12\t\n" + |
| 226 |
"\x05VALUE\x10\x00*>\n" + |
| 227 |
"\x1fEnumTypeWithLegacyUnmarshalJSON\x12\t\n" + |
| 228 |
"\x05FIRST\x10\x01\x12\n" + |
| 229 |
"\n" + |
| 230 |
"\x06SECOND\x10\x02\x1a\x04:\x02\x10\x02*\x83\x01\n" + |
| 231 |
"\x18EnumWithoutUnmarshalJSON\x12\x1e\n" + |
| 232 |
"\x1aWITHOUT_UNMARSHAL_JSON_FOO\x10\x00\x12\x1e\n" + |
| 233 |
"\x1aWITHOUT_UNMARSHAL_JSON_BAR\x10\x01\x12\x1e\n" + |
| 234 |
"\x1aWITHOUT_UNMARSHAL_JSON_BAZ\x10\x02\x1a\a:\x05\xd2>\x02\b\x00BMZCgoogle.golang.org/protobuf/cmd/protoc-gen-go/testdata/protoeditions\x92\x03\x05\xd2>\x02\b\x01b\beditionsp\xe8\a" |
| 235 |
|
| 236 |
var ( |
| 237 |
file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescOnce sync.Once |
| 238 |
file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescData []byte |
| 239 |
) |
| 240 |
|
| 241 |
func file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescGZIP() []byte { |
| 242 |
file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescOnce.Do(func() { |
| 243 |
file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDesc), len(file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDesc))) |
| 244 |
}) |
| 245 |
return file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDescData |
| 246 |
} |
| 247 |
|
| 248 |
var file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes = make([]protoimpl.EnumInfo, 3) |
| 249 |
var file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_msgTypes = make([]protoimpl.MessageInfo, 1) |
| 250 |
var file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_goTypes = []any{ |
| 251 |
(EnumTypeWithLegacyUnmarshalJSON)(0), // 0: goproto.protoc.protoeditions.EnumTypeWithLegacyUnmarshalJSON |
| 252 |
(EnumWithoutUnmarshalJSON)(0), // 1: goproto.protoc.protoeditions.EnumWithoutUnmarshalJSON |
| 253 |
(ContainerForNestedEnum_NestedEnum)(0), // 2: goproto.protoc.protoeditions.ContainerForNestedEnum.NestedEnum |
| 254 |
(*ContainerForNestedEnum)(nil), // 3: goproto.protoc.protoeditions.ContainerForNestedEnum |
| 255 |
} |
| 256 |
var file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_depIdxs = []int32{ |
| 257 |
0, // [0:0] is the sub-list for method output_type |
| 258 |
0, // [0:0] is the sub-list for method input_type |
| 259 |
0, // [0:0] is the sub-list for extension type_name |
| 260 |
0, // [0:0] is the sub-list for extension extendee |
| 261 |
0, // [0:0] is the sub-list for field type_name |
| 262 |
} |
| 263 |
|
| 264 |
func init() { file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_init() } |
| 265 |
func file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_init() { |
| 266 |
if File_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto != nil { |
| 267 |
return |
| 268 |
} |
| 269 |
type x struct{} |
| 270 |
out := protoimpl.TypeBuilder{ |
| 271 |
File: protoimpl.DescBuilder{ |
| 272 |
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| 273 |
RawDescriptor: unsafe.Slice(unsafe.StringData(file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDesc), len(file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_rawDesc)), |
| 274 |
NumEnums: 3, |
| 275 |
NumMessages: 1, |
| 276 |
NumExtensions: 0, |
| 277 |
NumServices: 0, |
| 278 |
}, |
| 279 |
GoTypes: file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_goTypes, |
| 280 |
DependencyIndexes: file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_depIdxs, |
| 281 |
EnumInfos: file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_enumTypes, |
| 282 |
MessageInfos: file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_msgTypes, |
| 283 |
}.Build() |
| 284 |
File_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto = out.File |
| 285 |
file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_goTypes = nil |
| 286 |
file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_depIdxs = nil |
| 287 |
} |