@@ -103,6 +103,31 @@ support a new edition.
103103"""
104104global___Edition = Edition
105105
106+ class _SymbolVisibility :
107+ ValueType = typing .NewType ("ValueType" , builtins .int )
108+ V : typing_extensions .TypeAlias = ValueType
109+
110+ class _SymbolVisibilityEnumTypeWrapper (
111+ google .protobuf .internal .enum_type_wrapper ._EnumTypeWrapper [_SymbolVisibility .ValueType ], builtins .type
112+ ):
113+ DESCRIPTOR : google .protobuf .descriptor .EnumDescriptor
114+ VISIBILITY_UNSET : _SymbolVisibility .ValueType # 0
115+ VISIBILITY_LOCAL : _SymbolVisibility .ValueType # 1
116+ VISIBILITY_EXPORT : _SymbolVisibility .ValueType # 2
117+
118+ class SymbolVisibility (_SymbolVisibility , metaclass = _SymbolVisibilityEnumTypeWrapper ):
119+ """Describes the 'visibility' of a symbol with respect to the proto import
120+ system. Symbols can only be imported when the visibility rules do not prevent
121+ it (ex: local symbols cannot be imported). Visibility modifiers can only set
122+ on `message` and `enum` as they are the only types available to be referenced
123+ from other files.
124+ """
125+
126+ VISIBILITY_UNSET : SymbolVisibility .ValueType # 0
127+ VISIBILITY_LOCAL : SymbolVisibility .ValueType # 1
128+ VISIBILITY_EXPORT : SymbolVisibility .ValueType # 2
129+ global___SymbolVisibility = SymbolVisibility
130+
106131@typing .final
107132class FileDescriptorSet (google .protobuf .message .Message ):
108133 """The protocol compiler can output a FileDescriptorSet containing the .proto
@@ -130,6 +155,7 @@ class FileDescriptorProto(google.protobuf.message.Message):
130155 DEPENDENCY_FIELD_NUMBER : builtins .int
131156 PUBLIC_DEPENDENCY_FIELD_NUMBER : builtins .int
132157 WEAK_DEPENDENCY_FIELD_NUMBER : builtins .int
158+ OPTION_DEPENDENCY_FIELD_NUMBER : builtins .int
133159 MESSAGE_TYPE_FIELD_NUMBER : builtins .int
134160 ENUM_TYPE_FIELD_NUMBER : builtins .int
135161 SERVICE_FIELD_NUMBER : builtins .int
@@ -171,6 +197,12 @@ class FileDescriptorProto(google.protobuf.message.Message):
171197 For Google-internal migration only. Do not use.
172198 """
173199
200+ @property
201+ def option_dependency (self ) -> google .protobuf .internal .containers .RepeatedScalarFieldContainer [builtins .str ]:
202+ """Names of files imported by this file purely for the purpose of providing
203+ option extensions. These are excluded from the dependency list above.
204+ """
205+
174206 @property
175207 def message_type (self ) -> google .protobuf .internal .containers .RepeatedCompositeFieldContainer [global___DescriptorProto ]:
176208 """All top-level definitions in this file."""
@@ -199,6 +231,7 @@ class FileDescriptorProto(google.protobuf.message.Message):
199231 dependency : collections .abc .Iterable [builtins .str ] | None = ...,
200232 public_dependency : collections .abc .Iterable [builtins .int ] | None = ...,
201233 weak_dependency : collections .abc .Iterable [builtins .int ] | None = ...,
234+ option_dependency : collections .abc .Iterable [builtins .str ] | None = ...,
202235 message_type : collections .abc .Iterable [global___DescriptorProto ] | None = ...,
203236 enum_type : collections .abc .Iterable [global___EnumDescriptorProto ] | None = ...,
204237 service : collections .abc .Iterable [global___ServiceDescriptorProto ] | None = ...,
@@ -240,6 +273,8 @@ class FileDescriptorProto(google.protobuf.message.Message):
240273 b"message_type" ,
241274 "name" ,
242275 b"name" ,
276+ "option_dependency" ,
277+ b"option_dependency" ,
243278 "options" ,
244279 b"options" ,
245280 "package" ,
@@ -319,7 +354,10 @@ class DescriptorProto(google.protobuf.message.Message):
319354 OPTIONS_FIELD_NUMBER : builtins .int
320355 RESERVED_RANGE_FIELD_NUMBER : builtins .int
321356 RESERVED_NAME_FIELD_NUMBER : builtins .int
357+ VISIBILITY_FIELD_NUMBER : builtins .int
322358 name : builtins .str
359+ visibility : global___SymbolVisibility .ValueType
360+ """Support for `export` and `local` keywords on enums."""
323361 @property
324362 def field (self ) -> google .protobuf .internal .containers .RepeatedCompositeFieldContainer [global___FieldDescriptorProto ]: ...
325363 @property
@@ -361,8 +399,11 @@ class DescriptorProto(google.protobuf.message.Message):
361399 options : global___MessageOptions | None = ...,
362400 reserved_range : collections .abc .Iterable [global___DescriptorProto .ReservedRange ] | None = ...,
363401 reserved_name : collections .abc .Iterable [builtins .str ] | None = ...,
402+ visibility : global___SymbolVisibility .ValueType | None = ...,
364403 ) -> None : ...
365- def HasField (self , field_name : typing .Literal ["name" , b"name" , "options" , b"options" ]) -> builtins .bool : ...
404+ def HasField (
405+ self , field_name : typing .Literal ["name" , b"name" , "options" , b"options" , "visibility" , b"visibility" ]
406+ ) -> builtins .bool : ...
366407 def ClearField (
367408 self ,
368409 field_name : typing .Literal [
@@ -386,6 +427,8 @@ class DescriptorProto(google.protobuf.message.Message):
386427 b"reserved_name" ,
387428 "reserved_range" ,
388429 b"reserved_range" ,
430+ "visibility" ,
431+ b"visibility" ,
389432 ],
390433 ) -> None : ...
391434
@@ -829,7 +872,10 @@ class EnumDescriptorProto(google.protobuf.message.Message):
829872 OPTIONS_FIELD_NUMBER : builtins .int
830873 RESERVED_RANGE_FIELD_NUMBER : builtins .int
831874 RESERVED_NAME_FIELD_NUMBER : builtins .int
875+ VISIBILITY_FIELD_NUMBER : builtins .int
832876 name : builtins .str
877+ visibility : global___SymbolVisibility .ValueType
878+ """Support for `export` and `local` keywords on enums."""
833879 @property
834880 def value (self ) -> google .protobuf .internal .containers .RepeatedCompositeFieldContainer [global___EnumValueDescriptorProto ]: ...
835881 @property
@@ -857,8 +903,11 @@ class EnumDescriptorProto(google.protobuf.message.Message):
857903 options : global___EnumOptions | None = ...,
858904 reserved_range : collections .abc .Iterable [global___EnumDescriptorProto .EnumReservedRange ] | None = ...,
859905 reserved_name : collections .abc .Iterable [builtins .str ] | None = ...,
906+ visibility : global___SymbolVisibility .ValueType | None = ...,
860907 ) -> None : ...
861- def HasField (self , field_name : typing .Literal ["name" , b"name" , "options" , b"options" ]) -> builtins .bool : ...
908+ def HasField (
909+ self , field_name : typing .Literal ["name" , b"name" , "options" , b"options" , "visibility" , b"visibility" ]
910+ ) -> builtins .bool : ...
862911 def ClearField (
863912 self ,
864913 field_name : typing .Literal [
@@ -872,6 +921,8 @@ class EnumDescriptorProto(google.protobuf.message.Message):
872921 b"reserved_range" ,
873922 "value" ,
874923 b"value" ,
924+ "visibility" ,
925+ b"visibility" ,
875926 ],
876927 ) -> None : ...
877928
@@ -1732,7 +1783,9 @@ class FieldOptions(google.protobuf.message.Message):
17321783 is a formalization for deprecating fields.
17331784 """
17341785 weak : builtins .bool
1735- """For Google-internal migration only. Do not use."""
1786+ """DEPRECATED. DO NOT USE!
1787+ For Google-internal migration only. Do not use.
1788+ """
17361789 debug_redact : builtins .bool
17371790 """Indicate that the field value should not be printed out when using debug
17381791 formats, e.g. when the field contains sensitive credentials.
@@ -2413,20 +2466,66 @@ class FeatureSet(google.protobuf.message.Message):
24132466 STYLE2024 : FeatureSet .EnforceNamingStyle .ValueType # 1
24142467 STYLE_LEGACY : FeatureSet .EnforceNamingStyle .ValueType # 2
24152468
2469+ @typing .final
2470+ class VisibilityFeature (google .protobuf .message .Message ):
2471+ DESCRIPTOR : google .protobuf .descriptor .Descriptor
2472+
2473+ class _DefaultSymbolVisibility :
2474+ ValueType = typing .NewType ("ValueType" , builtins .int )
2475+ V : typing_extensions .TypeAlias = ValueType
2476+
2477+ class _DefaultSymbolVisibilityEnumTypeWrapper (
2478+ google .protobuf .internal .enum_type_wrapper ._EnumTypeWrapper [
2479+ FeatureSet .VisibilityFeature ._DefaultSymbolVisibility .ValueType
2480+ ],
2481+ builtins .type ,
2482+ ):
2483+ DESCRIPTOR : google .protobuf .descriptor .EnumDescriptor
2484+ DEFAULT_SYMBOL_VISIBILITY_UNKNOWN : FeatureSet .VisibilityFeature ._DefaultSymbolVisibility .ValueType # 0
2485+ EXPORT_ALL : FeatureSet .VisibilityFeature ._DefaultSymbolVisibility .ValueType # 1
2486+ """Default pre-EDITION_2024, all UNSET visibility are export."""
2487+ EXPORT_TOP_LEVEL : FeatureSet .VisibilityFeature ._DefaultSymbolVisibility .ValueType # 2
2488+ """All top-level symbols default to export, nested default to local."""
2489+ LOCAL_ALL : FeatureSet .VisibilityFeature ._DefaultSymbolVisibility .ValueType # 3
2490+ """All symbols default to local."""
2491+ STRICT : FeatureSet .VisibilityFeature ._DefaultSymbolVisibility .ValueType # 4
2492+ """All symbols local by default. Nested types cannot be exported.
2493+ With special case caveat for message { enum {} reserved 1 to max; }
2494+ This is the recommended setting for new protos.
2495+ """
2496+
2497+ class DefaultSymbolVisibility (_DefaultSymbolVisibility , metaclass = _DefaultSymbolVisibilityEnumTypeWrapper ): ...
2498+ DEFAULT_SYMBOL_VISIBILITY_UNKNOWN : FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType # 0
2499+ EXPORT_ALL : FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType # 1
2500+ """Default pre-EDITION_2024, all UNSET visibility are export."""
2501+ EXPORT_TOP_LEVEL : FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType # 2
2502+ """All top-level symbols default to export, nested default to local."""
2503+ LOCAL_ALL : FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType # 3
2504+ """All symbols default to local."""
2505+ STRICT : FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType # 4
2506+ """All symbols local by default. Nested types cannot be exported.
2507+ With special case caveat for message { enum {} reserved 1 to max; }
2508+ This is the recommended setting for new protos.
2509+ """
2510+
2511+ def __init__ (self ) -> None : ...
2512+
24162513 FIELD_PRESENCE_FIELD_NUMBER : builtins .int
24172514 ENUM_TYPE_FIELD_NUMBER : builtins .int
24182515 REPEATED_FIELD_ENCODING_FIELD_NUMBER : builtins .int
24192516 UTF8_VALIDATION_FIELD_NUMBER : builtins .int
24202517 MESSAGE_ENCODING_FIELD_NUMBER : builtins .int
24212518 JSON_FORMAT_FIELD_NUMBER : builtins .int
24222519 ENFORCE_NAMING_STYLE_FIELD_NUMBER : builtins .int
2520+ DEFAULT_SYMBOL_VISIBILITY_FIELD_NUMBER : builtins .int
24232521 field_presence : global___FeatureSet .FieldPresence .ValueType
24242522 enum_type : global___FeatureSet .EnumType .ValueType
24252523 repeated_field_encoding : global___FeatureSet .RepeatedFieldEncoding .ValueType
24262524 utf8_validation : global___FeatureSet .Utf8Validation .ValueType
24272525 message_encoding : global___FeatureSet .MessageEncoding .ValueType
24282526 json_format : global___FeatureSet .JsonFormat .ValueType
24292527 enforce_naming_style : global___FeatureSet .EnforceNamingStyle .ValueType
2528+ default_symbol_visibility : global___FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType
24302529 def __init__ (
24312530 self ,
24322531 * ,
@@ -2437,10 +2536,13 @@ class FeatureSet(google.protobuf.message.Message):
24372536 message_encoding : global___FeatureSet .MessageEncoding .ValueType | None = ...,
24382537 json_format : global___FeatureSet .JsonFormat .ValueType | None = ...,
24392538 enforce_naming_style : global___FeatureSet .EnforceNamingStyle .ValueType | None = ...,
2539+ default_symbol_visibility : global___FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType | None = ...,
24402540 ) -> None : ...
24412541 def HasField (
24422542 self ,
24432543 field_name : typing .Literal [
2544+ "default_symbol_visibility" ,
2545+ b"default_symbol_visibility" ,
24442546 "enforce_naming_style" ,
24452547 b"enforce_naming_style" ,
24462548 "enum_type" ,
@@ -2460,6 +2562,8 @@ class FeatureSet(google.protobuf.message.Message):
24602562 def ClearField (
24612563 self ,
24622564 field_name : typing .Literal [
2565+ "default_symbol_visibility" ,
2566+ b"default_symbol_visibility" ,
24632567 "enforce_naming_style" ,
24642568 b"enforce_naming_style" ,
24652569 "enum_type" ,
0 commit comments