cmd/protoc-gen-go: rely on protoimpl for basic helpers

The EnumName, UnmarshalJSONEnum, and CompressGZIP helpers currently live
in v1 protoapi, which would cause all generated messages to depend on v1.
In an effort to break the dependency of v2 on v1, we move these helper
functions to v2 (and re-written to take advantage of protobuf reflection).

These helpers are unfortunate, but we cannot eliminate the functionality
that they implement since they are exposed in the publicly generated API.

Since EnumName does not rely on the enum maps, it removes another dependency
on those variables. Eventually, we can get to the point where these variables
(though declared) are not linked into the binary if the user does not use them.

Also, we rely on the v1 proto package for registration instead of v1 protoapi.
This may re-introduce a cyclic dependency on descriptor proto again in the
future, but the better approach is to just start registering with v2.

Change-Id: Id755585a7a1df14e4a6a2dfa650df221a3c153fb
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/167921
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/cmd/protoc-gen-go-grpc/testdata/grpc/deprecation.pb.go b/cmd/protoc-gen-go-grpc/testdata/grpc/deprecation.pb.go
index 705f327..876f17e 100644
--- a/cmd/protoc-gen-go-grpc/testdata/grpc/deprecation.pb.go
+++ b/cmd/protoc-gen-go-grpc/testdata/grpc/deprecation.pb.go
@@ -5,17 +5,10 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 func init() {
 	proto.RegisterFile("grpc/deprecation.proto", xxx_File_grpc_deprecation_proto_rawdesc_gzipped)
 }
@@ -40,7 +33,7 @@
 	0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_grpc_deprecation_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_grpc_deprecation_proto_rawdesc)
+var xxx_File_grpc_deprecation_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_grpc_deprecation_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go b/cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go
index e5e6f7a..4b45691 100644
--- a/cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go
+++ b/cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Request struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *Request) Reset()         { *m = Request{} }
 func (m *Request) String() string { return proto.CompactTextString(m) }
 func (*Request) ProtoMessage()    {}
+
+// Deprecated: Use Request.ProtoReflect.Type instead.
 func (*Request) Descriptor() ([]byte, []int) {
 	return xxx_File_grpc_grpc_proto_rawdesc_gzipped, []int{0}
 }
@@ -63,6 +58,8 @@
 func (m *Response) Reset()         { *m = Response{} }
 func (m *Response) String() string { return proto.CompactTextString(m) }
 func (*Response) ProtoMessage()    {}
+
+// Deprecated: Use Response.ProtoReflect.Type instead.
 func (*Response) Descriptor() ([]byte, []int) {
 	return xxx_File_grpc_grpc_proto_rawdesc_gzipped, []int{1}
 }
@@ -125,7 +122,7 @@
 	0x6f, 0x33,
 }
 
-var xxx_File_grpc_grpc_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_grpc_grpc_proto_rawdesc)
+var xxx_File_grpc_grpc_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_grpc_grpc_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go
index f05ca80..f204853 100644
--- a/cmd/protoc-gen-go/internal_gengo/main.go
+++ b/cmd/protoc-gen-go/internal_gengo/main.go
@@ -26,12 +26,6 @@
 	descriptorpb "github.com/golang/protobuf/v2/types/descriptor"
 )
 
-// generatedCodeVersion indicates a version of the generated code.
-// It is incremented whenever an incompatibility between the generated code and
-// proto package is introduced; the generated code references
-// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).
-const generatedCodeVersion = 3
-
 const (
 	mathPackage     = protogen.GoImportPath("math")
 	protoPackage    = protogen.GoImportPath("github.com/golang/protobuf/proto")
@@ -127,16 +121,6 @@
 	g.P("package ", f.GoPackageName)
 	g.P()
 
-	if !isDescriptor(file) {
-		g.P("// This is a compile-time assertion to ensure that this generated file")
-		g.P("// is compatible with the proto package it is being compiled against.")
-		g.P("// A compilation error at this line likely means your copy of the")
-		g.P("// proto package needs to be updated.")
-		g.P("const _ = ", protoPackage.Ident(fmt.Sprintf("ProtoPackageIsVersion%d", generatedCodeVersion)),
-			"// please upgrade the proto package")
-		g.P()
-	}
-
 	for i, imps := 0, f.Desc.Imports(); i < imps.Len(); i++ {
 		genImport(gen, g, f, imps.Get(i))
 	}
@@ -275,7 +259,7 @@
 
 	// TODO: Modify CompressGZIP to lazy encode? Currently, the GZIP'd form
 	// is eagerly registered in v1, preventing any benefit from lazy encoding.
-	g.P("var ", f.descriptorGzipVar, " = ", protoapiPackage.Ident("CompressGZIP"), "(", f.descriptorRawVar, ")")
+	g.P("var ", f.descriptorGzipVar, " = ", protoimplPackage.Ident("X"), ".CompressGZIP(", f.descriptorRawVar, ")")
 	g.P()
 }
 
@@ -298,6 +282,7 @@
 	genReflectEnum(gen, g, f, enum)
 
 	nameMap := enum.GoIdent.GoName + "_name"
+	g.P("// Deprecated: Use ", enum.GoIdent.GoName, ".Type.Values instead.")
 	g.P("var ", nameMap, " = map[int32]string{")
 	generated := make(map[protoreflect.EnumNumber]bool)
 	for _, value := range enum.Values {
@@ -310,33 +295,35 @@
 	}
 	g.P("}")
 	g.P()
+
 	valueMap := enum.GoIdent.GoName + "_value"
+	g.P("// Deprecated: Use ", enum.GoIdent.GoName, ".Type.Values instead.")
 	g.P("var ", valueMap, " = map[string]int32{")
 	for _, value := range enum.Values {
 		g.P(strconv.Quote(string(value.Desc.Name())), ": ", value.Desc.Number(), ",")
 	}
 	g.P("}")
 	g.P()
+
 	if enum.Desc.Syntax() != protoreflect.Proto3 {
 		g.P("func (x ", enum.GoIdent, ") Enum() *", enum.GoIdent, " {")
-		g.P("p := new(", enum.GoIdent, ")")
-		g.P("*p = x")
-		g.P("return p")
+		g.P("return &x")
 		g.P("}")
 		g.P()
 	}
 	g.P("func (x ", enum.GoIdent, ") String() string {")
-	g.P("return ", f.protoPackage().Ident("EnumName"), "(", enum.GoIdent, "_name, int32(x))")
+	g.P("return ", protoimplPackage.Ident("X"), ".EnumStringOf(x.Type(), ", protoreflectPackage.Ident("EnumNumber"), "(x))")
 	g.P("}")
 	g.P()
 
 	if enum.Desc.Syntax() == protoreflect.Proto2 {
-		g.P("func (x *", enum.GoIdent, ") UnmarshalJSON(data []byte) error {")
-		g.P("value, err := ", f.protoPackage().Ident("UnmarshalJSONEnum"), "(", enum.GoIdent, `_value, data, "`, enum.GoIdent, `")`)
+		g.P("// Deprecated: Do not use.")
+		g.P("func (x *", enum.GoIdent, ") UnmarshalJSON(b []byte) error {")
+		g.P("num, err := ", protoimplPackage.Ident("X"), ".UnmarshalJSONEnum(x.Type(), b)")
 		g.P("if err != nil {")
 		g.P("return err")
 		g.P("}")
-		g.P("*x = ", enum.GoIdent, "(value)")
+		g.P("*x = ", enum.GoIdent, "(num)")
 		g.P("return nil")
 		g.P("}")
 		g.P()
@@ -346,6 +333,7 @@
 	for i := 1; i < len(enum.Location.Path); i += 2 {
 		indexes = append(indexes, strconv.Itoa(int(enum.Location.Path[i])))
 	}
+	g.P("// Deprecated: Use ", enum.GoIdent, ".Type instead.")
 	g.P("func (", enum.GoIdent, ") EnumDescriptor() ([]byte, []int) {")
 	g.P("return ", f.descriptorGzipVar, ", []int{", strings.Join(indexes, ","), "}")
 	g.P("}")
@@ -452,6 +440,7 @@
 	for i := 1; i < len(message.Location.Path); i += 2 {
 		indexes = append(indexes, strconv.Itoa(int(message.Location.Path[i])))
 	}
+	g.P("// Deprecated: Use ", message.GoIdent, ".ProtoReflect.Type instead.")
 	g.P("func (*", message.GoIdent, ") Descriptor() ([]byte, []int) {")
 	g.P("return ", f.descriptorGzipVar, ", []int{", strings.Join(indexes, ","), "}")
 	g.P("}")
@@ -468,6 +457,7 @@
 		}
 		g.P("}")
 		g.P()
+		g.P("// Deprecated: Use ", message.GoIdent, ".ProtoReflect.Type.ExtensionRanges instead.")
 		g.P("func (*", message.GoIdent, ") ExtensionRangeArray() []", protoExtRange, " {")
 		g.P("return ", extRangeVar)
 		g.P("}")
@@ -779,10 +769,10 @@
 // generated file with the proto package.
 func genInitFunction(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) {
 	g.P("func init() {")
-	g.P(f.protoPackage().Ident("RegisterFile"), "(", strconv.Quote(f.Desc.Path()), ", ", f.descriptorGzipVar, ")")
+	g.P(protoPackage.Ident("RegisterFile"), "(", strconv.Quote(f.Desc.Path()), ", ", f.descriptorGzipVar, ")")
 	for _, enum := range f.allEnums {
 		name := enum.GoIdent.GoName
-		g.P(f.protoPackage().Ident("RegisterEnum"), fmt.Sprintf("(%q, %s_name, %s_value)", enumRegistryName(enum), name, name))
+		g.P(protoPackage.Ident("RegisterEnum"), fmt.Sprintf("(%q, %s_name, %s_value)", enumRegistryName(enum), name, name))
 	}
 	for _, message := range f.allMessages {
 		if message.Desc.IsMapEntry() {
@@ -790,7 +780,7 @@
 		}
 
 		name := message.GoIdent.GoName
-		g.P(f.protoPackage().Ident("RegisterType"), fmt.Sprintf("((*%s)(nil), %q)", name, message.Desc.FullName()))
+		g.P(protoPackage.Ident("RegisterType"), fmt.Sprintf("((*%s)(nil), %q)", name, message.Desc.FullName()))
 
 		// Types of map fields, sorted by the name of the field message type.
 		var mapFields []*protogen.Field
@@ -807,11 +797,11 @@
 		for _, field := range mapFields {
 			typeName := string(field.MessageType.Desc.FullName())
 			goType, _ := fieldGoType(g, field)
-			g.P(f.protoPackage().Ident("RegisterMapType"), fmt.Sprintf("((%v)(nil), %q)", goType, typeName))
+			g.P(protoPackage.Ident("RegisterMapType"), fmt.Sprintf("((%v)(nil), %q)", goType, typeName))
 		}
 	}
 	for _, extension := range f.allExtensions {
-		g.P(f.protoPackage().Ident("RegisterExtension"), "(", extensionVar(f.File, extension), ")")
+		g.P(protoPackage.Ident("RegisterExtension"), "(", extensionVar(f.File, extension), ")")
 	}
 	g.P("}")
 	g.P()
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
index cbf24fe..139bdaa 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
+++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type AnnotationsTestEnum int32
 
 const (
@@ -30,33 +23,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use AnnotationsTestEnum.Type.Values instead.
 var AnnotationsTestEnum_name = map[int32]string{
 	0: "ANNOTATIONS_TEST_ENUM_VALUE",
 }
 
+// Deprecated: Use AnnotationsTestEnum.Type.Values instead.
 var AnnotationsTestEnum_value = map[string]int32{
 	"ANNOTATIONS_TEST_ENUM_VALUE": 0,
 }
 
 func (x AnnotationsTestEnum) Enum() *AnnotationsTestEnum {
-	p := new(AnnotationsTestEnum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x AnnotationsTestEnum) String() string {
-	return proto.EnumName(AnnotationsTestEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *AnnotationsTestEnum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(AnnotationsTestEnum_value, data, "AnnotationsTestEnum")
+// Deprecated: Do not use.
+func (x *AnnotationsTestEnum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = AnnotationsTestEnum(value)
+	*x = AnnotationsTestEnum(num)
 	return nil
 }
 
+// Deprecated: Use AnnotationsTestEnum.Type instead.
 func (AnnotationsTestEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_annotations_annotations_proto_rawdesc_gzipped, []int{0}
 }
@@ -74,6 +69,8 @@
 func (m *AnnotationsTestMessage) Reset()         { *m = AnnotationsTestMessage{} }
 func (m *AnnotationsTestMessage) String() string { return proto.CompactTextString(m) }
 func (*AnnotationsTestMessage) ProtoMessage()    {}
+
+// Deprecated: Use AnnotationsTestMessage.ProtoReflect.Type instead.
 func (*AnnotationsTestMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_annotations_annotations_proto_rawdesc_gzipped, []int{0}
 }
@@ -130,7 +127,7 @@
 	0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
 }
 
-var xxx_File_annotations_annotations_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_annotations_annotations_proto_rawdesc)
+var xxx_File_annotations_annotations_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_annotations_annotations_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
index 503b614..c966993 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
+++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
@@ -1 +1 @@
-annotation:<path:5 path:0 source_file:"annotations/annotations.proto" begin:687 end:706 > annotation:<path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:723 end:770 > annotation:<path:4 path:0 source_file:"annotations/annotations.proto" begin:1801 end:1823 > annotation:<path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1834 end:1854 > annotation:<path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:3339 end:3362 >
\ No newline at end of file
+annotation:<path:5 path:0 source_file:"annotations/annotations.proto" begin:318 end:337 > annotation:<path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:354 end:401 > annotation:<path:4 path:0 source_file:"annotations/annotations.proto" begin:1562 end:1584 > annotation:<path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1595 end:1615 > annotation:<path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:3170 end:3193 >
\ No newline at end of file
diff --git a/cmd/protoc-gen-go/testdata/comments/comments.pb.go b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
index 9b050e5..6f1d23e 100644
--- a/cmd/protoc-gen-go/testdata/comments/comments.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
@@ -7,18 +7,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // COMMENT: Message1
 type Message1 struct {
 	// COMMENT: Field1A
@@ -40,6 +33,8 @@
 func (m *Message1) Reset()         { *m = Message1{} }
 func (m *Message1) String() string { return proto.CompactTextString(m) }
 func (*Message1) ProtoMessage()    {}
+
+// Deprecated: Use Message1.ProtoReflect.Type instead.
 func (*Message1) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawdesc_gzipped, []int{0}
 }
@@ -113,6 +108,8 @@
 func (m *Message2) Reset()         { *m = Message2{} }
 func (m *Message2) String() string { return proto.CompactTextString(m) }
 func (*Message2) ProtoMessage()    {}
+
+// Deprecated: Use Message2.ProtoReflect.Type instead.
 func (*Message2) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawdesc_gzipped, []int{1}
 }
@@ -148,6 +145,8 @@
 func (m *Message1_Message1A) Reset()         { *m = Message1_Message1A{} }
 func (m *Message1_Message1A) String() string { return proto.CompactTextString(m) }
 func (*Message1_Message1A) ProtoMessage()    {}
+
+// Deprecated: Use Message1_Message1A.ProtoReflect.Type instead.
 func (*Message1_Message1A) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -183,6 +182,8 @@
 func (m *Message1_Message1B) Reset()         { *m = Message1_Message1B{} }
 func (m *Message1_Message1B) String() string { return proto.CompactTextString(m) }
 func (*Message1_Message1B) ProtoMessage()    {}
+
+// Deprecated: Use Message1_Message1B.ProtoReflect.Type instead.
 func (*Message1_Message1B) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawdesc_gzipped, []int{0, 1}
 }
@@ -218,6 +219,8 @@
 func (m *Message2_Message2A) Reset()         { *m = Message2_Message2A{} }
 func (m *Message2_Message2A) String() string { return proto.CompactTextString(m) }
 func (*Message2_Message2A) ProtoMessage()    {}
+
+// Deprecated: Use Message2_Message2A.ProtoReflect.Type instead.
 func (*Message2_Message2A) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawdesc_gzipped, []int{1, 0}
 }
@@ -253,6 +256,8 @@
 func (m *Message2_Message2B) Reset()         { *m = Message2_Message2B{} }
 func (m *Message2_Message2B) String() string { return proto.CompactTextString(m) }
 func (*Message2_Message2B) ProtoMessage()    {}
+
+// Deprecated: Use Message2_Message2B.ProtoReflect.Type instead.
 func (*Message2_Message2B) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawdesc_gzipped, []int{1, 1}
 }
@@ -306,7 +311,7 @@
 	0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73,
 }
 
