@@ -24,6 +24,11 @@ if sys.version_info >= (3, 10):
2424else :
2525 import typing_extensions as _typing_extensions
2626
27+ if sys .version_info >= (3 , 13 ):
28+ from warnings import deprecated as _deprecated
29+ else :
30+ from typing_extensions import deprecated as _deprecated
31+
2732DESCRIPTOR : _google_protobuf_descriptor .FileDescriptor
2833
2934class _Edition :
@@ -979,8 +984,16 @@ class FileOptions(_google_protobuf_message.Message):
979984 generated to contain the file's getDescriptor() method as well as any
980985 top-level extensions defined in the file.
981986 """
982- java_generate_equals_and_hash : _builtins .bool
983- """This option does nothing."""
987+ @_builtins .property
988+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
989+ def java_generate_equals_and_hash (self ) -> _builtins .bool :
990+ """This option does nothing."""
991+
992+ @java_generate_equals_and_hash .setter
993+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
994+ def java_generate_equals_and_hash (self , value : _builtins .bool ) -> None :
995+ """This option does nothing."""
996+
984997 java_string_check_utf8 : _builtins .bool
985998 """A proto2 file can set this to true to opt in to UTF-8 checking for Java,
986999 which will throw an exception if invalid UTF-8 is parsed from the wire or
@@ -1167,18 +1180,36 @@ class MessageOptions(_google_protobuf_message.Message):
11671180 instead. The option should only be implicitly set by the proto compiler
11681181 parser.
11691182 """
1170- deprecated_legacy_json_field_conflicts : _builtins .bool
1171- """Enable the legacy handling of JSON field name conflicts. This lowercases
1172- and strips underscored from the fields before comparison in proto3 only.
1173- The new behavior takes `json_name` into account and applies to proto2 as
1174- well.
1183+ @_builtins .property
1184+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
1185+ def deprecated_legacy_json_field_conflicts (self ) -> _builtins .bool :
1186+ """Enable the legacy handling of JSON field name conflicts. This lowercases
1187+ and strips underscored from the fields before comparison in proto3 only.
1188+ The new behavior takes `json_name` into account and applies to proto2 as
1189+ well.
1190+
1191+ This should only be used as a temporary measure against broken builds due
1192+ to the change in behavior for JSON field name conflicts.
1193+
1194+ TODO This is legacy behavior we plan to remove once downstream
1195+ teams have had time to migrate.
1196+ """
11751197
1176- This should only be used as a temporary measure against broken builds due
1177- to the change in behavior for JSON field name conflicts.
1198+ @deprecated_legacy_json_field_conflicts .setter
1199+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
1200+ def deprecated_legacy_json_field_conflicts (self , value : _builtins .bool ) -> None :
1201+ """Enable the legacy handling of JSON field name conflicts. This lowercases
1202+ and strips underscored from the fields before comparison in proto3 only.
1203+ The new behavior takes `json_name` into account and applies to proto2 as
1204+ well.
1205+
1206+ This should only be used as a temporary measure against broken builds due
1207+ to the change in behavior for JSON field name conflicts.
1208+
1209+ TODO This is legacy behavior we plan to remove once downstream
1210+ teams have had time to migrate.
1211+ """
11781212
1179- TODO This is legacy behavior we plan to remove once downstream
1180- teams have had time to migrate.
1181- """
11821213 @_builtins .property
11831214 def features (self ) -> Global___FeatureSet :
11841215 """Any features defined in the specific edition.
@@ -1463,10 +1494,20 @@ class FieldOptions(_google_protobuf_message.Message):
14631494 for accessors, or it will be completely ignored; in the very least, this
14641495 is a formalization for deprecating fields.
14651496 """
1466- weak : _builtins .bool
1467- """DEPRECATED. DO NOT USE!
1468- For Google-internal migration only. Do not use.
1469- """
1497+ @_builtins .property
1498+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
1499+ def weak (self ) -> _builtins .bool :
1500+ """DEPRECATED. DO NOT USE!
1501+ For Google-internal migration only. Do not use.
1502+ """
1503+
1504+ @weak .setter
1505+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
1506+ def weak (self , value : _builtins .bool ) -> None :
1507+ """DEPRECATED. DO NOT USE!
1508+ For Google-internal migration only. Do not use.
1509+ """
1510+
14701511 debug_redact : _builtins .bool
14711512 """Indicate that the field value should not be printed out when using debug
14721513 formats, e.g. when the field contains sensitive credentials.
@@ -1565,14 +1606,28 @@ class EnumOptions(_google_protobuf_message.Message):
15651606 for the enum, or it will be completely ignored; in the very least, this
15661607 is a formalization for deprecating enums.
15671608 """
1568- deprecated_legacy_json_field_conflicts : _builtins .bool
1569- """Enable the legacy handling of JSON field name conflicts. This lowercases
1570- and strips underscored from the fields before comparison in proto3 only.
1571- The new behavior takes `json_name` into account and applies to proto2 as
1572- well.
1573- TODO Remove this legacy behavior once downstream teams have
1574- had time to migrate.
1575- """
1609+ @_builtins .property
1610+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
1611+ def deprecated_legacy_json_field_conflicts (self ) -> _builtins .bool :
1612+ """Enable the legacy handling of JSON field name conflicts. This lowercases
1613+ and strips underscored from the fields before comparison in proto3 only.
1614+ The new behavior takes `json_name` into account and applies to proto2 as
1615+ well.
1616+ TODO Remove this legacy behavior once downstream teams have
1617+ had time to migrate.
1618+ """
1619+
1620+ @deprecated_legacy_json_field_conflicts .setter
1621+ @_deprecated ("""This field has been marked as deprecated using proto field options.""" )
1622+ def deprecated_legacy_json_field_conflicts (self , value : _builtins .bool ) -> None :
1623+ """Enable the legacy handling of JSON field name conflicts. This lowercases
1624+ and strips underscored from the fields before comparison in proto3 only.
1625+ The new behavior takes `json_name` into account and applies to proto2 as
1626+ well.
1627+ TODO Remove this legacy behavior once downstream teams have
1628+ had time to migrate.
1629+ """
1630+
15761631 @_builtins .property
15771632 def features (self ) -> Global___FeatureSet :
15781633 """Any features defined in the specific edition.
0 commit comments