@@ -103,6 +103,31 @@ support a new edition.
103
103
"""
104
104
global___Edition = Edition
105
105
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
+
106
131
@typing .final
107
132
class FileDescriptorSet (google .protobuf .message .Message ):
108
133
"""The protocol compiler can output a FileDescriptorSet containing the .proto
@@ -130,6 +155,7 @@ class FileDescriptorProto(google.protobuf.message.Message):
130
155
DEPENDENCY_FIELD_NUMBER : builtins .int
131
156
PUBLIC_DEPENDENCY_FIELD_NUMBER : builtins .int
132
157
WEAK_DEPENDENCY_FIELD_NUMBER : builtins .int
158
+ OPTION_DEPENDENCY_FIELD_NUMBER : builtins .int
133
159
MESSAGE_TYPE_FIELD_NUMBER : builtins .int
134
160
ENUM_TYPE_FIELD_NUMBER : builtins .int
135
161
SERVICE_FIELD_NUMBER : builtins .int
@@ -171,6 +197,12 @@ class FileDescriptorProto(google.protobuf.message.Message):
171
197
For Google-internal migration only. Do not use.
172
198
"""
173
199
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
+
174
206
@property
175
207
def message_type (self ) -> google .protobuf .internal .containers .RepeatedCompositeFieldContainer [global___DescriptorProto ]:
176
208
"""All top-level definitions in this file."""
@@ -199,6 +231,7 @@ class FileDescriptorProto(google.protobuf.message.Message):
199
231
dependency : collections .abc .Iterable [builtins .str ] | None = ...,
200
232
public_dependency : collections .abc .Iterable [builtins .int ] | None = ...,
201
233
weak_dependency : collections .abc .Iterable [builtins .int ] | None = ...,
234
+ option_dependency : collections .abc .Iterable [builtins .str ] | None = ...,
202
235
message_type : collections .abc .Iterable [global___DescriptorProto ] | None = ...,
203
236
enum_type : collections .abc .Iterable [global___EnumDescriptorProto ] | None = ...,
204
237
service : collections .abc .Iterable [global___ServiceDescriptorProto ] | None = ...,
@@ -240,6 +273,8 @@ class FileDescriptorProto(google.protobuf.message.Message):
240
273
b"message_type" ,
241
274
"name" ,
242
275
b"name" ,
276
+ "option_dependency" ,
277
+ b"option_dependency" ,
243
278
"options" ,
244
279
b"options" ,
245
280
"package" ,
@@ -319,7 +354,10 @@ class DescriptorProto(google.protobuf.message.Message):
319
354
OPTIONS_FIELD_NUMBER : builtins .int
320
355
RESERVED_RANGE_FIELD_NUMBER : builtins .int
321
356
RESERVED_NAME_FIELD_NUMBER : builtins .int
357
+ VISIBILITY_FIELD_NUMBER : builtins .int
322
358
name : builtins .str
359
+ visibility : global___SymbolVisibility .ValueType
360
+ """Support for `export` and `local` keywords on enums."""
323
361
@property
324
362
def field (self ) -> google .protobuf .internal .containers .RepeatedCompositeFieldContainer [global___FieldDescriptorProto ]: ...
325
363
@property
@@ -361,8 +399,11 @@ class DescriptorProto(google.protobuf.message.Message):
361
399
options : global___MessageOptions | None = ...,
362
400
reserved_range : collections .abc .Iterable [global___DescriptorProto .ReservedRange ] | None = ...,
363
401
reserved_name : collections .abc .Iterable [builtins .str ] | None = ...,
402
+ visibility : global___SymbolVisibility .ValueType | None = ...,
364
403
) -> 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 : ...
366
407
def ClearField (
367
408
self ,
368
409
field_name : typing .Literal [
@@ -386,6 +427,8 @@ class DescriptorProto(google.protobuf.message.Message):
386
427
b"reserved_name" ,
387
428
"reserved_range" ,
388
429
b"reserved_range" ,
430
+ "visibility" ,
431
+ b"visibility" ,
389
432
],
390
433
) -> None : ...
391
434
@@ -829,7 +872,10 @@ class EnumDescriptorProto(google.protobuf.message.Message):
829
872
OPTIONS_FIELD_NUMBER : builtins .int
830
873
RESERVED_RANGE_FIELD_NUMBER : builtins .int
831
874
RESERVED_NAME_FIELD_NUMBER : builtins .int
875
+ VISIBILITY_FIELD_NUMBER : builtins .int
832
876
name : builtins .str
877
+ visibility : global___SymbolVisibility .ValueType
878
+ """Support for `export` and `local` keywords on enums."""
833
879
@property
834
880
def value (self ) -> google .protobuf .internal .containers .RepeatedCompositeFieldContainer [global___EnumValueDescriptorProto ]: ...
835
881
@property
@@ -857,8 +903,11 @@ class EnumDescriptorProto(google.protobuf.message.Message):
857
903
options : global___EnumOptions | None = ...,
858
904
reserved_range : collections .abc .Iterable [global___EnumDescriptorProto .EnumReservedRange ] | None = ...,
859
905
reserved_name : collections .abc .Iterable [builtins .str ] | None = ...,
906
+ visibility : global___SymbolVisibility .ValueType | None = ...,
860
907
) -> 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 : ...
862
911
def ClearField (
863
912
self ,
864
913
field_name : typing .Literal [
@@ -872,6 +921,8 @@ class EnumDescriptorProto(google.protobuf.message.Message):
872
921
b"reserved_range" ,
873
922
"value" ,
874
923
b"value" ,
924
+ "visibility" ,
925
+ b"visibility" ,
875
926
],
876
927
) -> None : ...
877
928
@@ -1732,7 +1783,9 @@ class FieldOptions(google.protobuf.message.Message):
1732
1783
is a formalization for deprecating fields.
1733
1784
"""
1734
1785
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
+ """
1736
1789
debug_redact : builtins .bool
1737
1790
"""Indicate that the field value should not be printed out when using debug
1738
1791
formats, e.g. when the field contains sensitive credentials.
@@ -2413,20 +2466,66 @@ class FeatureSet(google.protobuf.message.Message):
2413
2466
STYLE2024 : FeatureSet .EnforceNamingStyle .ValueType # 1
2414
2467
STYLE_LEGACY : FeatureSet .EnforceNamingStyle .ValueType # 2
2415
2468
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
+
2416
2513
FIELD_PRESENCE_FIELD_NUMBER : builtins .int
2417
2514
ENUM_TYPE_FIELD_NUMBER : builtins .int
2418
2515
REPEATED_FIELD_ENCODING_FIELD_NUMBER : builtins .int
2419
2516
UTF8_VALIDATION_FIELD_NUMBER : builtins .int
2420
2517
MESSAGE_ENCODING_FIELD_NUMBER : builtins .int
2421
2518
JSON_FORMAT_FIELD_NUMBER : builtins .int
2422
2519
ENFORCE_NAMING_STYLE_FIELD_NUMBER : builtins .int
2520
+ DEFAULT_SYMBOL_VISIBILITY_FIELD_NUMBER : builtins .int
2423
2521
field_presence : global___FeatureSet .FieldPresence .ValueType
2424
2522
enum_type : global___FeatureSet .EnumType .ValueType
2425
2523
repeated_field_encoding : global___FeatureSet .RepeatedFieldEncoding .ValueType
2426
2524
utf8_validation : global___FeatureSet .Utf8Validation .ValueType
2427
2525
message_encoding : global___FeatureSet .MessageEncoding .ValueType
2428
2526
json_format : global___FeatureSet .JsonFormat .ValueType
2429
2527
enforce_naming_style : global___FeatureSet .EnforceNamingStyle .ValueType
2528
+ default_symbol_visibility : global___FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType
2430
2529
def __init__ (
2431
2530
self ,
2432
2531
* ,
@@ -2437,10 +2536,13 @@ class FeatureSet(google.protobuf.message.Message):
2437
2536
message_encoding : global___FeatureSet .MessageEncoding .ValueType | None = ...,
2438
2537
json_format : global___FeatureSet .JsonFormat .ValueType | None = ...,
2439
2538
enforce_naming_style : global___FeatureSet .EnforceNamingStyle .ValueType | None = ...,
2539
+ default_symbol_visibility : global___FeatureSet .VisibilityFeature .DefaultSymbolVisibility .ValueType | None = ...,
2440
2540
) -> None : ...
2441
2541
def HasField (
2442
2542
self ,
2443
2543
field_name : typing .Literal [
2544
+ "default_symbol_visibility" ,
2545
+ b"default_symbol_visibility" ,
2444
2546
"enforce_naming_style" ,
2445
2547
b"enforce_naming_style" ,
2446
2548
"enum_type" ,
@@ -2460,6 +2562,8 @@ class FeatureSet(google.protobuf.message.Message):
2460
2562
def ClearField (
2461
2563
self ,
2462
2564
field_name : typing .Literal [
2565
+ "default_symbol_visibility" ,
2566
+ b"default_symbol_visibility" ,
2463
2567
"enforce_naming_style" ,
2464
2568
b"enforce_naming_style" ,
2465
2569
"enum_type" ,
0 commit comments