-var xxx_File_comments_comments_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_comments_comments_proto_rawdesc)
+var xxx_File_comments_comments_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_comments_comments_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
index adb5c82..442e208 100644
--- a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type DeprecatedEnum int32 // Deprecated: Do not use.
 const (
 	DeprecatedEnum_DEPRECATED DeprecatedEnum = 0 // Deprecated: Do not use.
@@ -29,18 +22,21 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use DeprecatedEnum.Type.Values instead.
 var DeprecatedEnum_name = map[int32]string{
 	0: "DEPRECATED",
 }
 
+// Deprecated: Use DeprecatedEnum.Type.Values instead.
 var DeprecatedEnum_value = map[string]int32{
 	"DEPRECATED": 0,
 }
 
 func (x DeprecatedEnum) String() string {
-	return proto.EnumName(DeprecatedEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use DeprecatedEnum.Type instead.
 func (DeprecatedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_comments_deprecated_proto_rawdesc_gzipped, []int{0}
 }
@@ -59,6 +55,8 @@
 func (m *DeprecatedMessage) Reset()         { *m = DeprecatedMessage{} }
 func (m *DeprecatedMessage) String() string { return proto.CompactTextString(m) }
 func (*DeprecatedMessage) ProtoMessage()    {}
+
+// Deprecated: Use DeprecatedMessage.ProtoReflect.Type instead.
 func (*DeprecatedMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_deprecated_proto_rawdesc_gzipped, []int{0}
 }
@@ -115,7 +113,7 @@
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_comments_deprecated_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_comments_deprecated_proto_rawdesc)
+var xxx_File_comments_deprecated_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_comments_deprecated_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
index 6c78a69..b18d32d 100644
--- a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type BaseMessage struct {
 	Field                        *string  `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"`
 	XXX_NoUnkeyedLiteral         struct{} `json:"-"`
@@ -31,6 +24,8 @@
 func (m *BaseMessage) Reset()         { *m = BaseMessage{} }
 func (m *BaseMessage) String() string { return proto.CompactTextString(m) }
 func (*BaseMessage) ProtoMessage()    {}
+
+// Deprecated: Use BaseMessage.ProtoReflect.Type instead.
 func (*BaseMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_base_base_proto_rawdesc_gzipped, []int{0}
 }
@@ -40,6 +35,7 @@
 	{Start: 16, End: 536870911},
 }
 
+// Deprecated: Use BaseMessage.ProtoReflect.Type.ExtensionRanges instead.
 func (*BaseMessage) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_BaseMessage
 }
@@ -82,6 +78,8 @@
 func (m *MessageSetWireFormatMessage) Reset()         { *m = MessageSetWireFormatMessage{} }
 func (m *MessageSetWireFormatMessage) String() string { return proto.CompactTextString(m) }
 func (*MessageSetWireFormatMessage) ProtoMessage()    {}
+
+// Deprecated: Use MessageSetWireFormatMessage.ProtoReflect.Type instead.
 func (*MessageSetWireFormatMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_base_base_proto_rawdesc_gzipped, []int{1}
 }
@@ -90,6 +88,7 @@
 	{Start: 100, End: 2147483646},
 }
 
+// Deprecated: Use MessageSetWireFormatMessage.ProtoReflect.Type.ExtensionRanges instead.
 func (*MessageSetWireFormatMessage) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_MessageSetWireFormatMessage
 }
@@ -137,7 +136,7 @@
 	0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65,
 }
 
-var xxx_File_extensions_base_base_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_extensions_base_base_proto_rawdesc)
+var xxx_File_extensions_base_base_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_extensions_base_base_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
index 6800c2e..2d08e1c 100644
--- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
@@ -5,7 +5,6 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	base "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/extensions/base"
 	extra "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/extensions/extra"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
@@ -13,12 +12,6 @@
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum int32
 
 const (
@@ -32,33 +25,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_value = map[string]int32{
 	"ZERO": 0,
 }
 
 func (x Enum) Enum() *Enum {
-	p := new(Enum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enum) String() string {
-	return proto.EnumName(Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enum_value, data, "Enum")
+// Deprecated: Do not use.
+func (x *Enum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enum(value)
+	*x = Enum(num)
 	return nil
 }
 
+// Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{0}
 }
@@ -76,6 +71,8 @@
 func (m *Message) Reset()         { *m = Message{} }
 func (m *Message) String() string { return proto.CompactTextString(m) }
 func (*Message) ProtoMessage()    {}
+
+// Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{0}
 }
@@ -118,6 +115,8 @@
 func (m *ExtensionGroup) Reset()         { *m = ExtensionGroup{} }
 func (m *ExtensionGroup) String() string { return proto.CompactTextString(m) }
 func (*ExtensionGroup) ProtoMessage()    {}
+
+// Deprecated: Use ExtensionGroup.ProtoReflect.Type instead.
 func (*ExtensionGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{1}
 }
@@ -160,6 +159,8 @@
 func (m *ExtendingMessage) Reset()         { *m = ExtendingMessage{} }
 func (m *ExtendingMessage) String() string { return proto.CompactTextString(m) }
 func (*ExtendingMessage) ProtoMessage()    {}
+
+// Deprecated: Use ExtendingMessage.ProtoReflect.Type instead.
 func (*ExtendingMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{2}
 }
@@ -195,6 +196,8 @@
 func (m *RepeatedGroup) Reset()         { *m = RepeatedGroup{} }
 func (m *RepeatedGroup) String() string { return proto.CompactTextString(m) }
 func (*RepeatedGroup) ProtoMessage()    {}
+
+// Deprecated: Use RepeatedGroup.ProtoReflect.Type instead.
 func (*RepeatedGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{3}
 }
@@ -238,6 +241,8 @@
 func (m *Extendable) Reset()         { *m = Extendable{} }
 func (m *Extendable) String() string { return proto.CompactTextString(m) }
 func (*Extendable) ProtoMessage()    {}
+
+// Deprecated: Use Extendable.ProtoReflect.Type instead.
 func (*Extendable) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{4}
 }
@@ -246,6 +251,7 @@
 	{Start: 1, End: 536870911},
 }
 
+// Deprecated: Use Extendable.ProtoReflect.Type.ExtensionRanges instead.
 func (*Extendable) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_Extendable
 }
@@ -281,6 +287,8 @@
 func (m *MessageSetWireFormatExtension) Reset()         { *m = MessageSetWireFormatExtension{} }
 func (m *MessageSetWireFormatExtension) String() string { return proto.CompactTextString(m) }
 func (*MessageSetWireFormatExtension) ProtoMessage()    {}
+
+// Deprecated: Use MessageSetWireFormatExtension.ProtoReflect.Type instead.
 func (*MessageSetWireFormatExtension) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{5}
 }
@@ -315,6 +323,8 @@
 func (m *Message_M) Reset()         { *m = Message_M{} }
 func (m *Message_M) String() string { return proto.CompactTextString(m) }
 func (*Message_M) ProtoMessage()    {}
+
+// Deprecated: Use Message_M.ProtoReflect.Type instead.
 func (*Message_M) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -353,6 +363,8 @@
 	return proto.CompactTextString(m)
 }
 func (*ExtendingMessage_ExtendingMessageSubmessage) ProtoMessage() {}
+
+// Deprecated: Use ExtendingMessage_ExtendingMessageSubmessage.ProtoReflect.Type instead.
 func (*ExtendingMessage_ExtendingMessageSubmessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawdesc_gzipped, []int{2, 0}
 }
@@ -1237,7 +1249,7 @@
 	0x2f, 0x65, 0x78, 0x74,
 }
 
-var xxx_File_extensions_ext_ext_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_extensions_ext_ext_proto_rawdesc)
+var xxx_File_extensions_ext_ext_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_extensions_ext_ext_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
index def11a0..9019b87 100644
--- a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type ExtraMessage struct {
 	Data                 []byte   `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -30,6 +23,8 @@
 func (m *ExtraMessage) Reset()         { *m = ExtraMessage{} }
 func (m *ExtraMessage) String() string { return proto.CompactTextString(m) }
 func (*ExtraMessage) ProtoMessage()    {}
+
+// Deprecated: Use ExtraMessage.ProtoReflect.Type instead.
 func (*ExtraMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_extra_extra_proto_rawdesc_gzipped, []int{0}
 }
@@ -79,7 +74,7 @@
 	0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x78, 0x74, 0x72, 0x61,
 }
 
-var xxx_File_extensions_extra_extra_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_extensions_extra_extra_proto_rawdesc)
+var xxx_File_extensions_extra_extra_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_extensions_extra_extra_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
index 89b2700..bc1aac9 100644
--- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	descriptor "github.com/golang/protobuf/v2/types/descriptor"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum int32
 
 const (
@@ -31,18 +24,21 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_value = map[string]int32{
 	"ZERO": 0,
 }
 
 func (x Enum) String() string {
-	return proto.EnumName(Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_extensions_proto3_ext3_proto_rawdesc_gzipped, []int{0}
 }
@@ -59,6 +55,8 @@
 func (m *Message) Reset()         { *m = Message{} }
 func (m *Message) String() string { return proto.CompactTextString(m) }
 func (*Message) ProtoMessage()    {}
+
+// Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_proto3_ext3_proto_rawdesc_gzipped, []int{0}
 }
@@ -708,7 +706,7 @@
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_extensions_proto3_ext3_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_extensions_proto3_ext3_proto_rawdesc)
+var xxx_File_extensions_proto3_ext3_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_extensions_proto3_ext3_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
index d7d429a..d42049a 100644
--- a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
+++ b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // Assorted edge cases in field name conflict resolution.
 //
 // Not all (or possibly any) of these behave in an easily-understood fashion.
@@ -68,6 +61,8 @@
 func (m *Message) Reset()         { *m = Message{} }
 func (m *Message) String() string { return proto.CompactTextString(m) }
 func (*Message) ProtoMessage()    {}
+
+// Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_fieldnames_fieldnames_proto_rawdesc_gzipped, []int{0}
 }
@@ -295,6 +290,8 @@
 func (m *Message_OneofMessageConflict) Reset()         { *m = Message_OneofMessageConflict{} }
 func (m *Message_OneofMessageConflict) String() string { return proto.CompactTextString(m) }
 func (*Message_OneofMessageConflict) ProtoMessage()    {}
+
+// Deprecated: Use Message_OneofMessageConflict.ProtoReflect.Type instead.
 func (*Message_OneofMessageConflict) Descriptor() ([]byte, []int) {
 	return xxx_File_fieldnames_fieldnames_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -379,7 +376,7 @@
 	0x66, 0x69, 0x65, 0x6c, 0x64, 0x6e, 0x61, 0x6d, 0x65, 0x73,
 }
 
-var xxx_File_fieldnames_fieldnames_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_fieldnames_fieldnames_proto_rawdesc)
+var xxx_File_fieldnames_fieldnames_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_fieldnames_fieldnames_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/import_public/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/a.pb.go
index 6c5418e..402131b 100644
--- a/cmd/protoc-gen-go/testdata/import_public/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/a.pb.go
@@ -5,7 +5,6 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	sub "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub"
 	sub2 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub2"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
@@ -13,12 +12,6 @@
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // Symbols defined in public import of import_public/sub/a.proto
 
 type E = sub.E
@@ -76,6 +69,8 @@
 func (m *Public) Reset()         { *m = Public{} }
 func (m *Public) String() string { return proto.CompactTextString(m) }
 func (*Public) ProtoMessage()    {}
+
+// Deprecated: Use Public.ProtoReflect.Type instead.
 func (*Public) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_a_proto_rawdesc_gzipped, []int{0}
 }
@@ -152,7 +147,7 @@
 	0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x50, 0x00, 0x50, 0x01, 0x50, 0x02,
 }
 
-var xxx_File_import_public_a_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_import_public_a_proto_rawdesc)
+var xxx_File_import_public_a_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_import_public_a_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/import_public/b.pb.go b/cmd/protoc-gen-go/testdata/import_public/b.pb.go
index 19e44f3..3cd1d46 100644
--- a/cmd/protoc-gen-go/testdata/import_public/b.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/b.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	sub "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Local struct {
 	M                    *sub.M   `protobuf:"bytes,1,opt,name=m" json:"m,omitempty"`
 	E                    *sub.E   `protobuf:"varint,2,opt,name=e,enum=goproto.protoc.import_public.sub.E" json:"e,omitempty"`
@@ -32,6 +25,8 @@
 func (m *Local) Reset()         { *m = Local{} }
 func (m *Local) String() string { return proto.CompactTextString(m) }
 func (*Local) ProtoMessage()    {}
+
+// Deprecated: Use Local.ProtoReflect.Type instead.
 func (*Local) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_b_proto_rawdesc_gzipped, []int{0}
 }
@@ -94,7 +89,7 @@
 	0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
 }
 
-var xxx_File_import_public_b_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_import_public_b_proto_rawdesc)
+var xxx_File_import_public_b_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_import_public_b_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
index b486899..0397983 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
@@ -5,7 +5,6 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	sub2 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub2"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
@@ -13,12 +12,6 @@
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // Symbols defined in public import of import_public/sub2/a.proto
 
 type Sub2Message = sub2.Sub2Message
@@ -36,33 +29,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use E.Type.Values instead.
 var E_name = map[int32]string{
 	0: "ZERO",
 }
 
+// Deprecated: Use E.Type.Values instead.
 var E_value = map[string]int32{
 	"ZERO": 0,
 }
 
 func (x E) Enum() *E {
-	p := new(E)
-	*p = x
-	return p
+	return &x
 }
 
 func (x E) String() string {
-	return proto.EnumName(E_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *E) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(E_value, data, "E")
+// Deprecated: Do not use.
+func (x *E) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = E(value)
+	*x = E(num)
 	return nil
 }
 
+// Deprecated: Use E.Type instead.
 func (E) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub_a_proto_rawdesc_gzipped, []int{0}
 }
@@ -80,33 +75,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use M_Subenum.Type.Values instead.
 var M_Subenum_name = map[int32]string{
 	0: "M_ZERO",
 }
 
+// Deprecated: Use M_Subenum.Type.Values instead.
 var M_Subenum_value = map[string]int32{
 	"M_ZERO": 0,
 }
 
 func (x M_Subenum) Enum() *M_Subenum {
-	p := new(M_Subenum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x M_Subenum) String() string {
-	return proto.EnumName(M_Subenum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *M_Subenum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(M_Subenum_value, data, "M_Subenum")
+// Deprecated: Do not use.
+func (x *M_Subenum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = M_Subenum(value)
+	*x = M_Subenum(num)
 	return nil
 }
 
+// Deprecated: Use M_Subenum.Type instead.
 func (M_Subenum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub_a_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -124,33 +121,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use M_Submessage_Submessage_Subenum.Type.Values instead.
 var M_Submessage_Submessage_Subenum_name = map[int32]string{
 	0: "M_SUBMESSAGE_ZERO",
 }
 
+// Deprecated: Use M_Submessage_Submessage_Subenum.Type.Values instead.
 var M_Submessage_Submessage_Subenum_value = map[string]int32{
 	"M_SUBMESSAGE_ZERO": 0,
 }
 
 func (x M_Submessage_Submessage_Subenum) Enum() *M_Submessage_Submessage_Subenum {
-	p := new(M_Submessage_Submessage_Subenum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x M_Submessage_Submessage_Subenum) String() string {
-	return proto.EnumName(M_Submessage_Submessage_Subenum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *M_Submessage_Submessage_Subenum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(M_Submessage_Submessage_Subenum_value, data, "M_Submessage_Submessage_Subenum")
+// Deprecated: Do not use.
+func (x *M_Submessage_Submessage_Subenum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = M_Submessage_Submessage_Subenum(value)
+	*x = M_Submessage_Submessage_Subenum(num)
 	return nil
 }
 
+// Deprecated: Use M_Submessage_Submessage_Subenum.Type instead.
 func (M_Submessage_Submessage_Subenum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub_a_proto_rawdesc_gzipped, []int{0, 0, 0}
 }
@@ -177,6 +176,8 @@
 func (m *M) Reset()         { *m = M{} }
 func (m *M) String() string { return proto.CompactTextString(m) }
 func (*M) ProtoMessage()    {}
+
+// Deprecated: Use M.ProtoReflect.Type instead.
 func (*M) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub_a_proto_rawdesc_gzipped, []int{0}
 }
@@ -185,6 +186,7 @@
 	{Start: 100, End: 536870911},
 }
 
+// Deprecated: Use M.ProtoReflect.Type.ExtensionRanges instead.
 func (*M) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_M
 }
@@ -301,6 +303,8 @@
 func (m *M_Submessage) Reset()         { *m = M_Submessage{} }
 func (m *M_Submessage) String() string { return proto.CompactTextString(m) }
 func (*M_Submessage) ProtoMessage()    {}
+
+// Deprecated: Use M_Submessage.ProtoReflect.Type instead.
 func (*M_Submessage) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub_a_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -443,7 +447,7 @@
 	0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x50, 0x01,
 }
 
-var xxx_File_import_public_sub_a_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_import_public_sub_a_proto_rawdesc)
+var xxx_File_import_public_sub_a_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_import_public_sub_a_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
index b45dd3b..81c15f1 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M2 struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M2) Reset()         { *m = M2{} }
 func (m *M2) String() string { return proto.CompactTextString(m) }
 func (*M2) ProtoMessage()    {}
+
+// Deprecated: Use M2.ProtoReflect.Type instead.
 func (*M2) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub_b_proto_rawdesc_gzipped, []int{0}
 }
@@ -70,7 +65,7 @@
 	0x62,
 }
 
-var xxx_File_import_public_sub_b_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_import_public_sub_b_proto_rawdesc)
+var xxx_File_import_public_sub_b_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_import_public_sub_b_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
index add3a91..daf8aea 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Sub2Message struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *Sub2Message) Reset()         { *m = Sub2Message{} }
 func (m *Sub2Message) String() string { return proto.CompactTextString(m) }
 func (*Sub2Message) ProtoMessage()    {}
+
+// Deprecated: Use Sub2Message.ProtoReflect.Type instead.
 func (*Sub2Message) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_sub2_a_proto_rawdesc_gzipped, []int{0}
 }
@@ -70,7 +65,7 @@
 	0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x32,
 }
 
-var xxx_File_import_public_sub2_a_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_import_public_sub2_a_proto_rawdesc)
+var xxx_File_import_public_sub2_a_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_import_public_sub2_a_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
index f52f772..28834f7 100644
--- a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M) Reset()         { *m = M{} }
 func (m *M) String() string { return proto.CompactTextString(m) }
 func (*M) ProtoMessage()    {}
+
+// Deprecated: Use M.ProtoReflect.Type instead.
 func (*M) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_fmt_m_proto_rawdesc_gzipped, []int{0}
 }
@@ -67,7 +62,7 @@
 	0x72, 0x74, 0x73, 0x2f, 0x66, 0x6d, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_fmt_m_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_fmt_m_proto_rawdesc)
+var xxx_File_imports_fmt_m_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_fmt_m_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
index 9fd3c28..bcbf15f 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type E1 int32
 
 const (
@@ -30,18 +23,21 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use E1.Type.Values instead.
 var E1_name = map[int32]string{
 	0: "E1_ZERO",
 }
 
+// Deprecated: Use E1.Type.Values instead.
 var E1_value = map[string]int32{
 	"E1_ZERO": 0,
 }
 
 func (x E1) String() string {
-	return proto.EnumName(E1_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use E1.Type instead.
 func (E1) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped, []int{0}
 }
@@ -58,6 +54,8 @@
 func (m *M1) Reset()         { *m = M1{} }
 func (m *M1) String() string { return proto.CompactTextString(m) }
 func (*M1) ProtoMessage()    {}
+
+// Deprecated: Use M1.ProtoReflect.Type instead.
 func (*M1) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped, []int{0}
 }
@@ -93,6 +91,8 @@
 func (m *M1_1) Reset()         { *m = M1_1{} }
 func (m *M1_1) String() string { return proto.CompactTextString(m) }
 func (*M1_1) ProtoMessage()    {}
+
+// Deprecated: Use M1_1.ProtoReflect.Type instead.
 func (*M1_1) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped, []int{1}
 }
@@ -145,7 +145,7 @@
 	0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_a_1_m1_proto_rawdesc)
+var xxx_File_imports_test_a_1_m1_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_a_1_m1_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
index cf7dfd2..bd02efc 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M2 struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M2) Reset()         { *m = M2{} }
 func (m *M2) String() string { return proto.CompactTextString(m) }
 func (*M2) ProtoMessage()    {}
+
+// Deprecated: Use M2.ProtoReflect.Type instead.
 func (*M2) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_1_m2_proto_rawdesc_gzipped, []int{0}
 }
@@ -68,7 +63,7 @@
 	0x73, 0x74, 0x5f, 0x61, 0x5f, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_a_1_m2_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_a_1_m2_proto_rawdesc)
+var xxx_File_imports_test_a_1_m2_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_a_1_m2_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
index 0d2aa0f..81c27b8 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M3 struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M3) Reset()         { *m = M3{} }
 func (m *M3) String() string { return proto.CompactTextString(m) }
 func (*M3) ProtoMessage()    {}
+
+// Deprecated: Use M3.ProtoReflect.Type instead.
 func (*M3) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_2_m3_proto_rawdesc_gzipped, []int{0}
 }
@@ -68,7 +63,7 @@
 	0x73, 0x74, 0x5f, 0x61, 0x5f, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_a_2_m3_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_a_2_m3_proto_rawdesc)
+var xxx_File_imports_test_a_2_m3_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_a_2_m3_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
index 758743c..339a836 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M4 struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M4) Reset()         { *m = M4{} }
 func (m *M4) String() string { return proto.CompactTextString(m) }
 func (*M4) ProtoMessage()    {}
+
+// Deprecated: Use M4.ProtoReflect.Type instead.
 func (*M4) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_2_m4_proto_rawdesc_gzipped, []int{0}
 }
@@ -68,7 +63,7 @@
 	0x73, 0x74, 0x5f, 0x61, 0x5f, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_a_2_m4_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_a_2_m4_proto_rawdesc)
+var xxx_File_imports_test_a_2_m4_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_a_2_m4_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
index b63c656..021c341 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M1 struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M1) Reset()         { *m = M1{} }
 func (m *M1) String() string { return proto.CompactTextString(m) }
 func (*M1) ProtoMessage()    {}
+
+// Deprecated: Use M1.ProtoReflect.Type instead.
 func (*M1) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_b_1_m1_proto_rawdesc_gzipped, []int{0}
 }
@@ -69,7 +64,7 @@
 	0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_b_1_m1_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_b_1_m1_proto_rawdesc)
+var xxx_File_imports_test_b_1_m1_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_b_1_m1_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
index cfaa827..9d65402 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type M2 struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *M2) Reset()         { *m = M2{} }
 func (m *M2) String() string { return proto.CompactTextString(m) }
 func (*M2) ProtoMessage()    {}
+
+// Deprecated: Use M2.ProtoReflect.Type instead.
 func (*M2) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_b_1_m2_proto_rawdesc_gzipped, []int{0}
 }
@@ -69,7 +64,7 @@
 	0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_b_1_m2_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_b_1_m2_proto_rawdesc)
+var xxx_File_imports_test_b_1_m2_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_b_1_m2_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
index 526527f..e422585 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	test_a_1 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type A1M1 struct {
 	F                    *test_a_1.M1 `protobuf:"bytes,1,opt,name=f,proto3" json:"f,omitempty"`
 	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
@@ -31,6 +24,8 @@
 func (m *A1M1) Reset()         { *m = A1M1{} }
 func (m *A1M1) String() string { return proto.CompactTextString(m) }
 func (*A1M1) ProtoMessage()    {}
+
+// Deprecated: Use A1M1.ProtoReflect.Type instead.
 func (*A1M1) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_import_a1m1_proto_rawdesc_gzipped, []int{0}
 }
@@ -80,7 +75,7 @@
 	0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_import_a1m1_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_import_a1m1_proto_rawdesc)
+var xxx_File_imports_test_import_a1m1_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_import_a1m1_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
index 328b036..ca8539a 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	test_a_1 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type A1M2 struct {
 	F                    *test_a_1.M2 `protobuf:"bytes,1,opt,name=f,proto3" json:"f,omitempty"`
 	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
@@ -31,6 +24,8 @@
 func (m *A1M2) Reset()         { *m = A1M2{} }
 func (m *A1M2) String() string { return proto.CompactTextString(m) }
 func (*A1M2) ProtoMessage()    {}
+
+// Deprecated: Use A1M2.ProtoReflect.Type instead.
 func (*A1M2) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_import_a1m2_proto_rawdesc_gzipped, []int{0}
 }
@@ -80,7 +75,7 @@
 	0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_import_a1m2_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_import_a1m2_proto_rawdesc)
+var xxx_File_imports_test_import_a1m2_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_import_a1m2_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
index bbeac9e..94e725b 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
@@ -5,7 +5,6 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	fmt "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/fmt"
 	test_a_1 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	_ "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_a_2"
@@ -15,12 +14,6 @@
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type All struct {
 	Am1                  *test_a_1.M1 `protobuf:"bytes,1,opt,name=am1,proto3" json:"am1,omitempty"`
 	Am2                  *test_a_1.M2 `protobuf:"bytes,2,opt,name=am2,proto3" json:"am2,omitempty"`
@@ -38,6 +31,8 @@
 func (m *All) Reset()         { *m = All{} }
 func (m *All) String() string { return proto.CompactTextString(m) }
 func (*All) ProtoMessage()    {}
+
+// Deprecated: Use All.ProtoReflect.Type instead.
 func (*All) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_import_all_proto_rawdesc_gzipped, []int{0}
 }
@@ -133,7 +128,7 @@
 	0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_imports_test_import_all_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_imports_test_import_all_proto_rawdesc)
+var xxx_File_imports_test_import_all_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_imports_test_import_all_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
index 966589e..e700643 100644
--- a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
+++ b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Foo struct {
 	// Types that are valid to be assigned to Bar:
 	//	*Foo_GetBar
@@ -32,6 +25,8 @@
 func (m *Foo) Reset()         { *m = Foo{} }
 func (m *Foo) String() string { return proto.CompactTextString(m) }
 func (*Foo) ProtoMessage()    {}
+
+// Deprecated: Use Foo.ProtoReflect.Type instead.
 func (*Foo) Descriptor() ([]byte, []int) {
 	return xxx_File_issue780_oneof_conflict_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -100,7 +95,7 @@
 	0x72, 0x42, 0x05, 0x0a, 0x03, 0x62, 0x61, 0x72,
 }
 
-var xxx_File_issue780_oneof_conflict_test_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_issue780_oneof_conflict_test_proto_rawdesc)
+var xxx_File_issue780_oneof_conflict_test_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_issue780_oneof_conflict_test_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
index 3f9252a..e77bef4 100644
--- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
+++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum int32
 
 const (
@@ -30,33 +23,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_value = map[string]int32{
 	"ZERO": 0,
 }
 
 func (x Enum) Enum() *Enum {
-	p := new(Enum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enum) String() string {
-	return proto.EnumName(Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enum_value, data, "Enum")
+// Deprecated: Do not use.
+func (x *Enum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enum(value)
+	*x = Enum(num)
 	return nil
 }
 
+// Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_nopackage_nopackage_proto_rawdesc_gzipped, []int{0}
 }
@@ -75,6 +70,8 @@
 func (m *Message) Reset()         { *m = Message{} }
 func (m *Message) String() string { return proto.CompactTextString(m) }
 func (*Message) ProtoMessage()    {}
+
+// Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_nopackage_nopackage_proto_rawdesc_gzipped, []int{0}
 }
@@ -132,7 +129,7 @@
 	0x04, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00,
 }
 
-var xxx_File_nopackage_nopackage_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_nopackage_nopackage_proto_rawdesc)
+var xxx_File_nopackage_nopackage_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_nopackage_nopackage_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
index adbde5a..958b1d8 100644
--- a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // EnumType1 comment.
 type EnumType1 int32
 
@@ -34,35 +27,37 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use EnumType1.Type.Values instead.
 var EnumType1_name = map[int32]string{
 	1: "ONE",
 	2: "TWO",
 }
 
+// Deprecated: Use EnumType1.Type.Values instead.
 var EnumType1_value = map[string]int32{
 	"ONE": 1,
 	"TWO": 2,
 }
 
 func (x EnumType1) Enum() *EnumType1 {
-	p := new(EnumType1)
-	*p = x
-	return p
+	return &x
 }
 
 func (x EnumType1) String() string {
-	return proto.EnumName(EnumType1_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *EnumType1) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(EnumType1_value, data, "EnumType1")
+// Deprecated: Do not use.
+func (x *EnumType1) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = EnumType1(value)
+	*x = EnumType1(num)
 	return nil
 }
 
+// Deprecated: Use EnumType1.Type instead.
 func (EnumType1) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0}
 }
@@ -81,35 +76,37 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use EnumType2.Type.Values instead.
 var EnumType2_name = map[int32]string{
 	1: "duplicate1",
 	// Duplicate value: 1: "duplicate2",
 }
 
+// Deprecated: Use EnumType2.Type.Values instead.
 var EnumType2_value = map[string]int32{
 	"duplicate1": 1,
 	"duplicate2": 1,
 }
 
 func (x EnumType2) Enum() *EnumType2 {
-	p := new(EnumType2)
-	*p = x
-	return p
+	return &x
 }
 
 func (x EnumType2) String() string {
-	return proto.EnumName(EnumType2_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *EnumType2) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(EnumType2_value, data, "EnumType2")
+// Deprecated: Do not use.
+func (x *EnumType2) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = EnumType2(value)
+	*x = EnumType2(num)
 	return nil
 }
 
+// Deprecated: Use EnumType2.Type instead.
 func (EnumType2) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{1}
 }
@@ -129,33 +126,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use EnumContainerMessage1_NestedEnumType1A.Type.Values instead.
 var EnumContainerMessage1_NestedEnumType1A_name = map[int32]string{
 	0: "NESTED_1A_VALUE",
 }
 
+// Deprecated: Use EnumContainerMessage1_NestedEnumType1A.Type.Values instead.
 var EnumContainerMessage1_NestedEnumType1A_value = map[string]int32{
 	"NESTED_1A_VALUE": 0,
 }
 
 func (x EnumContainerMessage1_NestedEnumType1A) Enum() *EnumContainerMessage1_NestedEnumType1A {
-	p := new(EnumContainerMessage1_NestedEnumType1A)
-	*p = x
-	return p
+	return &x
 }
 
 func (x EnumContainerMessage1_NestedEnumType1A) String() string {
-	return proto.EnumName(EnumContainerMessage1_NestedEnumType1A_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *EnumContainerMessage1_NestedEnumType1A) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_NestedEnumType1A_value, data, "EnumContainerMessage1_NestedEnumType1A")
+// Deprecated: Do not use.
+func (x *EnumContainerMessage1_NestedEnumType1A) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = EnumContainerMessage1_NestedEnumType1A(value)
+	*x = EnumContainerMessage1_NestedEnumType1A(num)
 	return nil
 }
 
+// Deprecated: Use EnumContainerMessage1_NestedEnumType1A.Type instead.
 func (EnumContainerMessage1_NestedEnumType1A) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -173,33 +172,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use EnumContainerMessage1_NestedEnumType1B.Type.Values instead.
 var EnumContainerMessage1_NestedEnumType1B_name = map[int32]string{
 	0: "NESTED_1B_VALUE",
 }
 
+// Deprecated: Use EnumContainerMessage1_NestedEnumType1B.Type.Values instead.
 var EnumContainerMessage1_NestedEnumType1B_value = map[string]int32{
 	"NESTED_1B_VALUE": 0,
 }
 
 func (x EnumContainerMessage1_NestedEnumType1B) Enum() *EnumContainerMessage1_NestedEnumType1B {
-	p := new(EnumContainerMessage1_NestedEnumType1B)
-	*p = x
-	return p
+	return &x
 }
 
 func (x EnumContainerMessage1_NestedEnumType1B) String() string {
-	return proto.EnumName(EnumContainerMessage1_NestedEnumType1B_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *EnumContainerMessage1_NestedEnumType1B) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_NestedEnumType1B_value, data, "EnumContainerMessage1_NestedEnumType1B")
+// Deprecated: Do not use.
+func (x *EnumContainerMessage1_NestedEnumType1B) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = EnumContainerMessage1_NestedEnumType1B(value)
+	*x = EnumContainerMessage1_NestedEnumType1B(num)
 	return nil
 }
 
+// Deprecated: Use EnumContainerMessage1_NestedEnumType1B.Type instead.
 func (EnumContainerMessage1_NestedEnumType1B) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0, 1}
 }
@@ -219,33 +220,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A.Type.Values instead.
 var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name = map[int32]string{
 	0: "NESTED_2A_VALUE",
 }
 
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A.Type.Values instead.
 var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value = map[string]int32{
 	"NESTED_2A_VALUE": 0,
 }
 
 func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Enum() *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A {
-	p := new(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A)
-	*p = x
-	return p
+	return &x
 }
 
 func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) String() string {
-	return proto.EnumName(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value, data, "EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A")
+// Deprecated: Do not use.
+func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A(value)
+	*x = EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A(num)
 	return nil
 }
 
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A.Type instead.
 func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0, 0, 0}
 }
@@ -263,33 +266,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B.Type.Values instead.
 var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name = map[int32]string{
 	0: "NESTED_2B_VALUE",
 }
 
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B.Type.Values instead.
 var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value = map[string]int32{
 	"NESTED_2B_VALUE": 0,
 }
 
 func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Enum() *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B {
-	p := new(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B)
-	*p = x
-	return p
+	return &x
 }
 
 func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) String() string {
-	return proto.EnumName(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value, data, "EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B")
+// Deprecated: Do not use.
+func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B(value)
+	*x = EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B(num)
 	return nil
 }
 
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B.Type instead.
 func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0, 0, 1}
 }
@@ -308,6 +313,8 @@
 func (m *EnumContainerMessage1) Reset()         { *m = EnumContainerMessage1{} }
 func (m *EnumContainerMessage1) String() string { return proto.CompactTextString(m) }
 func (*EnumContainerMessage1) ProtoMessage()    {}
+
+// Deprecated: Use EnumContainerMessage1.ProtoReflect.Type instead.
 func (*EnumContainerMessage1) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0}
 }
@@ -363,6 +370,8 @@
 	return proto.CompactTextString(m)
 }
 func (*EnumContainerMessage1_EnumContainerMessage2) ProtoMessage() {}
+
+// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2.ProtoReflect.Type instead.
 func (*EnumContainerMessage1_EnumContainerMessage2) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -440,7 +449,7 @@
 	0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
 }
 
-var xxx_File_proto2_enum_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_proto2_enum_proto_rawdesc)
+var xxx_File_proto2_enum_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_proto2_enum_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
index 359cafc..7d03b09 100644
--- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	math "math"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type FieldTestMessage_Enum int32
 
 const (
@@ -32,35 +25,37 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FieldTestMessage_Enum.Type.Values instead.
 var FieldTestMessage_Enum_name = map[int32]string{
 	0: "ZERO",
 	1: "ONE",
 }
 
+// Deprecated: Use FieldTestMessage_Enum.Type.Values instead.
 var FieldTestMessage_Enum_value = map[string]int32{
 	"ZERO": 0,
 	"ONE":  1,
 }
 
 func (x FieldTestMessage_Enum) Enum() *FieldTestMessage_Enum {
-	p := new(FieldTestMessage_Enum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x FieldTestMessage_Enum) String() string {
-	return proto.EnumName(FieldTestMessage_Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *FieldTestMessage_Enum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(FieldTestMessage_Enum_value, data, "FieldTestMessage_Enum")
+// Deprecated: Do not use.
+func (x *FieldTestMessage_Enum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = FieldTestMessage_Enum(value)
+	*x = FieldTestMessage_Enum(num)
 	return nil
 }
 
+// Deprecated: Use FieldTestMessage_Enum.Type instead.
 func (FieldTestMessage_Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -183,6 +178,8 @@
 func (m *FieldTestMessage) Reset()         { *m = FieldTestMessage{} }
 func (m *FieldTestMessage) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage.ProtoReflect.Type instead.
 func (*FieldTestMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0}
 }
@@ -1135,6 +1132,8 @@
 func (m *FieldTestMessage_OptionalGroup) Reset()         { *m = FieldTestMessage_OptionalGroup{} }
 func (m *FieldTestMessage_OptionalGroup) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage_OptionalGroup) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage_OptionalGroup.ProtoReflect.Type instead.
 func (*FieldTestMessage_OptionalGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -1177,6 +1176,8 @@
 func (m *FieldTestMessage_RequiredGroup) Reset()         { *m = FieldTestMessage_RequiredGroup{} }
 func (m *FieldTestMessage_RequiredGroup) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage_RequiredGroup) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage_RequiredGroup.ProtoReflect.Type instead.
 func (*FieldTestMessage_RequiredGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0, 1}
 }
@@ -1219,6 +1220,8 @@
 func (m *FieldTestMessage_RepeatedGroup) Reset()         { *m = FieldTestMessage_RepeatedGroup{} }
 func (m *FieldTestMessage_RepeatedGroup) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage_RepeatedGroup) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage_RepeatedGroup.ProtoReflect.Type instead.
 func (*FieldTestMessage_RepeatedGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0, 2}
 }
@@ -1261,6 +1264,8 @@
 func (m *FieldTestMessage_OneofGroup) Reset()         { *m = FieldTestMessage_OneofGroup{} }
 func (m *FieldTestMessage_OneofGroup) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage_OneofGroup) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage_OneofGroup.ProtoReflect.Type instead.
 func (*FieldTestMessage_OneofGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0, 6}
 }
@@ -1302,6 +1307,8 @@
 func (m *FieldTestMessage_Message) Reset()         { *m = FieldTestMessage_Message{} }
 func (m *FieldTestMessage_Message) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage_Message) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage_Message.ProtoReflect.Type instead.
 func (*FieldTestMessage_Message) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_fields_proto_rawdesc_gzipped, []int{0, 7}
 }
@@ -1712,7 +1719,7 @@
 	0x74, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
 }
 
-var xxx_File_proto2_fields_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_proto2_fields_proto_rawdesc)
+var xxx_File_proto2_fields_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_proto2_fields_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
index 29ef913..4870f39 100644
--- a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Layer1 struct {
 	L2                   *Layer1_Layer2        `protobuf:"bytes,1,opt,name=l2" json:"l2,omitempty"`
 	L3                   *Layer1_Layer2_Layer3 `protobuf:"bytes,2,opt,name=l3" json:"l3,omitempty"`
@@ -31,6 +24,8 @@
 func (m *Layer1) Reset()         { *m = Layer1{} }
 func (m *Layer1) String() string { return proto.CompactTextString(m) }
 func (*Layer1) ProtoMessage()    {}
+
+// Deprecated: Use Layer1.ProtoReflect.Type instead.
 func (*Layer1) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_nested_messages_proto_rawdesc_gzipped, []int{0}
 }
@@ -80,6 +75,8 @@
 func (m *Layer1_Layer2) Reset()         { *m = Layer1_Layer2{} }
 func (m *Layer1_Layer2) String() string { return proto.CompactTextString(m) }
 func (*Layer1_Layer2) ProtoMessage()    {}
+
+// Deprecated: Use Layer1_Layer2.ProtoReflect.Type instead.
 func (*Layer1_Layer2) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_nested_messages_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -121,6 +118,8 @@
 func (m *Layer1_Layer2_Layer3) Reset()         { *m = Layer1_Layer2_Layer3{} }
 func (m *Layer1_Layer2_Layer3) String() string { return proto.CompactTextString(m) }
 func (*Layer1_Layer2_Layer3) ProtoMessage()    {}
+
+// Deprecated: Use Layer1_Layer2_Layer3.ProtoReflect.Type instead.
 func (*Layer1_Layer2_Layer3) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_nested_messages_proto_rawdesc_gzipped, []int{0, 0, 0}
 }
@@ -175,7 +174,7 @@
 	0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
 }
 
-var xxx_File_proto2_nested_messages_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_proto2_nested_messages_proto_rawdesc)
+var xxx_File_proto2_nested_messages_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_proto2_nested_messages_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
index cd10eb4..759bfb8 100644
--- a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Message struct {
 	I32                  *int32   `protobuf:"varint,1,opt,name=i32" json:"i32,omitempty"`
 	M                    *Message `protobuf:"bytes,2,opt,name=m" json:"m,omitempty"`
@@ -31,6 +24,8 @@
 func (m *Message) Reset()         { *m = Message{} }
 func (m *Message) String() string { return proto.CompactTextString(m) }
 func (*Message) ProtoMessage()    {}
+
+// Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_proto2_proto_rawdesc_gzipped, []int{0}
 }
@@ -88,7 +83,7 @@
 	0x61, 0x74, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
 }
 
-var xxx_File_proto2_proto2_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_proto2_proto2_proto_rawdesc)
+var xxx_File_proto2_proto2_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_proto2_proto2_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
index 4f6d5e2..30b1304 100644
--- a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go
@@ -5,17 +5,10 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum int32
 
 const (
@@ -31,12 +24,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
 	1: "ONE",
 	2: "TWO",
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_value = map[string]int32{
 	"ZERO": 0,
 	"ONE":  1,
@@ -44,9 +39,10 @@
 }
 
 func (x Enum) String() string {
-	return proto.EnumName(Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto3_enum_proto_rawdesc_gzipped, []int{0}
 }
@@ -70,7 +66,7 @@
 	0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_proto3_enum_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_proto3_enum_proto_rawdesc)
+var xxx_File_proto3_enum_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_proto3_enum_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
index 0715db1..d7aa218 100644
--- a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type FieldTestMessage_Enum int32
 
 const (
@@ -30,18 +23,21 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FieldTestMessage_Enum.Type.Values instead.
 var FieldTestMessage_Enum_name = map[int32]string{
 	0: "ZERO",
 }
 
+// Deprecated: Use FieldTestMessage_Enum.Type.Values instead.
 var FieldTestMessage_Enum_value = map[string]int32{
 	"ZERO": 0,
 }
 
 func (x FieldTestMessage_Enum) String() string {
-	return proto.EnumName(FieldTestMessage_Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use FieldTestMessage_Enum.Type instead.
 func (FieldTestMessage_Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto3_fields_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -95,6 +91,8 @@
 func (m *FieldTestMessage) Reset()         { *m = FieldTestMessage{} }
 func (m *FieldTestMessage) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage.ProtoReflect.Type instead.
 func (*FieldTestMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_proto3_fields_proto_rawdesc_gzipped, []int{0}
 }
@@ -388,6 +386,8 @@
 func (m *FieldTestMessage_Message) Reset()         { *m = FieldTestMessage_Message{} }
 func (m *FieldTestMessage_Message) String() string { return proto.CompactTextString(m) }
 func (*FieldTestMessage_Message) ProtoMessage()    {}
+
+// Deprecated: Use FieldTestMessage_Message.ProtoReflect.Type instead.
 func (*FieldTestMessage_Message) Descriptor() ([]byte, []int) {
 	return xxx_File_proto3_fields_proto_rawdesc_gzipped, []int{0, 3}
 }
@@ -573,7 +573,7 @@
 	0x6f, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_proto3_fields_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_proto3_fields_proto_rawdesc)
+var xxx_File_proto3_fields_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_proto3_fields_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/encoding/testprotos/pb2/test.pb.go b/encoding/testprotos/pb2/test.pb.go
index 5b02880..b3e9cfd 100644
--- a/encoding/testprotos/pb2/test.pb.go
+++ b/encoding/testprotos/pb2/test.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	known "github.com/golang/protobuf/v2/types/known"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum int32
 
 const (
@@ -33,12 +26,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	1:  "ONE",
 	2:  "TWO",
 	10: "TEN",
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_value = map[string]int32{
 	"ONE": 1,
 	"TWO": 2,
@@ -46,24 +41,24 @@
 }
 
 func (x Enum) Enum() *Enum {
-	p := new(Enum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enum) String() string {
-	return proto.EnumName(Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enum_value, data, "Enum")
+// Deprecated: Do not use.
+func (x *Enum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enum(value)
+	*x = Enum(num)
 	return nil
 }
 
+// Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -83,12 +78,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enums_NestedEnum.Type.Values instead.
 var Enums_NestedEnum_name = map[int32]string{
 	1:  "UNO",
 	2:  "DOS",
 	10: "DIEZ",
 }
 
+// Deprecated: Use Enums_NestedEnum.Type.Values instead.
 var Enums_NestedEnum_value = map[string]int32{
 	"UNO":  1,
 	"DOS":  2,
@@ -96,24 +93,24 @@
 }
 
 func (x Enums_NestedEnum) Enum() *Enums_NestedEnum {
-	p := new(Enums_NestedEnum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enums_NestedEnum) String() string {
-	return proto.EnumName(Enums_NestedEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enums_NestedEnum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enums_NestedEnum_value, data, "Enums_NestedEnum")
+// Deprecated: Do not use.
+func (x *Enums_NestedEnum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enums_NestedEnum(value)
+	*x = Enums_NestedEnum(num)
 	return nil
 }
 
+// Deprecated: Use Enums_NestedEnum.Type instead.
 func (Enums_NestedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{1, 0}
 }
@@ -146,6 +143,8 @@
 func (m *Scalars) Reset()         { *m = Scalars{} }
 func (m *Scalars) String() string { return proto.CompactTextString(m) }
 func (*Scalars) ProtoMessage()    {}
+
+// Deprecated: Use Scalars.ProtoReflect.Type instead.
 func (*Scalars) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -290,6 +289,8 @@
 func (m *Enums) Reset()         { *m = Enums{} }
 func (m *Enums) String() string { return proto.CompactTextString(m) }
 func (*Enums) ProtoMessage()    {}
+
+// Deprecated: Use Enums.ProtoReflect.Type instead.
 func (*Enums) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{1}
 }
@@ -362,6 +363,8 @@
 func (m *Repeats) Reset()         { *m = Repeats{} }
 func (m *Repeats) String() string { return proto.CompactTextString(m) }
 func (*Repeats) ProtoMessage()    {}
+
+// Deprecated: Use Repeats.ProtoReflect.Type instead.
 func (*Repeats) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{2}
 }
@@ -462,6 +465,8 @@
 func (m *Nested) Reset()         { *m = Nested{} }
 func (m *Nested) String() string { return proto.CompactTextString(m) }
 func (*Nested) ProtoMessage()    {}
+
+// Deprecated: Use Nested.ProtoReflect.Type instead.
 func (*Nested) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{3}
 }
@@ -515,6 +520,8 @@
 func (m *Nests) Reset()         { *m = Nests{} }
 func (m *Nests) String() string { return proto.CompactTextString(m) }
 func (*Nests) ProtoMessage()    {}
+
+// Deprecated: Use Nests.ProtoReflect.Type instead.
 func (*Nests) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{4}
 }
@@ -584,6 +591,8 @@
 func (m *Requireds) Reset()         { *m = Requireds{} }
 func (m *Requireds) String() string { return proto.CompactTextString(m) }
 func (*Requireds) ProtoMessage()    {}
+
+// Deprecated: Use Requireds.ProtoReflect.Type instead.
 func (*Requireds) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{5}
 }
@@ -663,6 +672,8 @@
 func (m *PartialRequired) Reset()         { *m = PartialRequired{} }
 func (m *PartialRequired) String() string { return proto.CompactTextString(m) }
 func (*PartialRequired) ProtoMessage()    {}
+
+// Deprecated: Use PartialRequired.ProtoReflect.Type instead.
 func (*PartialRequired) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{6}
 }
@@ -712,6 +723,8 @@
 func (m *NestedWithRequired) Reset()         { *m = NestedWithRequired{} }
 func (m *NestedWithRequired) String() string { return proto.CompactTextString(m) }
 func (*NestedWithRequired) ProtoMessage()    {}
+
+// Deprecated: Use NestedWithRequired.ProtoReflect.Type instead.
 func (*NestedWithRequired) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{7}
 }
@@ -759,6 +772,8 @@
 func (m *IndirectRequired) Reset()         { *m = IndirectRequired{} }
 func (m *IndirectRequired) String() string { return proto.CompactTextString(m) }
 func (*IndirectRequired) ProtoMessage()    {}
+
+// Deprecated: Use IndirectRequired.ProtoReflect.Type instead.
 func (*IndirectRequired) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{8}
 }
@@ -849,6 +864,8 @@
 func (m *Extensions) Reset()         { *m = Extensions{} }
 func (m *Extensions) String() string { return proto.CompactTextString(m) }
 func (*Extensions) ProtoMessage()    {}
+
+// Deprecated: Use Extensions.ProtoReflect.Type instead.
 func (*Extensions) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{9}
 }
@@ -857,6 +874,7 @@
 	{Start: 20, End: 100},
 }
 
+// Deprecated: Use Extensions.ProtoReflect.Type.ExtensionRanges instead.
 func (*Extensions) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_Extensions
 }
@@ -912,6 +930,8 @@
 func (m *ExtensionsContainer) Reset()         { *m = ExtensionsContainer{} }
 func (m *ExtensionsContainer) String() string { return proto.CompactTextString(m) }
 func (*ExtensionsContainer) ProtoMessage()    {}
+
+// Deprecated: Use ExtensionsContainer.ProtoReflect.Type instead.
 func (*ExtensionsContainer) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{10}
 }
@@ -947,6 +967,8 @@
 func (m *MessageSet) Reset()         { *m = MessageSet{} }
 func (m *MessageSet) String() string { return proto.CompactTextString(m) }
 func (*MessageSet) ProtoMessage()    {}
+
+// Deprecated: Use MessageSet.ProtoReflect.Type instead.
 func (*MessageSet) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{11}
 }
@@ -955,6 +977,7 @@
 	{Start: 4, End: 2147483646},
 }
 
+// Deprecated: Use MessageSet.ProtoReflect.Type.ExtensionRanges instead.
 func (*MessageSet) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_MessageSet
 }
@@ -990,6 +1013,8 @@
 func (m *MessageSetExtension) Reset()         { *m = MessageSetExtension{} }
 func (m *MessageSetExtension) String() string { return proto.CompactTextString(m) }
 func (*MessageSetExtension) ProtoMessage()    {}
+
+// Deprecated: Use MessageSetExtension.ProtoReflect.Type instead.
 func (*MessageSetExtension) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{12}
 }
@@ -1032,6 +1057,8 @@
 func (m *FakeMessageSet) Reset()         { *m = FakeMessageSet{} }
 func (m *FakeMessageSet) String() string { return proto.CompactTextString(m) }
 func (*FakeMessageSet) ProtoMessage()    {}
+
+// Deprecated: Use FakeMessageSet.ProtoReflect.Type instead.
 func (*FakeMessageSet) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{13}
 }
@@ -1040,6 +1067,7 @@
 	{Start: 4, End: 536870911},
 }
 
+// Deprecated: Use FakeMessageSet.ProtoReflect.Type.ExtensionRanges instead.
 func (*FakeMessageSet) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_FakeMessageSet
 }
@@ -1075,6 +1103,8 @@
 func (m *FakeMessageSetExtension) Reset()         { *m = FakeMessageSetExtension{} }
 func (m *FakeMessageSetExtension) String() string { return proto.CompactTextString(m) }
 func (*FakeMessageSetExtension) ProtoMessage()    {}
+
+// Deprecated: Use FakeMessageSetExtension.ProtoReflect.Type instead.
 func (*FakeMessageSetExtension) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{14}
 }
@@ -1133,6 +1163,8 @@
 func (m *KnownTypes) Reset()         { *m = KnownTypes{} }
 func (m *KnownTypes) String() string { return proto.CompactTextString(m) }
 func (*KnownTypes) ProtoMessage()    {}
+
+// Deprecated: Use KnownTypes.ProtoReflect.Type instead.
 func (*KnownTypes) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{15}
 }
@@ -1282,6 +1314,8 @@
 func (m *Nests_OptGroup) Reset()         { *m = Nests_OptGroup{} }
 func (m *Nests_OptGroup) String() string { return proto.CompactTextString(m) }
 func (*Nests_OptGroup) ProtoMessage()    {}
+
+// Deprecated: Use Nests_OptGroup.ProtoReflect.Type instead.
 func (*Nests_OptGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{4, 0}
 }
@@ -1338,6 +1372,8 @@
 func (m *Nests_RptGroup) Reset()         { *m = Nests_RptGroup{} }
 func (m *Nests_RptGroup) String() string { return proto.CompactTextString(m) }
 func (*Nests_RptGroup) ProtoMessage()    {}
+
+// Deprecated: Use Nests_RptGroup.ProtoReflect.Type instead.
 func (*Nests_RptGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{4, 1}
 }
@@ -1380,6 +1416,8 @@
 func (m *Nests_OptGroup_OptNestedGroup) Reset()         { *m = Nests_OptGroup_OptNestedGroup{} }
 func (m *Nests_OptGroup_OptNestedGroup) String() string { return proto.CompactTextString(m) }
 func (*Nests_OptGroup_OptNestedGroup) ProtoMessage()    {}
+
+// Deprecated: Use Nests_OptGroup_OptNestedGroup.ProtoReflect.Type instead.
 func (*Nests_OptGroup_OptNestedGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_pb2_test_proto_rawdesc_gzipped, []int{4, 0, 0}
 }
@@ -1992,7 +2030,7 @@
 	0x6f, 0x73, 0x2f, 0x70, 0x62, 0x32,
 }
 
-var xxx_File_pb2_test_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_pb2_test_proto_rawdesc)
+var xxx_File_pb2_test_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_pb2_test_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/encoding/testprotos/pb3/test.pb.go b/encoding/testprotos/pb3/test.pb.go
index 5615a30..00d596a 100644
--- a/encoding/testprotos/pb3/test.pb.go
+++ b/encoding/testprotos/pb3/test.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum int32
 
 const (
@@ -33,6 +26,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0:  "ZERO",
 	1:  "ONE",
@@ -40,6 +34,7 @@
 	10: "TEN",
 }
 
+// Deprecated: Use Enum.Type.Values instead.
 var Enum_value = map[string]int32{
 	"ZERO": 0,
 	"ONE":  1,
@@ -48,9 +43,10 @@
 }
 
 func (x Enum) String() string {
-	return proto.EnumName(Enum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -71,6 +67,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enums_NestedEnum.Type.Values instead.
 var Enums_NestedEnum_name = map[int32]string{
 	0:  "CERO",
 	1:  "UNO",
@@ -78,6 +75,7 @@
 	10: "DIEZ",
 }
 
+// Deprecated: Use Enums_NestedEnum.Type.Values instead.
 var Enums_NestedEnum_value = map[string]int32{
 	"CERO": 0,
 	"UNO":  1,
@@ -86,9 +84,10 @@
 }
 
 func (x Enums_NestedEnum) String() string {
-	return proto.EnumName(Enums_NestedEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Enums_NestedEnum.Type instead.
 func (Enums_NestedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{1, 0}
 }
@@ -121,6 +120,8 @@
 func (m *Scalars) Reset()         { *m = Scalars{} }
 func (m *Scalars) String() string { return proto.CompactTextString(m) }
 func (*Scalars) ProtoMessage()    {}
+
+// Deprecated: Use Scalars.ProtoReflect.Type instead.
 func (*Scalars) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -263,6 +264,8 @@
 func (m *Enums) Reset()         { *m = Enums{} }
 func (m *Enums) String() string { return proto.CompactTextString(m) }
 func (*Enums) ProtoMessage()    {}
+
+// Deprecated: Use Enums.ProtoReflect.Type instead.
 func (*Enums) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{1}
 }
@@ -313,6 +316,8 @@
 func (m *Nests) Reset()         { *m = Nests{} }
 func (m *Nests) String() string { return proto.CompactTextString(m) }
 func (*Nests) ProtoMessage()    {}
+
+// Deprecated: Use Nests.ProtoReflect.Type instead.
 func (*Nests) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{2}
 }
@@ -357,6 +362,8 @@
 func (m *Nested) Reset()         { *m = Nested{} }
 func (m *Nested) String() string { return proto.CompactTextString(m) }
 func (*Nested) ProtoMessage()    {}
+
+// Deprecated: Use Nested.ProtoReflect.Type instead.
 func (*Nested) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{3}
 }
@@ -411,6 +418,8 @@
 func (m *Oneofs) Reset()         { *m = Oneofs{} }
 func (m *Oneofs) String() string { return proto.CompactTextString(m) }
 func (*Oneofs) ProtoMessage()    {}
+
+// Deprecated: Use Oneofs.ProtoReflect.Type instead.
 func (*Oneofs) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{4}
 }
@@ -510,6 +519,8 @@
 func (m *Maps) Reset()         { *m = Maps{} }
 func (m *Maps) String() string { return proto.CompactTextString(m) }
 func (*Maps) ProtoMessage()    {}
+
+// Deprecated: Use Maps.ProtoReflect.Type instead.
 func (*Maps) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{5}
 }
@@ -581,6 +592,8 @@
 func (m *JSONNames) Reset()         { *m = JSONNames{} }
 func (m *JSONNames) String() string { return proto.CompactTextString(m) }
 func (*JSONNames) ProtoMessage()    {}
+
+// Deprecated: Use JSONNames.ProtoReflect.Type instead.
 func (*JSONNames) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawdesc_gzipped, []int{6}
 }
@@ -739,7 +752,7 @@
 	0x6f, 0x73, 0x2f, 0x70, 0x62, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_pb3_test_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_pb3_test_proto_rawdesc)
+var xxx_File_pb3_test_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_pb3_test_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/impl/export.go b/internal/impl/export.go
index a38390d..6e54939 100644
--- a/internal/impl/export.go
+++ b/internal/impl/export.go
@@ -5,6 +5,8 @@
 package impl
 
 import (
+	"strconv"
+
 	ptype "github.com/golang/protobuf/v2/internal/prototype"
 	pref "github.com/golang/protobuf/v2/reflect/protoreflect"
 )
@@ -35,6 +37,16 @@
 	return legacyWrapper.EnumTypeOf(e)
 }
 
+// EnumStringOf returns the enum value as a string, either as the name if
+// the number is resolvable, or the number formatted as a string.
+func (Export) EnumStringOf(ed pref.EnumDescriptor, n pref.EnumNumber) string {
+	ev := ed.Values().ByNumber(n)
+	if ev != nil {
+		return string(ev.Name())
+	}
+	return strconv.Itoa(int(n))
+}
+
 // MessageOf returns the protoreflect.Message interface over m.
 // If m already implements proto.Message, then it directly calls the
 // ProtoReflect method, otherwise it wraps the v1 message to implement
diff --git a/internal/impl/legact_export_test.go b/internal/impl/legact_export_test.go
new file mode 100644
index 0000000..e1d2c08
--- /dev/null
+++ b/internal/impl/legact_export_test.go
@@ -0,0 +1,41 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package impl
+
+import (
+	"bytes"
+	"compress/gzip"
+	"io/ioutil"
+	"math"
+	"strings"
+	"testing"
+)
+
+func TestCompressGZIP(t *testing.T) {
+	tests := []string{
+		"",
+		"a",
+		"ab",
+		"abc",
+		strings.Repeat("a", math.MaxUint16-1),
+		strings.Repeat("b", math.MaxUint16),
+		strings.Repeat("c", math.MaxUint16+1),
+		strings.Repeat("abcdefghijklmnopqrstuvwxyz", math.MaxUint16-13),
+	}
+	for _, want := range tests {
+		rb := bytes.NewReader(Export{}.CompressGZIP([]byte(want)))
+		zr, err := gzip.NewReader(rb)
+		if err != nil {
+			t.Errorf("unexpected gzip.NewReader error: %v", err)
+		}
+		b, err := ioutil.ReadAll(zr)
+		if err != nil {
+			t.Errorf("unexpected ioutil.ReadAll error: %v", err)
+		}
+		if got := string(b); got != want {
+			t.Errorf("output mismatch: got %q, want %q", got, want)
+		}
+	}
+}
diff --git a/internal/impl/legacy_export.go b/internal/impl/legacy_export.go
new file mode 100644
index 0000000..8038333
--- /dev/null
+++ b/internal/impl/legacy_export.go
@@ -0,0 +1,76 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package impl
+
+import (
+	"encoding/binary"
+	"encoding/json"
+	"hash/crc32"
+	"math"
+
+	"github.com/golang/protobuf/v2/internal/errors"
+	pref "github.com/golang/protobuf/v2/reflect/protoreflect"
+)
+
+// These functions exist to support exported APIs in generated protobufs.
+// While these are deprecated, they cannot be removed for compatibility reasons.
+
+// UnmarshalJSONEnum unmarshals an enum from a JSON-encoded input.
+// The input can either be a string representing the enum value by name,
+// or a number representing the enum number itself.
+func (Export) UnmarshalJSONEnum(ed pref.EnumDescriptor, b []byte) (pref.EnumNumber, error) {
+	if b[0] == '"' {
+		var name pref.Name
+		if err := json.Unmarshal(b, &name); err != nil {
+			return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b)
+		}
+		ev := ed.Values().ByName(name)
+		if ev != nil {
+			return 0, errors.New("invalid value for enum %v: %s", ed.FullName(), name)
+		}
+		return ev.Number(), nil
+	} else {
+		var num pref.EnumNumber
+		if err := json.Unmarshal(b, &num); err != nil {
+			return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b)
+		}
+		return num, nil
+	}
+}
+
+// CompressGZIP compresses the input as a GZIP-encoded file.
+// The current implementation does no compression.
+func (Export) CompressGZIP(in []byte) (out []byte) {
+	// RFC 1952, section 2.3.1.
+	var gzipHeader = [10]byte{0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff}
+
+	// RFC 1951, section 3.2.4.
+	var blockHeader [5]byte
+	const maxBlockSize = math.MaxUint16
+	numBlocks := 1 + len(in)/maxBlockSize
+
+	// RFC 1952, section 2.3.1.
+	var gzipFooter [8]byte
+	binary.LittleEndian.PutUint32(gzipFooter[0:4], crc32.ChecksumIEEE(in))
+	binary.LittleEndian.PutUint32(gzipFooter[4:8], uint32(len(in)))
+
+	// Encode the input without compression using raw DEFLATE blocks.
+	out = make([]byte, 0, len(gzipHeader)+len(blockHeader)*numBlocks+len(in)+len(gzipFooter))
+	out = append(out, gzipHeader[:]...)
+	for blockHeader[0] == 0 {
+		blockSize := maxBlockSize
+		if blockSize > len(in) {
+			blockHeader[0] = 0x01 // final bit per RFC 1951, section 3.2.3.
+			blockSize = len(in)
+		}
+		binary.LittleEndian.PutUint16(blockHeader[1:3], uint16(blockSize)^0x0000)
+		binary.LittleEndian.PutUint16(blockHeader[3:5], uint16(blockSize)^0xffff)
+		out = append(out, blockHeader[:]...)
+		out = append(out, in[:blockSize]...)
+		in = in[blockSize:]
+	}
+	out = append(out, gzipFooter[:]...)
+	return out
+}
diff --git a/internal/testprotos/conformance/conformance.pb.go b/internal/testprotos/conformance/conformance.pb.go
index f6b6483..dab5b06 100644
--- a/internal/testprotos/conformance/conformance.pb.go
+++ b/internal/testprotos/conformance/conformance.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type WireFormat int32
 
 const (
@@ -34,6 +27,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use WireFormat.Type.Values instead.
 var WireFormat_name = map[int32]string{
 	0: "UNSPECIFIED",
 	1: "PROTOBUF",
@@ -42,6 +36,7 @@
 	4: "TEXT_FORMAT",
 }
 
+// Deprecated: Use WireFormat.Type.Values instead.
 var WireFormat_value = map[string]int32{
 	"UNSPECIFIED": 0,
 	"PROTOBUF":    1,
@@ -51,9 +46,10 @@
 }
 
 func (x WireFormat) String() string {
-	return proto.EnumName(WireFormat_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use WireFormat.Type instead.
 func (WireFormat) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{0}
 }
@@ -84,6 +80,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use TestCategory.Type.Values instead.
 var TestCategory_name = map[int32]string{
 	0: "UNSPECIFIED_TEST",
 	1: "BINARY_TEST",
@@ -93,6 +90,7 @@
 	5: "TEXT_FORMAT_TEST",
 }
 
+// Deprecated: Use TestCategory.Type.Values instead.
 var TestCategory_value = map[string]int32{
 	"UNSPECIFIED_TEST":                 0,
 	"BINARY_TEST":                      1,
@@ -103,9 +101,10 @@
 }
 
 func (x TestCategory) String() string {
-	return proto.EnumName(TestCategory_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use TestCategory.Type instead.
 func (TestCategory) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{1}
 }
@@ -126,6 +125,8 @@
 func (m *FailureSet) Reset()         { *m = FailureSet{} }
 func (m *FailureSet) String() string { return proto.CompactTextString(m) }
 func (*FailureSet) ProtoMessage()    {}
+
+// Deprecated: Use FailureSet.ProtoReflect.Type instead.
 func (*FailureSet) Descriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{0}
 }
@@ -199,6 +200,8 @@
 func (m *ConformanceRequest) Reset()         { *m = ConformanceRequest{} }
 func (m *ConformanceRequest) String() string { return proto.CompactTextString(m) }
 func (*ConformanceRequest) ProtoMessage()    {}
+
+// Deprecated: Use ConformanceRequest.ProtoReflect.Type instead.
 func (*ConformanceRequest) Descriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{1}
 }
@@ -367,6 +370,8 @@
 func (m *ConformanceResponse) Reset()         { *m = ConformanceResponse{} }
 func (m *ConformanceResponse) String() string { return proto.CompactTextString(m) }
 func (*ConformanceResponse) ProtoMessage()    {}
+
+// Deprecated: Use ConformanceResponse.ProtoReflect.Type instead.
 func (*ConformanceResponse) Descriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{2}
 }
@@ -533,6 +538,8 @@
 func (m *JspbEncodingConfig) Reset()         { *m = JspbEncodingConfig{} }
 func (m *JspbEncodingConfig) String() string { return proto.CompactTextString(m) }
 func (*JspbEncodingConfig) ProtoMessage()    {}
+
+// Deprecated: Use JspbEncodingConfig.ProtoReflect.Type instead.
 func (*JspbEncodingConfig) Descriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{3}
 }
@@ -658,7 +665,7 @@
 	0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_conformance_conformance_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_conformance_conformance_proto_rawdesc)
+var xxx_File_conformance_conformance_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_conformance_conformance_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/legacy/legacy.pb.go b/internal/testprotos/legacy/legacy.pb.go
index 5703700..670a8b4 100644
--- a/internal/testprotos/legacy/legacy.pb.go
+++ b/internal/testprotos/legacy/legacy.pb.go
@@ -5,7 +5,6 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	proto2_v0_0 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto2.v0.0.0-20160225-2fc053c5"
 	proto2_v0_01 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto2.v0.0.0-20160519-a4ab9ec5"
 	proto2_v1_0 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto2.v1.0.0-20180125-92554152"
@@ -23,12 +22,6 @@
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Legacy struct {
 	F1                   *proto2_v0_0.Message  `protobuf:"bytes,1,opt,name=f1,proto3" json:"f1,omitempty"`
 	F2                   *proto3_v0_0.Message  `protobuf:"bytes,2,opt,name=f2,proto3" json:"f2,omitempty"`
@@ -53,6 +46,8 @@
 func (m *Legacy) Reset()         { *m = Legacy{} }
 func (m *Legacy) String() string { return proto.CompactTextString(m) }
 func (*Legacy) ProtoMessage()    {}
+
+// Deprecated: Use Legacy.ProtoReflect.Type instead.
 func (*Legacy) Descriptor() ([]byte, []int) {
 	return xxx_File_legacy_legacy_proto_rawdesc_gzipped, []int{0}
 }
@@ -260,7 +255,7 @@
 	0x33,
 }
 
-var xxx_File_legacy_legacy_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_legacy_legacy_proto_rawdesc)
+var xxx_File_legacy_legacy_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_legacy_legacy_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/ext.pb.go b/internal/testprotos/test/ext.pb.go
index a1fce7e..f52447d 100644
--- a/internal/testprotos/test/ext.pb.go
+++ b/internal/testprotos/test/ext.pb.go
@@ -5,17 +5,10 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 var xxx_File_test_ext_proto_extDescs = []proto.ExtensionDesc{
 	{
 		ExtendedType:  (*TestAllExtensions)(nil),
@@ -53,7 +46,7 @@
 	0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74,
 }
 
-var xxx_File_test_ext_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_test_ext_proto_rawdesc)
+var xxx_File_test_ext_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_test_ext_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index 0e6f681..e6b9c88 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type ForeignEnum int32
 
 const (
@@ -32,12 +25,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use ForeignEnum.Type.Values instead.
 var ForeignEnum_name = map[int32]string{
 	4: "FOREIGN_FOO",
 	5: "FOREIGN_BAR",
 	6: "FOREIGN_BAZ",
 }
 
+// Deprecated: Use ForeignEnum.Type.Values instead.
 var ForeignEnum_value = map[string]int32{
 	"FOREIGN_FOO": 4,
 	"FOREIGN_BAR": 5,
@@ -45,24 +40,24 @@
 }
 
 func (x ForeignEnum) Enum() *ForeignEnum {
-	p := new(ForeignEnum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x ForeignEnum) String() string {
-	return proto.EnumName(ForeignEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *ForeignEnum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(ForeignEnum_value, data, "ForeignEnum")
+// Deprecated: Do not use.
+func (x *ForeignEnum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = ForeignEnum(value)
+	*x = ForeignEnum(num)
 	return nil
 }
 
+// Deprecated: Use ForeignEnum.Type instead.
 func (ForeignEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -80,33 +75,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use TestReservedEnumFields.Type.Values instead.
 var TestReservedEnumFields_name = map[int32]string{
 	0: "RESERVED_ENUM",
 }
 
+// Deprecated: Use TestReservedEnumFields.Type.Values instead.
 var TestReservedEnumFields_value = map[string]int32{
 	"RESERVED_ENUM": 0,
 }
 
 func (x TestReservedEnumFields) Enum() *TestReservedEnumFields {
-	p := new(TestReservedEnumFields)
-	*p = x
-	return p
+	return &x
 }
 
 func (x TestReservedEnumFields) String() string {
-	return proto.EnumName(TestReservedEnumFields_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *TestReservedEnumFields) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(TestReservedEnumFields_value, data, "TestReservedEnumFields")
+// Deprecated: Do not use.
+func (x *TestReservedEnumFields) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = TestReservedEnumFields(value)
+	*x = TestReservedEnumFields(num)
 	return nil
 }
 
+// Deprecated: Use TestReservedEnumFields.Type instead.
 func (TestReservedEnumFields) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{1}
 }
@@ -127,6 +124,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead.
 var TestAllTypes_NestedEnum_name = map[int32]string{
 	0:  "FOO",
 	1:  "BAR",
@@ -134,6 +132,7 @@
 	-1: "NEG",
 }
 
+// Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead.
 var TestAllTypes_NestedEnum_value = map[string]int32{
 	"FOO": 0,
 	"BAR": 1,
@@ -142,24 +141,24 @@
 }
 
 func (x TestAllTypes_NestedEnum) Enum() *TestAllTypes_NestedEnum {
-	p := new(TestAllTypes_NestedEnum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x TestAllTypes_NestedEnum) String() string {
-	return proto.EnumName(TestAllTypes_NestedEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *TestAllTypes_NestedEnum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(TestAllTypes_NestedEnum_value, data, "TestAllTypes_NestedEnum")
+// Deprecated: Do not use.
+func (x *TestAllTypes_NestedEnum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = TestAllTypes_NestedEnum(value)
+	*x = TestAllTypes_NestedEnum(num)
 	return nil
 }
 
+// Deprecated: Use TestAllTypes_NestedEnum.Type instead.
 func (TestAllTypes_NestedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -176,33 +175,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use TestDeprecatedMessage_DeprecatedEnum.Type.Values instead.
 var TestDeprecatedMessage_DeprecatedEnum_name = map[int32]string{
 	0: "DEPRECATED",
 }
 
+// Deprecated: Use TestDeprecatedMessage_DeprecatedEnum.Type.Values instead.
 var TestDeprecatedMessage_DeprecatedEnum_value = map[string]int32{
 	"DEPRECATED": 0,
 }
 
 func (x TestDeprecatedMessage_DeprecatedEnum) Enum() *TestDeprecatedMessage_DeprecatedEnum {
-	p := new(TestDeprecatedMessage_DeprecatedEnum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x TestDeprecatedMessage_DeprecatedEnum) String() string {
-	return proto.EnumName(TestDeprecatedMessage_DeprecatedEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *TestDeprecatedMessage_DeprecatedEnum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(TestDeprecatedMessage_DeprecatedEnum_value, data, "TestDeprecatedMessage_DeprecatedEnum")
+// Deprecated: Do not use.
+func (x *TestDeprecatedMessage_DeprecatedEnum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = TestDeprecatedMessage_DeprecatedEnum(value)
+	*x = TestDeprecatedMessage_DeprecatedEnum(num)
 	return nil
 }
 
+// Deprecated: Use TestDeprecatedMessage_DeprecatedEnum.Type instead.
 func (TestDeprecatedMessage_DeprecatedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{1, 0}
 }
@@ -309,6 +310,8 @@
 func (m *TestAllTypes) Reset()         { *m = TestAllTypes{} }
 func (m *TestAllTypes) String() string { return proto.CompactTextString(m) }
 func (*TestAllTypes) ProtoMessage()    {}
+
+// Deprecated: Use TestAllTypes.ProtoReflect.Type instead.
 func (*TestAllTypes) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -1057,6 +1060,8 @@
 func (m *TestDeprecatedMessage) Reset()         { *m = TestDeprecatedMessage{} }
 func (m *TestDeprecatedMessage) String() string { return proto.CompactTextString(m) }
 func (*TestDeprecatedMessage) ProtoMessage()    {}
+
+// Deprecated: Use TestDeprecatedMessage.ProtoReflect.Type instead.
 func (*TestDeprecatedMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{1}
 }
@@ -1133,6 +1138,8 @@
 func (m *ForeignMessage) Reset()         { *m = ForeignMessage{} }
 func (m *ForeignMessage) String() string { return proto.CompactTextString(m) }
 func (*ForeignMessage) ProtoMessage()    {}
+
+// Deprecated: Use ForeignMessage.ProtoReflect.Type instead.
 func (*ForeignMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{2}
 }
@@ -1181,6 +1188,8 @@
 func (m *TestReservedFields) Reset()         { *m = TestReservedFields{} }
 func (m *TestReservedFields) String() string { return proto.CompactTextString(m) }
 func (*TestReservedFields) ProtoMessage()    {}
+
+// Deprecated: Use TestReservedFields.ProtoReflect.Type instead.
 func (*TestReservedFields) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{3}
 }
@@ -1216,6 +1225,8 @@
 func (m *TestAllExtensions) Reset()         { *m = TestAllExtensions{} }
 func (m *TestAllExtensions) String() string { return proto.CompactTextString(m) }
 func (*TestAllExtensions) ProtoMessage()    {}
+
+// Deprecated: Use TestAllExtensions.ProtoReflect.Type instead.
 func (*TestAllExtensions) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{4}
 }
@@ -1224,6 +1235,7 @@
 	{Start: 1, End: 536870911},
 }
 
+// Deprecated: Use TestAllExtensions.ProtoReflect.Type.ExtensionRanges instead.
 func (*TestAllExtensions) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_TestAllExtensions
 }
@@ -1259,6 +1271,8 @@
 func (m *OptionalGroupExtension) Reset()         { *m = OptionalGroupExtension{} }
 func (m *OptionalGroupExtension) String() string { return proto.CompactTextString(m) }
 func (*OptionalGroupExtension) ProtoMessage()    {}
+
+// Deprecated: Use OptionalGroupExtension.ProtoReflect.Type instead.
 func (*OptionalGroupExtension) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{5}
 }
@@ -1301,6 +1315,8 @@
 func (m *RepeatedGroupExtension) Reset()         { *m = RepeatedGroupExtension{} }
 func (m *RepeatedGroupExtension) String() string { return proto.CompactTextString(m) }
 func (*RepeatedGroupExtension) ProtoMessage()    {}
+
+// Deprecated: Use RepeatedGroupExtension.ProtoReflect.Type instead.
 func (*RepeatedGroupExtension) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{6}
 }
@@ -1342,6 +1358,8 @@
 func (m *TestNestedExtension) Reset()         { *m = TestNestedExtension{} }
 func (m *TestNestedExtension) String() string { return proto.CompactTextString(m) }
 func (*TestNestedExtension) ProtoMessage()    {}
+
+// Deprecated: Use TestNestedExtension.ProtoReflect.Type instead.
 func (*TestNestedExtension) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{7}
 }
@@ -1377,6 +1395,8 @@
 func (m *FooRequest) Reset()         { *m = FooRequest{} }
 func (m *FooRequest) String() string { return proto.CompactTextString(m) }
 func (*FooRequest) ProtoMessage()    {}
+
+// Deprecated: Use FooRequest.ProtoReflect.Type instead.
 func (*FooRequest) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{8}
 }
@@ -1411,6 +1431,8 @@
 func (m *FooResponse) Reset()         { *m = FooResponse{} }
 func (m *FooResponse) String() string { return proto.CompactTextString(m) }
 func (*FooResponse) ProtoMessage()    {}
+
+// Deprecated: Use FooResponse.ProtoReflect.Type instead.
 func (*FooResponse) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{9}
 }
@@ -1447,6 +1469,8 @@
 func (m *TestAllTypes_NestedMessage) Reset()         { *m = TestAllTypes_NestedMessage{} }
 func (m *TestAllTypes_NestedMessage) String() string { return proto.CompactTextString(m) }
 func (*TestAllTypes_NestedMessage) ProtoMessage()    {}
+
+// Deprecated: Use TestAllTypes_NestedMessage.ProtoReflect.Type instead.
 func (*TestAllTypes_NestedMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 0}
 }
@@ -1496,6 +1520,8 @@
 func (m *TestAllTypes_OptionalGroup) Reset()         { *m = TestAllTypes_OptionalGroup{} }
 func (m *TestAllTypes_OptionalGroup) String() string { return proto.CompactTextString(m) }
 func (*TestAllTypes_OptionalGroup) ProtoMessage()    {}
+
+// Deprecated: Use TestAllTypes_OptionalGroup.ProtoReflect.Type instead.
 func (*TestAllTypes_OptionalGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 1}
 }
@@ -1538,6 +1564,8 @@
 func (m *TestAllTypes_RepeatedGroup) Reset()         { *m = TestAllTypes_RepeatedGroup{} }
 func (m *TestAllTypes_RepeatedGroup) String() string { return proto.CompactTextString(m) }
 func (*TestAllTypes_RepeatedGroup) ProtoMessage()    {}
+
+// Deprecated: Use TestAllTypes_RepeatedGroup.ProtoReflect.Type instead.
 func (*TestAllTypes_RepeatedGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 2}
 }
@@ -2812,7 +2840,7 @@
 	0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x50, 0x01, 0x58, 0x02,
 }
 
-var xxx_File_test_test_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_test_test_proto_rawdesc)
+var xxx_File_test_test_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_test_test_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go
index af4bfd6..2b7ad1f 100644
--- a/internal/testprotos/test/test_import.pb.go
+++ b/internal/testprotos/test/test_import.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type ImportEnum int32
 
 const (
@@ -30,33 +23,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use ImportEnum.Type.Values instead.
 var ImportEnum_name = map[int32]string{
 	0: "IMPORT_ZERO",
 }
 
+// Deprecated: Use ImportEnum.Type.Values instead.
 var ImportEnum_value = map[string]int32{
 	"IMPORT_ZERO": 0,
 }
 
 func (x ImportEnum) Enum() *ImportEnum {
-	p := new(ImportEnum)
-	*p = x
-	return p
+	return &x
 }
 
 func (x ImportEnum) String() string {
-	return proto.EnumName(ImportEnum_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *ImportEnum) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(ImportEnum_value, data, "ImportEnum")
+// Deprecated: Do not use.
+func (x *ImportEnum) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = ImportEnum(value)
+	*x = ImportEnum(num)
 	return nil
 }
 
+// Deprecated: Use ImportEnum.Type instead.
 func (ImportEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_test_import_proto_rawdesc_gzipped, []int{0}
 }
@@ -73,6 +68,8 @@
 func (m *ImportMessage) Reset()         { *m = ImportMessage{} }
 func (m *ImportMessage) String() string { return proto.CompactTextString(m) }
 func (*ImportMessage) ProtoMessage()    {}
+
+// Deprecated: Use ImportMessage.ProtoReflect.Type instead.
 func (*ImportMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_import_proto_rawdesc_gzipped, []int{0}
 }
@@ -115,7 +112,7 @@
 	0x73, 0x2f, 0x74, 0x65, 0x73, 0x74,
 }
 
-var xxx_File_test_test_import_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_test_test_import_proto_rawdesc)
+var xxx_File_test_test_import_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_test_test_import_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test_public.pb.go b/internal/testprotos/test/test_public.pb.go
index 64303df..2be4785 100644
--- a/internal/testprotos/test/test_public.pb.go
+++ b/internal/testprotos/test/test_public.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type PublicImportMessage struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *PublicImportMessage) Reset()         { *m = PublicImportMessage{} }
 func (m *PublicImportMessage) String() string { return proto.CompactTextString(m) }
 func (*PublicImportMessage) ProtoMessage()    {}
+
+// Deprecated: Use PublicImportMessage.ProtoReflect.Type instead.
 func (*PublicImportMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_public_proto_rawdesc_gzipped, []int{0}
 }
@@ -68,7 +63,7 @@
 	0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74,
 }
 
-var xxx_File_test_test_public_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_test_test_public_proto_rawdesc)
+var xxx_File_test_test_public_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_test_test_public_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test_weak.pb.go b/internal/testprotos/test/test_weak.pb.go
index 7fa7296..54a9f44 100644
--- a/internal/testprotos/test/test_weak.pb.go
+++ b/internal/testprotos/test/test_weak.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type WeakImportMessage struct {
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
@@ -29,6 +22,8 @@
 func (m *WeakImportMessage) Reset()         { *m = WeakImportMessage{} }
 func (m *WeakImportMessage) String() string { return proto.CompactTextString(m) }
 func (*WeakImportMessage) ProtoMessage()    {}
+
+// Deprecated: Use WeakImportMessage.ProtoReflect.Type instead.
 func (*WeakImportMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test_test_weak_proto_rawdesc_gzipped, []int{0}
 }
@@ -68,7 +63,7 @@
 	0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74,
 }
 
-var xxx_File_test_test_weak_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_test_test_weak_proto_rawdesc)
+var xxx_File_test_test_weak_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_test_test_weak_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/reflect/protoregistry/testprotos/test.pb.go b/reflect/protoregistry/testprotos/test.pb.go
index 2303213..ff7c7ef 100644
--- a/reflect/protoregistry/testprotos/test.pb.go
+++ b/reflect/protoregistry/testprotos/test.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 type Enum1 int32
 
 const (
@@ -30,33 +23,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum1.Type.Values instead.
 var Enum1_name = map[int32]string{
 	1: "ONE",
 }
 
+// Deprecated: Use Enum1.Type.Values instead.
 var Enum1_value = map[string]int32{
 	"ONE": 1,
 }
 
 func (x Enum1) Enum() *Enum1 {
-	p := new(Enum1)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enum1) String() string {
-	return proto.EnumName(Enum1_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enum1) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enum1_value, data, "Enum1")
+// Deprecated: Do not use.
+func (x *Enum1) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enum1(value)
+	*x = Enum1(num)
 	return nil
 }
 
+// Deprecated: Use Enum1.Type instead.
 func (Enum1) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -74,33 +69,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum2.Type.Values instead.
 var Enum2_name = map[int32]string{
 	1: "UNO",
 }
 
+// Deprecated: Use Enum2.Type.Values instead.
 var Enum2_value = map[string]int32{
 	"UNO": 1,
 }
 
 func (x Enum2) Enum() *Enum2 {
-	p := new(Enum2)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enum2) String() string {
-	return proto.EnumName(Enum2_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enum2) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enum2_value, data, "Enum2")
+// Deprecated: Do not use.
+func (x *Enum2) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enum2(value)
+	*x = Enum2(num)
 	return nil
 }
 
+// Deprecated: Use Enum2.Type instead.
 func (Enum2) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{1}
 }
@@ -118,33 +115,35 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Enum3.Type.Values instead.
 var Enum3_name = map[int32]string{
 	1: "YI",
 }
 
+// Deprecated: Use Enum3.Type.Values instead.
 var Enum3_value = map[string]int32{
 	"YI": 1,
 }
 
 func (x Enum3) Enum() *Enum3 {
-	p := new(Enum3)
-	*p = x
-	return p
+	return &x
 }
 
 func (x Enum3) String() string {
-	return proto.EnumName(Enum3_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *Enum3) UnmarshalJSON(data []byte) error {
-	value, err := proto.UnmarshalJSONEnum(Enum3_value, data, "Enum3")
+// Deprecated: Do not use.
+func (x *Enum3) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = Enum3(value)
+	*x = Enum3(num)
 	return nil
 }
 
+// Deprecated: Use Enum3.Type instead.
 func (Enum3) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{2}
 }
@@ -162,6 +161,8 @@
 func (m *Message1) Reset()         { *m = Message1{} }
 func (m *Message1) String() string { return proto.CompactTextString(m) }
 func (*Message1) ProtoMessage()    {}
+
+// Deprecated: Use Message1.ProtoReflect.Type instead.
 func (*Message1) Descriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{0}
 }
@@ -170,6 +171,7 @@
 	{Start: 10, End: 536870911},
 }
 
+// Deprecated: Use Message1.ProtoReflect.Type.ExtensionRanges instead.
 func (*Message1) ExtensionRangeArray() []proto.ExtensionRange {
 	return extRange_Message1
 }
@@ -204,6 +206,8 @@
 func (m *Message2) Reset()         { *m = Message2{} }
 func (m *Message2) String() string { return proto.CompactTextString(m) }
 func (*Message2) ProtoMessage()    {}
+
+// Deprecated: Use Message2.ProtoReflect.Type instead.
 func (*Message2) Descriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{1}
 }
@@ -238,6 +242,8 @@
 func (m *Message3) Reset()         { *m = Message3{} }
 func (m *Message3) String() string { return proto.CompactTextString(m) }
 func (*Message3) ProtoMessage()    {}
+
+// Deprecated: Use Message3.ProtoReflect.Type instead.
 func (*Message3) Descriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{2}
 }
@@ -273,6 +279,8 @@
 func (m *Message4) Reset()         { *m = Message4{} }
 func (m *Message4) String() string { return proto.CompactTextString(m) }
 func (*Message4) ProtoMessage()    {}
+
+// Deprecated: Use Message4.ProtoReflect.Type instead.
 func (*Message4) Descriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawdesc_gzipped, []int{3}
 }
@@ -434,7 +442,7 @@
 	0x72, 0x79, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73,
 }
 
-var xxx_File_test_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_test_proto_rawdesc)
+var xxx_File_test_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_test_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/descriptor/descriptor.pb.go b/types/descriptor/descriptor.pb.go
index 5b34ef8..f5df250 100644
--- a/types/descriptor/descriptor.pb.go
+++ b/types/descriptor/descriptor.pb.go
@@ -4,6 +4,7 @@
 package descriptor_proto
 
 import (
+	proto "github.com/golang/protobuf/proto"
 	protoapi "github.com/golang/protobuf/protoapi"
 	prototype "github.com/golang/protobuf/v2/internal/prototype"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
@@ -52,6 +53,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FieldDescriptorProto_Type.Type.Values instead.
 var FieldDescriptorProto_Type_name = map[int32]string{
 	1:  "TYPE_DOUBLE",
 	2:  "TYPE_FLOAT",
@@ -73,6 +75,7 @@
 	18: "TYPE_SINT64",
 }
 
+// Deprecated: Use FieldDescriptorProto_Type.Type.Values instead.
 var FieldDescriptorProto_Type_value = map[string]int32{
 	"TYPE_DOUBLE":   1,
 	"TYPE_FLOAT":    2,
@@ -95,24 +98,24 @@
 }
 
 func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type {
-	p := new(FieldDescriptorProto_Type)
-	*p = x
-	return p
+	return &x
 }
 
 func (x FieldDescriptorProto_Type) String() string {
-	return protoapi.EnumName(FieldDescriptorProto_Type_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error {
-	value, err := protoapi.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type")
+// Deprecated: Do not use.
+func (x *FieldDescriptorProto_Type) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = FieldDescriptorProto_Type(value)
+	*x = FieldDescriptorProto_Type(num)
 	return nil
 }
 
+// Deprecated: Use FieldDescriptorProto_Type.Type instead.
 func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{4, 0}
 }
@@ -133,12 +136,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FieldDescriptorProto_Label.Type.Values instead.
 var FieldDescriptorProto_Label_name = map[int32]string{
 	1: "LABEL_OPTIONAL",
 	2: "LABEL_REQUIRED",
 	3: "LABEL_REPEATED",
 }
 
+// Deprecated: Use FieldDescriptorProto_Label.Type.Values instead.
 var FieldDescriptorProto_Label_value = map[string]int32{
 	"LABEL_OPTIONAL": 1,
 	"LABEL_REQUIRED": 2,
@@ -146,24 +151,24 @@
 }
 
 func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label {
-	p := new(FieldDescriptorProto_Label)
-	*p = x
-	return p
+	return &x
 }
 
 func (x FieldDescriptorProto_Label) String() string {
-	return protoapi.EnumName(FieldDescriptorProto_Label_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error {
-	value, err := protoapi.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label")
+// Deprecated: Do not use.
+func (x *FieldDescriptorProto_Label) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = FieldDescriptorProto_Label(value)
+	*x = FieldDescriptorProto_Label(num)
 	return nil
 }
 
+// Deprecated: Use FieldDescriptorProto_Label.Type instead.
 func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{4, 1}
 }
@@ -185,12 +190,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FileOptions_OptimizeMode.Type.Values instead.
 var FileOptions_OptimizeMode_name = map[int32]string{
 	1: "SPEED",
 	2: "CODE_SIZE",
 	3: "LITE_RUNTIME",
 }
 
+// Deprecated: Use FileOptions_OptimizeMode.Type.Values instead.
 var FileOptions_OptimizeMode_value = map[string]int32{
 	"SPEED":        1,
 	"CODE_SIZE":    2,
@@ -198,24 +205,24 @@
 }
 
 func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode {
-	p := new(FileOptions_OptimizeMode)
-	*p = x
-	return p
+	return &x
 }
 
 func (x FileOptions_OptimizeMode) String() string {
-	return protoapi.EnumName(FileOptions_OptimizeMode_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error {
-	value, err := protoapi.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode")
+// Deprecated: Do not use.
+func (x *FileOptions_OptimizeMode) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = FileOptions_OptimizeMode(value)
+	*x = FileOptions_OptimizeMode(num)
 	return nil
 }
 
+// Deprecated: Use FileOptions_OptimizeMode.Type instead.
 func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{10, 0}
 }
@@ -236,12 +243,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FieldOptions_CType.Type.Values instead.
 var FieldOptions_CType_name = map[int32]string{
 	0: "STRING",
 	1: "CORD",
 	2: "STRING_PIECE",
 }
 
+// Deprecated: Use FieldOptions_CType.Type.Values instead.
 var FieldOptions_CType_value = map[string]int32{
 	"STRING":       0,
 	"CORD":         1,
@@ -249,24 +258,24 @@
 }
 
 func (x FieldOptions_CType) Enum() *FieldOptions_CType {
-	p := new(FieldOptions_CType)
-	*p = x
-	return p
+	return &x
 }
 
 func (x FieldOptions_CType) String() string {
-	return protoapi.EnumName(FieldOptions_CType_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error {
-	value, err := protoapi.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType")
+// Deprecated: Do not use.
+func (x *FieldOptions_CType) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = FieldOptions_CType(value)
+	*x = FieldOptions_CType(num)
 	return nil
 }
 
+// Deprecated: Use FieldOptions_CType.Type instead.
 func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{12, 0}
 }
@@ -289,12 +298,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use FieldOptions_JSType.Type.Values instead.
 var FieldOptions_JSType_name = map[int32]string{
 	0: "JS_NORMAL",
 	1: "JS_STRING",
 	2: "JS_NUMBER",
 }
 
+// Deprecated: Use FieldOptions_JSType.Type.Values instead.
 var FieldOptions_JSType_value = map[string]int32{
 	"JS_NORMAL": 0,
 	"JS_STRING": 1,
@@ -302,24 +313,24 @@
 }
 
 func (x FieldOptions_JSType) Enum() *FieldOptions_JSType {
-	p := new(FieldOptions_JSType)
-	*p = x
-	return p
+	return &x
 }
 
 func (x FieldOptions_JSType) String() string {
-	return protoapi.EnumName(FieldOptions_JSType_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error {
-	value, err := protoapi.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType")
+// Deprecated: Do not use.
+func (x *FieldOptions_JSType) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = FieldOptions_JSType(value)
+	*x = FieldOptions_JSType(num)
 	return nil
 }
 
+// Deprecated: Use FieldOptions_JSType.Type instead.
 func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{12, 1}
 }
@@ -342,12 +353,14 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use MethodOptions_IdempotencyLevel.Type.Values instead.
 var MethodOptions_IdempotencyLevel_name = map[int32]string{
 	0: "IDEMPOTENCY_UNKNOWN",
 	1: "NO_SIDE_EFFECTS",
 	2: "IDEMPOTENT",
 }
 
+// Deprecated: Use MethodOptions_IdempotencyLevel.Type.Values instead.
 var MethodOptions_IdempotencyLevel_value = map[string]int32{
 	"IDEMPOTENCY_UNKNOWN": 0,
 	"NO_SIDE_EFFECTS":     1,
@@ -355,24 +368,24 @@
 }
 
 func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel {
-	p := new(MethodOptions_IdempotencyLevel)
-	*p = x
-	return p
+	return &x
 }
 
 func (x MethodOptions_IdempotencyLevel) String() string {
-	return protoapi.EnumName(MethodOptions_IdempotencyLevel_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
-func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error {
-	value, err := protoapi.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel")
+// Deprecated: Do not use.
+func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(b []byte) error {
+	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
 	if err != nil {
 		return err
 	}
-	*x = MethodOptions_IdempotencyLevel(value)
+	*x = MethodOptions_IdempotencyLevel(num)
 	return nil
 }
 
+// Deprecated: Use MethodOptions_IdempotencyLevel.Type instead.
 func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{17, 0}
 }
@@ -392,6 +405,8 @@
 func (m *FileDescriptorSet) Reset()         { *m = FileDescriptorSet{} }
 func (m *FileDescriptorSet) String() string { return protoapi.CompactTextString(m) }
 func (*FileDescriptorSet) ProtoMessage()    {}
+
+// Deprecated: Use FileDescriptorSet.ProtoReflect.Type instead.
 func (*FileDescriptorSet) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{0}
 }
@@ -439,6 +454,8 @@
 func (m *FileDescriptorProto) Reset()         { *m = FileDescriptorProto{} }
 func (m *FileDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*FileDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use FileDescriptorProto.ProtoReflect.Type instead.
 func (*FileDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{1}
 }
@@ -552,6 +569,8 @@
 func (m *DescriptorProto) Reset()         { *m = DescriptorProto{} }
 func (m *DescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*DescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use DescriptorProto.ProtoReflect.Type instead.
 func (*DescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{2}
 }
@@ -641,6 +660,8 @@
 func (m *ExtensionRangeOptions) Reset()         { *m = ExtensionRangeOptions{} }
 func (m *ExtensionRangeOptions) String() string { return protoapi.CompactTextString(m) }
 func (*ExtensionRangeOptions) ProtoMessage()    {}
+
+// Deprecated: Use ExtensionRangeOptions.ProtoReflect.Type instead.
 func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{3}
 }
@@ -649,6 +670,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use ExtensionRangeOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*ExtensionRangeOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_ExtensionRangeOptions
 }
@@ -703,6 +725,8 @@
 func (m *FieldDescriptorProto) Reset()         { *m = FieldDescriptorProto{} }
 func (m *FieldDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*FieldDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use FieldDescriptorProto.ProtoReflect.Type instead.
 func (*FieldDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{4}
 }
@@ -792,6 +816,8 @@
 func (m *OneofDescriptorProto) Reset()         { *m = OneofDescriptorProto{} }
 func (m *OneofDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*OneofDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use OneofDescriptorProto.ProtoReflect.Type instead.
 func (*OneofDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{5}
 }
@@ -833,6 +859,8 @@
 func (m *EnumDescriptorProto) Reset()         { *m = EnumDescriptorProto{} }
 func (m *EnumDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*EnumDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use EnumDescriptorProto.ProtoReflect.Type instead.
 func (*EnumDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{6}
 }
@@ -888,6 +916,8 @@
 func (m *EnumValueDescriptorProto) Reset()         { *m = EnumValueDescriptorProto{} }
 func (m *EnumValueDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*EnumValueDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use EnumValueDescriptorProto.ProtoReflect.Type instead.
 func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{7}
 }
@@ -929,6 +959,8 @@
 func (m *ServiceDescriptorProto) Reset()         { *m = ServiceDescriptorProto{} }
 func (m *ServiceDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*ServiceDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use ServiceDescriptorProto.ProtoReflect.Type instead.
 func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{8}
 }
@@ -977,6 +1009,8 @@
 func (m *MethodDescriptorProto) Reset()         { *m = MethodDescriptorProto{} }
 func (m *MethodDescriptorProto) String() string { return protoapi.CompactTextString(m) }
 func (*MethodDescriptorProto) ProtoMessage()    {}
+
+// Deprecated: Use MethodDescriptorProto.ProtoReflect.Type instead.
 func (*MethodDescriptorProto) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{9}
 }
@@ -1123,6 +1157,8 @@
 func (m *FileOptions) Reset()         { *m = FileOptions{} }
 func (m *FileOptions) String() string { return protoapi.CompactTextString(m) }
 func (*FileOptions) ProtoMessage()    {}
+
+// Deprecated: Use FileOptions.ProtoReflect.Type instead.
 func (*FileOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{10}
 }
@@ -1131,6 +1167,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use FileOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*FileOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_FileOptions
 }
@@ -1358,6 +1395,8 @@
 func (m *MessageOptions) Reset()         { *m = MessageOptions{} }
 func (m *MessageOptions) String() string { return protoapi.CompactTextString(m) }
 func (*MessageOptions) ProtoMessage()    {}
+
+// Deprecated: Use MessageOptions.ProtoReflect.Type instead.
 func (*MessageOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{11}
 }
@@ -1366,6 +1405,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use MessageOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*MessageOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_MessageOptions
 }
@@ -1483,6 +1523,8 @@
 func (m *FieldOptions) Reset()         { *m = FieldOptions{} }
 func (m *FieldOptions) String() string { return protoapi.CompactTextString(m) }
 func (*FieldOptions) ProtoMessage()    {}
+
+// Deprecated: Use FieldOptions.ProtoReflect.Type instead.
 func (*FieldOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{12}
 }
@@ -1491,6 +1533,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use FieldOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*FieldOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_FieldOptions
 }
@@ -1565,6 +1608,8 @@
 func (m *OneofOptions) Reset()         { *m = OneofOptions{} }
 func (m *OneofOptions) String() string { return protoapi.CompactTextString(m) }
 func (*OneofOptions) ProtoMessage()    {}
+
+// Deprecated: Use OneofOptions.ProtoReflect.Type instead.
 func (*OneofOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{13}
 }
@@ -1573,6 +1618,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use OneofOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*OneofOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_OneofOptions
 }
@@ -1607,6 +1653,8 @@
 func (m *EnumOptions) Reset()         { *m = EnumOptions{} }
 func (m *EnumOptions) String() string { return protoapi.CompactTextString(m) }
 func (*EnumOptions) ProtoMessage()    {}
+
+// Deprecated: Use EnumOptions.ProtoReflect.Type instead.
 func (*EnumOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{14}
 }
@@ -1615,6 +1663,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use EnumOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*EnumOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_EnumOptions
 }
@@ -1662,6 +1711,8 @@
 func (m *EnumValueOptions) Reset()         { *m = EnumValueOptions{} }
 func (m *EnumValueOptions) String() string { return protoapi.CompactTextString(m) }
 func (*EnumValueOptions) ProtoMessage()    {}
+
+// Deprecated: Use EnumValueOptions.ProtoReflect.Type instead.
 func (*EnumValueOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{15}
 }
@@ -1670,6 +1721,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use EnumValueOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*EnumValueOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_EnumValueOptions
 }
@@ -1710,6 +1762,8 @@
 func (m *ServiceOptions) Reset()         { *m = ServiceOptions{} }
 func (m *ServiceOptions) String() string { return protoapi.CompactTextString(m) }
 func (*ServiceOptions) ProtoMessage()    {}
+
+// Deprecated: Use ServiceOptions.ProtoReflect.Type instead.
 func (*ServiceOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{16}
 }
@@ -1718,6 +1772,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use ServiceOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*ServiceOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_ServiceOptions
 }
@@ -1759,6 +1814,8 @@
 func (m *MethodOptions) Reset()         { *m = MethodOptions{} }
 func (m *MethodOptions) String() string { return protoapi.CompactTextString(m) }
 func (*MethodOptions) ProtoMessage()    {}
+
+// Deprecated: Use MethodOptions.ProtoReflect.Type instead.
 func (*MethodOptions) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{17}
 }
@@ -1767,6 +1824,7 @@
 	{Start: 1000, End: 536870911},
 }
 
+// Deprecated: Use MethodOptions.ProtoReflect.Type.ExtensionRanges instead.
 func (*MethodOptions) ExtensionRangeArray() []protoapi.ExtensionRange {
 	return extRange_MethodOptions
 }
@@ -1822,6 +1880,8 @@
 func (m *UninterpretedOption) Reset()         { *m = UninterpretedOption{} }
 func (m *UninterpretedOption) String() string { return protoapi.CompactTextString(m) }
 func (*UninterpretedOption) ProtoMessage()    {}
+
+// Deprecated: Use UninterpretedOption.ProtoReflect.Type instead.
 func (*UninterpretedOption) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{18}
 }
@@ -1933,6 +1993,8 @@
 func (m *SourceCodeInfo) Reset()         { *m = SourceCodeInfo{} }
 func (m *SourceCodeInfo) String() string { return protoapi.CompactTextString(m) }
 func (*SourceCodeInfo) ProtoMessage()    {}
+
+// Deprecated: Use SourceCodeInfo.ProtoReflect.Type instead.
 func (*SourceCodeInfo) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{19}
 }
@@ -1962,6 +2024,8 @@
 func (m *GeneratedCodeInfo) Reset()         { *m = GeneratedCodeInfo{} }
 func (m *GeneratedCodeInfo) String() string { return protoapi.CompactTextString(m) }
 func (*GeneratedCodeInfo) ProtoMessage()    {}
+
+// Deprecated: Use GeneratedCodeInfo.ProtoReflect.Type instead.
 func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{20}
 }
@@ -1988,6 +2052,8 @@
 func (m *DescriptorProto_ExtensionRange) Reset()         { *m = DescriptorProto_ExtensionRange{} }
 func (m *DescriptorProto_ExtensionRange) String() string { return protoapi.CompactTextString(m) }
 func (*DescriptorProto_ExtensionRange) ProtoMessage()    {}
+
+// Deprecated: Use DescriptorProto_ExtensionRange.ProtoReflect.Type instead.
 func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{2, 0}
 }
@@ -2030,6 +2096,8 @@
 func (m *DescriptorProto_ReservedRange) Reset()         { *m = DescriptorProto_ReservedRange{} }
 func (m *DescriptorProto_ReservedRange) String() string { return protoapi.CompactTextString(m) }
 func (*DescriptorProto_ReservedRange) ProtoMessage()    {}
+
+// Deprecated: Use DescriptorProto_ReservedRange.ProtoReflect.Type instead.
 func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{2, 1}
 }
@@ -2068,6 +2136,8 @@
 func (m *EnumDescriptorProto_EnumReservedRange) Reset()         { *m = EnumDescriptorProto_EnumReservedRange{} }
 func (m *EnumDescriptorProto_EnumReservedRange) String() string { return protoapi.CompactTextString(m) }
 func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage()    {}
+
+// Deprecated: Use EnumDescriptorProto_EnumReservedRange.ProtoReflect.Type instead.
 func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{6, 0}
 }
@@ -2105,6 +2175,8 @@
 func (m *UninterpretedOption_NamePart) Reset()         { *m = UninterpretedOption_NamePart{} }
 func (m *UninterpretedOption_NamePart) String() string { return protoapi.CompactTextString(m) }
 func (*UninterpretedOption_NamePart) ProtoMessage()    {}
+
+// Deprecated: Use UninterpretedOption_NamePart.ProtoReflect.Type instead.
 func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{18, 0}
 }
@@ -2215,6 +2287,8 @@
 func (m *SourceCodeInfo_Location) Reset()         { *m = SourceCodeInfo_Location{} }
 func (m *SourceCodeInfo_Location) String() string { return protoapi.CompactTextString(m) }
 func (*SourceCodeInfo_Location) ProtoMessage()    {}
+
+// Deprecated: Use SourceCodeInfo_Location.ProtoReflect.Type instead.
 func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{19, 0}
 }
@@ -2278,6 +2352,8 @@
 func (m *GeneratedCodeInfo_Annotation) Reset()         { *m = GeneratedCodeInfo_Annotation{} }
 func (m *GeneratedCodeInfo_Annotation) String() string { return protoapi.CompactTextString(m) }
 func (*GeneratedCodeInfo_Annotation) ProtoMessage()    {}
+
+// Deprecated: Use GeneratedCodeInfo_Annotation.ProtoReflect.Type instead.
 func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped, []int{20, 0}
 }
@@ -2311,40 +2387,40 @@
 }
 
 func init() {
-	protoapi.RegisterFile("google/protobuf/descriptor.proto", xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped)
-	protoapi.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
-	protoapi.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
-	protoapi.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
-	protoapi.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
-	protoapi.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
-	protoapi.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
-	protoapi.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet")
-	protoapi.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto")
-	protoapi.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto")
-	protoapi.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions")
-	protoapi.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto")
-	protoapi.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto")
-	protoapi.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto")
-	protoapi.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto")
-	protoapi.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto")
-	protoapi.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto")
-	protoapi.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions")
-	protoapi.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions")
-	protoapi.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions")
-	protoapi.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions")
-	protoapi.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions")
-	protoapi.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions")
-	protoapi.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions")
-	protoapi.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions")
-	protoapi.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption")
-	protoapi.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo")
-	protoapi.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo")
-	protoapi.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange")
-	protoapi.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange")
-	protoapi.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange")
-	protoapi.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart")
-	protoapi.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location")
-	protoapi.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation")
+	proto.RegisterFile("google/protobuf/descriptor.proto", xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped)
+	proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
+	proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
+	proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
+	proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
+	proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
+	proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
+	proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet")
+	proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto")
+	proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto")
+	proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions")
+	proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto")
+	proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto")
+	proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto")
+	proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto")
+	proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto")
+	proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto")
+	proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions")
+	proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions")
+	proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions")
+	proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions")
+	proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions")
+	proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions")
+	proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions")
+	proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions")
+	proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption")
+	proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo")
+	proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo")
+	proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange")
+	proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange")
+	proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange")
+	proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart")
+	proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location")
+	proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation")
 }
 
 var xxx_File_google_protobuf_descriptor_proto_rawdesc = []byte{
@@ -2825,7 +2901,7 @@
 	0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
 }
 
-var xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_descriptor_proto_rawdesc)
+var xxx_File_google_protobuf_descriptor_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_descriptor_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/any.pb.go b/types/known/any.pb.go
index 7957088..b1a3ac5 100644
--- a/types/known/any.pb.go
+++ b/types/known/any.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // `Any` contains an arbitrary serialized protocol buffer message along with a
 // URL that describes the type of the serialized message.
 //
@@ -140,6 +133,8 @@
 func (m *Any) Reset()         { *m = Any{} }
 func (m *Any) String() string { return proto.CompactTextString(m) }
 func (*Any) ProtoMessage()    {}
+
+// Deprecated: Use Any.ProtoReflect.Type instead.
 func (*Any) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_any_proto_rawdesc_gzipped, []int{0}
 }
@@ -202,7 +197,7 @@
 	0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_any_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_any_proto_rawdesc)
+var xxx_File_google_protobuf_any_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_any_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/api.pb.go b/types/known/api.pb.go
index 6f6fa85..5505165 100644
--- a/types/known/api.pb.go
+++ b/types/known/api.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // Api is a light-weight descriptor for an API Interface.
 //
 // Interfaces are also described as "protocol buffer services" in some contexts,
@@ -74,6 +67,8 @@
 func (m *Api) Reset()         { *m = Api{} }
 func (m *Api) String() string { return proto.CompactTextString(m) }
 func (*Api) ProtoMessage()    {}
+
+// Deprecated: Use Api.ProtoReflect.Type instead.
 func (*Api) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_api_proto_rawdesc_gzipped, []int{0}
 }
@@ -172,6 +167,8 @@
 func (m *Method) Reset()         { *m = Method{} }
 func (m *Method) String() string { return proto.CompactTextString(m) }
 func (*Method) ProtoMessage()    {}
+
+// Deprecated: Use Method.ProtoReflect.Type instead.
 func (*Method) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_api_proto_rawdesc_gzipped, []int{1}
 }
@@ -338,6 +335,8 @@
 func (m *Mixin) Reset()         { *m = Mixin{} }
 func (m *Mixin) String() string { return proto.CompactTextString(m) }
 func (*Mixin) ProtoMessage()    {}
+
+// Deprecated: Use Mixin.ProtoReflect.Type instead.
 func (*Mixin) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_api_proto_rawdesc_gzipped, []int{2}
 }
@@ -444,7 +443,7 @@
 	0x33,
 }
 
-var xxx_File_google_protobuf_api_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_api_proto_rawdesc)
+var xxx_File_google_protobuf_api_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_api_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/duration.pb.go b/types/known/duration.pb.go
index 5dde1ca..8fc3702 100644
--- a/types/known/duration.pb.go
+++ b/types/known/duration.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // A Duration represents a signed, fixed-length span of time represented
 // as a count of seconds and fractions of seconds at nanosecond
 // resolution. It is independent of any calendar and concepts like "day"
@@ -100,6 +93,8 @@
 func (m *Duration) Reset()         { *m = Duration{} }
 func (m *Duration) String() string { return proto.CompactTextString(m) }
 func (*Duration) ProtoMessage()    {}
+
+// Deprecated: Use Duration.ProtoReflect.Type instead.
 func (*Duration) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_duration_proto_rawdesc_gzipped, []int{0}
 }
@@ -163,7 +158,7 @@
 	0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_duration_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_duration_proto_rawdesc)
+var xxx_File_google_protobuf_duration_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_duration_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/empty.pb.go b/types/known/empty.pb.go
index 18da25b..021ee95 100644
--- a/types/known/empty.pb.go
+++ b/types/known/empty.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // A generic empty message that you can re-use to avoid defining duplicated
 // empty messages in your APIs. A typical example is to use it as the request
 // or the response type of an API method. For instance:
@@ -38,6 +31,8 @@
 func (m *Empty) Reset()         { *m = Empty{} }
 func (m *Empty) String() string { return proto.CompactTextString(m) }
 func (*Empty) ProtoMessage()    {}
+
+// Deprecated: Use Empty.ProtoReflect.Type instead.
 func (*Empty) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_empty_proto_rawdesc_gzipped, []int{0}
 }
@@ -84,7 +79,7 @@
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_empty_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_empty_proto_rawdesc)
+var xxx_File_google_protobuf_empty_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_empty_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/field_mask.pb.go b/types/known/field_mask.pb.go
index 22e4da8..9fee8aa 100644
--- a/types/known/field_mask.pb.go
+++ b/types/known/field_mask.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // `FieldMask` represents a set of symbolic field paths, for example:
 //
 //     paths: "f.a"
@@ -230,6 +223,8 @@
 func (m *FieldMask) Reset()         { *m = FieldMask{} }
 func (m *FieldMask) String() string { return proto.CompactTextString(m) }
 func (*FieldMask) ProtoMessage()    {}
+
+// Deprecated: Use FieldMask.ProtoReflect.Type instead.
 func (*FieldMask) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_field_mask_proto_rawdesc_gzipped, []int{0}
 }
@@ -283,7 +278,7 @@
 	0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_field_mask_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_field_mask_proto_rawdesc)
+var xxx_File_google_protobuf_field_mask_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_field_mask_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/source_context.pb.go b/types/known/source_context.pb.go
index d24b671..292ef04 100644
--- a/types/known/source_context.pb.go
+++ b/types/known/source_context.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // `SourceContext` represents information about the source of a
 // protobuf element, like the file in which it is defined.
 type SourceContext struct {
@@ -34,6 +27,8 @@
 func (m *SourceContext) Reset()         { *m = SourceContext{} }
 func (m *SourceContext) String() string { return proto.CompactTextString(m) }
 func (*SourceContext) ProtoMessage()    {}
+
+// Deprecated: Use SourceContext.ProtoReflect.Type instead.
 func (*SourceContext) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_source_context_proto_rawdesc_gzipped, []int{0}
 }
@@ -88,7 +83,7 @@
 	0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_source_context_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_source_context_proto_rawdesc)
+var xxx_File_google_protobuf_source_context_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_source_context_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/struct.pb.go b/types/known/struct.pb.go
index 7524f07..c064f59 100644
--- a/types/known/struct.pb.go
+++ b/types/known/struct.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // `NullValue` is a singleton enumeration to represent the null value for the
 // `Value` type union.
 //
@@ -35,18 +28,21 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use NullValue.Type.Values instead.
 var NullValue_name = map[int32]string{
 	0: "NULL_VALUE",
 }
 
+// Deprecated: Use NullValue.Type.Values instead.
 var NullValue_value = map[string]int32{
 	"NULL_VALUE": 0,
 }
 
 func (x NullValue) String() string {
-	return proto.EnumName(NullValue_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use NullValue.Type instead.
 func (NullValue) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_struct_proto_rawdesc_gzipped, []int{0}
 }
@@ -75,6 +71,8 @@
 func (m *Struct) Reset()         { *m = Struct{} }
 func (m *Struct) String() string { return proto.CompactTextString(m) }
 func (*Struct) ProtoMessage()    {}
+
+// Deprecated: Use Struct.ProtoReflect.Type instead.
 func (*Struct) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_struct_proto_rawdesc_gzipped, []int{0}
 }
@@ -140,6 +138,8 @@
 func (m *Value) Reset()         { *m = Value{} }
 func (m *Value) String() string { return proto.CompactTextString(m) }
 func (*Value) ProtoMessage()    {}
+
+// Deprecated: Use Value.ProtoReflect.Type instead.
 func (*Value) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_struct_proto_rawdesc_gzipped, []int{1}
 }
@@ -282,6 +282,8 @@
 func (m *ListValue) Reset()         { *m = ListValue{} }
 func (m *ListValue) String() string { return proto.CompactTextString(m) }
 func (*ListValue) ProtoMessage()    {}
+
+// Deprecated: Use ListValue.ProtoReflect.Type instead.
 func (*ListValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_struct_proto_rawdesc_gzipped, []int{2}
 }
@@ -373,7 +375,7 @@
 	0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_struct_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_struct_proto_rawdesc)
+var xxx_File_google_protobuf_struct_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_struct_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/timestamp.pb.go b/types/known/timestamp.pb.go
index d4e34ab..422dfb5 100644
--- a/types/known/timestamp.pb.go
+++ b/types/known/timestamp.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // A Timestamp represents a point in time independent of any time zone or local
 // calendar, encoded as a count of seconds and fractions of seconds at
 // nanosecond resolution. The count is relative to an epoch at UTC midnight on
@@ -120,6 +113,8 @@
 func (m *Timestamp) Reset()         { *m = Timestamp{} }
 func (m *Timestamp) String() string { return proto.CompactTextString(m) }
 func (*Timestamp) ProtoMessage()    {}
+
+// Deprecated: Use Timestamp.ProtoReflect.Type instead.
 func (*Timestamp) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_timestamp_proto_rawdesc_gzipped, []int{0}
 }
@@ -184,7 +179,7 @@
 	0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_timestamp_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_timestamp_proto_rawdesc)
+var xxx_File_google_protobuf_timestamp_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_timestamp_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/type.pb.go b/types/known/type.pb.go
index 967b770..8e76708 100644
--- a/types/known/type.pb.go
+++ b/types/known/type.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // The syntax in which a protocol buffer element is defined.
 type Syntax int32
 
@@ -34,20 +27,23 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Syntax.Type.Values instead.
 var Syntax_name = map[int32]string{
 	0: "SYNTAX_PROTO2",
 	1: "SYNTAX_PROTO3",
 }
 
+// Deprecated: Use Syntax.Type.Values instead.
 var Syntax_value = map[string]int32{
 	"SYNTAX_PROTO2": 0,
 	"SYNTAX_PROTO3": 1,
 }
 
 func (x Syntax) String() string {
-	return proto.EnumName(Syntax_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Syntax.Type instead.
 func (Syntax) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{0}
 }
@@ -103,6 +99,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Field_Kind.Type.Values instead.
 var Field_Kind_name = map[int32]string{
 	0:  "TYPE_UNKNOWN",
 	1:  "TYPE_DOUBLE",
@@ -125,6 +122,7 @@
 	18: "TYPE_SINT64",
 }
 
+// Deprecated: Use Field_Kind.Type.Values instead.
 var Field_Kind_value = map[string]int32{
 	"TYPE_UNKNOWN":  0,
 	"TYPE_DOUBLE":   1,
@@ -148,9 +146,10 @@
 }
 
 func (x Field_Kind) String() string {
-	return proto.EnumName(Field_Kind_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Field_Kind.Type instead.
 func (Field_Kind) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{1, 0}
 }
@@ -176,6 +175,7 @@
 	return protoreflect.EnumNumber(e)
 }
 
+// Deprecated: Use Field_Cardinality.Type.Values instead.
 var Field_Cardinality_name = map[int32]string{
 	0: "CARDINALITY_UNKNOWN",
 	1: "CARDINALITY_OPTIONAL",
@@ -183,6 +183,7 @@
 	3: "CARDINALITY_REPEATED",
 }
 
+// Deprecated: Use Field_Cardinality.Type.Values instead.
 var Field_Cardinality_value = map[string]int32{
 	"CARDINALITY_UNKNOWN":  0,
 	"CARDINALITY_OPTIONAL": 1,
@@ -191,9 +192,10 @@
 }
 
 func (x Field_Cardinality) String() string {
-	return proto.EnumName(Field_Cardinality_name, int32(x))
+	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+// Deprecated: Use Field_Cardinality.Type instead.
 func (Field_Cardinality) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{1, 1}
 }
@@ -223,6 +225,8 @@
 func (m *Type) Reset()         { *m = Type{} }
 func (m *Type) String() string { return proto.CompactTextString(m) }
 func (*Type) ProtoMessage()    {}
+
+// Deprecated: Use Type.ProtoReflect.Type instead.
 func (*Type) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{0}
 }
@@ -322,6 +326,8 @@
 func (m *Field) Reset()         { *m = Field{} }
 func (m *Field) String() string { return proto.CompactTextString(m) }
 func (*Field) ProtoMessage()    {}
+
+// Deprecated: Use Field.ProtoReflect.Type instead.
 func (*Field) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{1}
 }
@@ -437,6 +443,8 @@
 func (m *Enum) Reset()         { *m = Enum{} }
 func (m *Enum) String() string { return proto.CompactTextString(m) }
 func (*Enum) ProtoMessage()    {}
+
+// Deprecated: Use Enum.ProtoReflect.Type instead.
 func (*Enum) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{2}
 }
@@ -513,6 +521,8 @@
 func (m *EnumValue) Reset()         { *m = EnumValue{} }
 func (m *EnumValue) String() string { return proto.CompactTextString(m) }
 func (*EnumValue) ProtoMessage()    {}
+
+// Deprecated: Use EnumValue.ProtoReflect.Type instead.
 func (*EnumValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{3}
 }
@@ -580,6 +590,8 @@
 func (m *Option) Reset()         { *m = Option{} }
 func (m *Option) String() string { return proto.CompactTextString(m) }
 func (*Option) ProtoMessage()    {}
+
+// Deprecated: Use Option.ProtoReflect.Type instead.
 func (*Option) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawdesc_gzipped, []int{4}
 }
@@ -747,7 +759,7 @@
 	0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_type_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_type_proto_rawdesc)
+var xxx_File_google_protobuf_type_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_type_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/known/wrappers.pb.go b/types/known/wrappers.pb.go
index 03357e9..dcf9780 100644
--- a/types/known/wrappers.pb.go
+++ b/types/known/wrappers.pb.go
@@ -5,18 +5,11 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // Wrapper message for `double`.
 //
 // The JSON representation for `DoubleValue` is JSON number.
@@ -34,6 +27,8 @@
 func (m *DoubleValue) Reset()         { *m = DoubleValue{} }
 func (m *DoubleValue) String() string { return proto.CompactTextString(m) }
 func (*DoubleValue) ProtoMessage()    {}
+
+// Deprecated: Use DoubleValue.ProtoReflect.Type instead.
 func (*DoubleValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{0}
 }
@@ -82,6 +77,8 @@
 func (m *FloatValue) Reset()         { *m = FloatValue{} }
 func (m *FloatValue) String() string { return proto.CompactTextString(m) }
 func (*FloatValue) ProtoMessage()    {}
+
+// Deprecated: Use FloatValue.ProtoReflect.Type instead.
 func (*FloatValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{1}
 }
@@ -130,6 +127,8 @@
 func (m *Int64Value) Reset()         { *m = Int64Value{} }
 func (m *Int64Value) String() string { return proto.CompactTextString(m) }
 func (*Int64Value) ProtoMessage()    {}
+
+// Deprecated: Use Int64Value.ProtoReflect.Type instead.
 func (*Int64Value) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{2}
 }
@@ -178,6 +177,8 @@
 func (m *UInt64Value) Reset()         { *m = UInt64Value{} }
 func (m *UInt64Value) String() string { return proto.CompactTextString(m) }
 func (*UInt64Value) ProtoMessage()    {}
+
+// Deprecated: Use UInt64Value.ProtoReflect.Type instead.
 func (*UInt64Value) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{3}
 }
@@ -226,6 +227,8 @@
 func (m *Int32Value) Reset()         { *m = Int32Value{} }
 func (m *Int32Value) String() string { return proto.CompactTextString(m) }
 func (*Int32Value) ProtoMessage()    {}
+
+// Deprecated: Use Int32Value.ProtoReflect.Type instead.
 func (*Int32Value) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{4}
 }
@@ -274,6 +277,8 @@
 func (m *UInt32Value) Reset()         { *m = UInt32Value{} }
 func (m *UInt32Value) String() string { return proto.CompactTextString(m) }
 func (*UInt32Value) ProtoMessage()    {}
+
+// Deprecated: Use UInt32Value.ProtoReflect.Type instead.
 func (*UInt32Value) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{5}
 }
@@ -322,6 +327,8 @@
 func (m *BoolValue) Reset()         { *m = BoolValue{} }
 func (m *BoolValue) String() string { return proto.CompactTextString(m) }
 func (*BoolValue) ProtoMessage()    {}
+
+// Deprecated: Use BoolValue.ProtoReflect.Type instead.
 func (*BoolValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{6}
 }
@@ -370,6 +377,8 @@
 func (m *StringValue) Reset()         { *m = StringValue{} }
 func (m *StringValue) String() string { return proto.CompactTextString(m) }
 func (*StringValue) ProtoMessage()    {}
+
+// Deprecated: Use StringValue.ProtoReflect.Type instead.
 func (*StringValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{7}
 }
@@ -418,6 +427,8 @@
 func (m *BytesValue) Reset()         { *m = BytesValue{} }
 func (m *BytesValue) String() string { return proto.CompactTextString(m) }
 func (*BytesValue) ProtoMessage()    {}
+
+// Deprecated: Use BytesValue.ProtoReflect.Type instead.
 func (*BytesValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped, []int{8}
 }
@@ -499,7 +510,7 @@
 	0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
-var xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_wrappers_proto_rawdesc)
+var xxx_File_google_protobuf_wrappers_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_wrappers_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/types/plugin/plugin.pb.go b/types/plugin/plugin.pb.go
index d425f5a..ab9ae91 100644
--- a/types/plugin/plugin.pb.go
+++ b/types/plugin/plugin.pb.go
@@ -5,19 +5,12 @@
 
 import (
 	proto "github.com/golang/protobuf/proto"
-	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	descriptor "github.com/golang/protobuf/v2/types/descriptor"
 	reflect "reflect"
 )
 
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
 // The version number of protocol compiler.
 type Version struct {
 	Major *int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"`
@@ -37,6 +30,8 @@
 func (m *Version) Reset()         { *m = Version{} }
 func (m *Version) String() string { return proto.CompactTextString(m) }
 func (*Version) ProtoMessage()    {}
+
+// Deprecated: Use Version.ProtoReflect.Type instead.
 func (*Version) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawdesc_gzipped, []int{0}
 }
@@ -123,6 +118,8 @@
 func (m *CodeGeneratorRequest) Reset()         { *m = CodeGeneratorRequest{} }
 func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
 func (*CodeGeneratorRequest) ProtoMessage()    {}
+
+// Deprecated: Use CodeGeneratorRequest.ProtoReflect.Type instead.
 func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawdesc_gzipped, []int{1}
 }
@@ -196,6 +193,8 @@
 func (m *CodeGeneratorResponse) Reset()         { *m = CodeGeneratorResponse{} }
 func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
 func (*CodeGeneratorResponse) ProtoMessage()    {}
+
+// Deprecated: Use CodeGeneratorResponse.ProtoReflect.Type instead.
 func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawdesc_gzipped, []int{2}
 }
@@ -297,6 +296,8 @@
 func (m *CodeGeneratorResponse_File) Reset()         { *m = CodeGeneratorResponse_File{} }
 func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
 func (*CodeGeneratorResponse_File) ProtoMessage()    {}
+
+// Deprecated: Use CodeGeneratorResponse_File.ProtoReflect.Type instead.
 func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawdesc_gzipped, []int{2, 0}
 }
@@ -400,7 +401,7 @@
 	0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 }
 
-var xxx_File_google_protobuf_compiler_plugin_proto_rawdesc_gzipped = protoapi.CompressGZIP(xxx_File_google_protobuf_compiler_plugin_proto_rawdesc)
+var xxx_File_google_protobuf_compiler_plugin_proto_rawdesc_gzipped = protoimpl.X.CompressGZIP(xxx_File_google_protobuf_compiler_plugin_proto_rawdesc)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)