1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
U
£ý°dRºã@sŠdZdZddlZddlZddlmZdZe ¡dkrTddlZddl    Z    ddl
m Z dZGd    d
„d
e ƒZ Gd d „d e ƒZerŠGd d„deƒZneZGdd„deƒZe ¡Zdd„Zde_eƒZGdd„dedZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd „d eƒZGd!d"„d"eƒZGd#d$„d$eƒZGd%d&„d&eƒZ Gd'd(„d(eƒZ!d)d*„Z"d+d,„Z#d-d.„Z$d/d0„Z%d4d2d3„Z&dS)5zŠDescriptors essentially contain exactly the information found in a .proto
file, in types that make this information accessible in Python.
z#robinson@google.com (Will Robinson)éN)Úapi_implementationFÚcpp)Ú_messageTc@seZdZdZdS)ÚErrorzBase error for this module.N©Ú__name__Ú
__module__Ú __qualname__Ú__doc__©r r úQd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\google/protobuf/descriptor.pyr3src@seZdZdZdS)ÚTypeTransformationErrorzHError transforming between python proto type and corresponding C++ type.Nrr r r r r 7sr cseZdZ‡fdd„Z‡ZS)ÚDescriptorMetaclasscs(tt|ƒ |¡rdSt||jƒr$dSdS)NTF)ÚsuperrÚ__instancecheck__Ú
isinstanceÚ_C_DESCRIPTOR_CLASS)ÚclsÚobj©Ú    __class__r r rAs
 z%DescriptorMetaclass.__instancecheck__)rrr    rÚ __classcell__r r rr r@src@s(eZdZdZdd„Zdd„Zdd„ZdS)    Ú_Lockz>Wrapper class of threading.Lock(), which is allowed by 'with'.cCst |¡}t ¡|_|S©N)ÚobjectÚ__new__Ú    threadingÚLockÚ_lock)rÚselfr r r rOs
 
z _Lock.__new__cCs|j ¡dSr)rÚacquire©rr r r Ú    __enter__Tsz_Lock.__enter__cCs|j ¡dSr)rÚrelease)rÚexc_typeÚ    exc_valueÚexc_tbr r r Ú__exit__Wsz_Lock.__exit__N)rrr    r
rr"r'r r r r rLsrcCs0tjdkr,tjd8_tjd|tdddS)Nréz±Call to deprecated create function %s(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.é)ÚcategoryÚ
stacklevel)Ú _DeprecatedÚcountÚwarningsÚwarnÚDeprecationWarning©Únamer r r r,^s
ýûr,édc@s0eZdZdZerdZdd„Zdd„Zdd„Zd    S)
ÚDescriptorBaseaïDescriptors base class.
 
  This class is the base of all descriptor classes. It provides common options
  related functionality.
 
  Attributes:
    has_options:  True if the descriptor has non-default options.  Usually it
        is not necessary to read this -- just call GetOptions() which will
        happily return the default instance.  However, it's sometimes useful
        for efficiency, and also useful inside the protobuf implementation to
        avoid some bootstrapping issues.
  r cCs(||_||_||_|dk    p |dk    |_dS)zÏInitialize the descriptor given its options message and the name of the
    class of the options message. The name of the class is required in case
    the options message is None and has to be created.
    N)Ú_optionsÚ_options_class_nameÚ_serialized_optionsÚ has_options)rÚoptionsÚserialized_optionsÚoptions_class_namer r r Ú__init__…szDescriptorBase.__init__cCs||_||_|dk    |_dS)zSets the descriptor's options
 
    This function is used in generated proto2 files to update descriptor
    options. It must not be used outside proto2.
    N)r5r6r8)rr9r;r r r Ú _SetOptions‘szDescriptorBase._SetOptionsc
Cs’|jr |jSddlm}zt||jƒ}Wn"tk
rJtd|jƒ‚YnXt8|jdkrf|ƒ|_nt    |ƒ|jƒ|_|jW5QR£SQRXdS)z‚Retrieves descriptor options.
 
    This method returns the options set or creates the default options for the
    descriptor.
    r©Údescriptor_pb2zUnknown options class name %s!N)
r5Úgoogle.protobufr?Úgetattrr6ÚAttributeErrorÚ RuntimeErrorrr7Ú _ParseOptions)rr?Z options_classr r r Ú
GetOptionss$ ÿÿ 
 
ÿzDescriptorBase.GetOptionsN)    rrr    r
Ú_USE_C_DESCRIPTORSrr<r=rEr r r r r4qs    r4)Ú    metaclasscs*eZdZdZd‡fdd„    Zdd„Z‡ZS)Ú_NestedDescriptorBasez0Common class for descriptors that can be nested.Nc
 
s<tt|ƒ ||    |¡||_||_||_||_||_||_dS)a‰Constructor.
 
    Args:
      options: Protocol message options or None
        to use default message options.
      options_class_name (str): The class name of the above options.
      name (str): Name of this protocol message type.
      full_name (str): Fully-qualified name of this protocol message type,
        which will include protocol "package" name and the name of any
        enclosing types.
      file (FileDescriptor): Reference to file info.
      containing_type: if provided, this is a nested descriptor, with this
        descriptor as parent, otherwise None.
      serialized_start: The start index (inclusive) in block in the
        file.serialized_pb that describes this descriptor.
      serialized_end: The end index (exclusive) in block in the
        file.serialized_pb that describes this descriptor.
      serialized_options: Protocol message serialized options or None.
    N)    rrHr<r2Ú    full_nameÚfileÚcontaining_typeÚ_serialized_startÚ_serialized_end)
rr9r;r2rIrJrKÚserialized_startÚserialized_endr:rr r r<»s
ÿz_NestedDescriptorBase.__init__cCsF|jdk    r:|jdk    r:|jdk    r:| |jj|j|j…¡ntdƒ‚dS)zåCopies this to the matching proto in descriptor_pb2.
 
    Args:
      proto: An empty proto instance from descriptor_pb2.
 
    Raises:
      Error: If self couldn't be serialized, due to to few constructor
        arguments.
    Nz*Descriptor does not contain serialization.)rJrLrMÚParseFromStringÚ serialized_pbr©rÚprotor r r Ú CopyToProtoÞs
 
ÿþ
ÿ
z!_NestedDescriptorBase.CopyToProto)NNN)rrr    r
r<rTrr r rr rH¸s þ#rHcsVeZdZdZer ejZddd„Zd‡fdd„    Z    e
dd    „ƒZ d
d „Z ‡fd d „Z ‡ZS)Ú
Descriptora=    Descriptor for a protocol message type.
 
  Attributes:
      name (str): Name of this protocol message type.
      full_name (str): Fully-qualified name of this protocol message type,
          which will include protocol "package" name and the name of any
          enclosing types.
      containing_type (Descriptor): Reference to the descriptor of the type
          containing us, or None if this is top-level.
      fields (list[FieldDescriptor]): Field descriptors for all fields in
          this type.
      fields_by_number (dict(int, FieldDescriptor)): Same
          :class:`FieldDescriptor` objects as in :attr:`fields`, but indexed
          by "number" attribute in each FieldDescriptor.
      fields_by_name (dict(str, FieldDescriptor)): Same
          :class:`FieldDescriptor` objects as in :attr:`fields`, but indexed by
          "name" attribute in each :class:`FieldDescriptor`.
      nested_types (list[Descriptor]): Descriptor references
          for all protocol message types nested within this one.
      nested_types_by_name (dict(str, Descriptor)): Same Descriptor
          objects as in :attr:`nested_types`, but indexed by "name" attribute
          in each Descriptor.
      enum_types (list[EnumDescriptor]): :class:`EnumDescriptor` references
          for all enums contained within this type.
      enum_types_by_name (dict(str, EnumDescriptor)): Same
          :class:`EnumDescriptor` objects as in :attr:`enum_types`, but
          indexed by "name" attribute in each EnumDescriptor.
      enum_values_by_name (dict(str, EnumValueDescriptor)): Dict mapping
          from enum value name to :class:`EnumValueDescriptor` for that value.
      extensions (list[FieldDescriptor]): All extensions defined directly
          within this message type (NOT within a nested type).
      extensions_by_name (dict(str, FieldDescriptor)): Same FieldDescriptor
          objects as :attr:`extensions`, but indexed by "name" attribute of each
          FieldDescriptor.
      is_extendable (bool):  Does this type define any extension ranges?
      oneofs (list[OneofDescriptor]): The list of descriptors for oneof fields
          in this message.
      oneofs_by_name (dict(str, OneofDescriptor)): Same objects as in
          :attr:`oneofs`, but indexed by "name" attribute.
      file (FileDescriptor): Reference to file descriptor.
 
  NTcCstj ¡tj |¡Sr)rÚMessageÚ_CheckCalledFromGeneratedFileÚ default_poolZFindMessageTypeByName)rr2rIÚfilenamerKÚfieldsÚ nested_typesÚ
enum_typesÚ
extensionsr9r:Ú is_extendableÚextension_rangesÚoneofsrJrNrOÚsyntaxÚ
create_keyr r r r!s
zDescriptor.__new__c sh|tk    rtdƒtt|ƒj|    d|||||||
d    ||_|jD]
}||_q>tdd„|Dƒƒ|_tdd„|Dƒƒ|_    d|_
||_ |D]
}||_q‚tdd„|Dƒƒ|_ ||_ |j D]
}||_q®td    d„|Dƒƒ|_td
d„|Dƒƒ|_||_|jD]
}||_qîtd d„|Dƒƒ|_| |_| |_| dk    r(| ng|_td d„|jDƒƒ|_|jD] }||_qJ|p`d |_dS)zäArguments to __init__() are as described in the description
    of Descriptor fields above.
 
    Note that filename is an obsolete argument, that is not used anymore.
    Please use file.name to access this as an attribute.
    rUZMessageOptions©rNrOr:css|]}|j|fVqdSr©Únumber©Ú.0Úfr r r Ú    <genexpr>Wsz&Descriptor.__init__.<locals>.<genexpr>css|]}|j|fVqdSrr1rfr r r riXsNcss|]}|j|fVqdSrr1©rgÚtr r r ri^scss|]}|j|fVqdSrr1rjr r r ricscss$|]}|jD]}|j|fVq qdSr)Úvaluesr2)rgrkÚvr r r ridscss|]}|j|fVqdSrr1rfr r r rijscss|]}|j|fVqdSrr1)rgÚor r r rinsÚproto2)Ú_internal_create_keyr,rrUr<rZrKÚdictZfields_by_numberZfields_by_nameÚ_fields_by_camelcase_namer[Znested_types_by_namer\Úenum_types_by_nameZenum_values_by_namer]Úextension_scopeÚextensions_by_namer^r_r`Zoneofs_by_namera)rr2rIrYrKrZr[r\r]r9r:r^r_r`rJrNrOrarbÚfieldÚ nested_typeÚ    enum_typeÚ    extensionZoneofrr r r<;sR 
ý
 
 
ÿ
 
 
 
zDescriptor.__init__cCs&|jdkr tdd„|jDƒƒ|_|jS)zrSame FieldDescriptor objects as in :attr:`fields`, but indexed by
    :attr:`FieldDescriptor.camelcase_name`.
    Ncss|]}|j|fVqdSr)Úcamelcase_namerfr r r riysz6Descriptor.fields_by_camelcase_name.<locals>.<genexpr>)rrrqrZr!r r r Úfields_by_camelcase_namess
 
ÿ
z#Descriptor.fields_by_camelcase_namecCs|j|j|jS)asReturns the string name of an enum value.
 
    This is just a small helper method to simplify a common operation.
 
    Args:
      enum: string name of the Enum.
      value: int, value of the enum.
 
    Returns:
      string name of the enum value.
 
    Raises:
      KeyError if either the Enum doesn't exist or the value is not a valid
        value for the enum.
    )rsÚvalues_by_numberr2)rÚenumÚvaluer r r Ú EnumValueName}szDescriptor.EnumValueNamecstt|ƒ |¡dS)zvCopies this to a descriptor_pb2.DescriptorProto.
 
    Args:
      proto: An empty descriptor_pb2.DescriptorProto.
    N)rrUrTrRrr r rTszDescriptor.CopyToProto)NNNNNNNNNNTNNNNNNN)
NNTNNNNNNN)rrr    r
rFrrUrrr<Úpropertyr{rrTrr r rr rUñsJ+í
û8
    rUc$s<eZdZdZdZdZdZdZdZdZ    dZ
d    Z d
Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd    Zd
Zd Z d Z!eeeeeeeeeeeeeee    eeeeeeeeee
eeee ee eee e e iZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)e*re+j,Z-d#dd„Z.d$‡fdd„    Z/e0dd„ƒZ1e0dd „ƒZ2e3d!d"„ƒZ4‡Z5S)%ÚFieldDescriptora+    Descriptor for a single field in a .proto file.
 
  Attributes:
    name (str): Name of this field, exactly as it appears in .proto.
    full_name (str): Name of this field, including containing scope.  This is
      particularly relevant for extensions.
    index (int): Dense, 0-indexed index giving the order that this
      field textually appears within its message in the .proto file.
    number (int): Tag number declared for this field in the .proto file.
 
    type (int): (One of the TYPE_* constants below) Declared type.
    cpp_type (int): (One of the CPPTYPE_* constants below) C++ type used to
      represent this field.
 
    label (int): (One of the LABEL_* constants below) Tells whether this
      field is optional, required, or repeated.
    has_default_value (bool): True if this field has a default value defined,
      otherwise false.
    default_value (Varies): Default value of this field.  Only
      meaningful for non-repeated scalar fields.  Repeated fields
      should always set this to [], and non-repeated composite
      fields should always set this to None.
 
    containing_type (Descriptor): Descriptor of the protocol message
      type that contains this field.  Set by the Descriptor constructor
      if we're passed into one.
      Somewhat confusingly, for extension fields, this is the
      descriptor of the EXTENDED message, not the descriptor
      of the message containing this field.  (See is_extension and
      extension_scope below).
    message_type (Descriptor): If a composite field, a descriptor
      of the message type contained in this field.  Otherwise, this is None.
    enum_type (EnumDescriptor): If this field contains an enum, a
      descriptor of that enum.  Otherwise, this is None.
 
    is_extension: True iff this describes an extension field.
    extension_scope (Descriptor): Only meaningful if is_extension is True.
      Gives the message that immediately contains this extension field.
      Will be None iff we're a top-level (file-level) extension field.
 
    options (descriptor_pb2.FieldOptions): Protocol message field options or
      None to use default field options.
 
    containing_oneof (OneofDescriptor): If the field is a member of a oneof
      union, contains its descriptor. Otherwise, None.
 
    file (FileDescriptor): Reference to file descriptor.
  r(ér)éééééé    é
é é é éééééiÿÿÿi8JiNNTcCs*tj ¡| rtj |¡Stj |¡SdSr)rrVrWrXÚFindExtensionByNameÚFindFieldByName)rr2rIÚindexreÚtypeÚcpp_typeÚlabelÚ default_valueÚ message_typerxrKÚ is_extensionrtr9r:Úhas_default_valueÚcontaining_oneofÚ    json_namerJrbr r r r&s
 zFieldDescriptor.__new__csÞ|tk    rtdƒtt|ƒ ||d¡||_||_||_d|_|dkrPt    |ƒ|_
n||_
||_ ||_ ||_ ||_||_||_||_| |_|    |_|
|_| |_| |_||_t ¡dkrÔ| rÄtj |¡|_qÚtj |¡|_nd|_dS)aThe arguments are as described in the description of FieldDescriptor
    attributes above.
 
    Note that containing_type may be None, and may be set later if necessary
    (to deal with circular references between message types, for example).
    Likewise for extension_scope.
    rZ FieldOptionsNr)rpr,rrr<r2rIrJÚ_camelcase_nameÚ _ToJsonNamerr”rer•r–r—r›r˜rKr™rxršrtrœrÚTyperrXr’Z _cdescriptorr“)rr2rIr”rer•r–r—r˜r™rxrKršrtr9r:r›rœrrJrbrr r r<2s@ 
ÿ  zFieldDescriptor.__init__cCs|jdkrt|jƒ|_|jS)zRCamelcase name of this field.
 
    Returns:
      str: the name in CamelCase.
    N)ržÚ _ToCamelCaser2r!r r r rzas
 zFieldDescriptor.camelcase_namecCsh|jtjkrdS|jtjks"|jr&dSt|jdƒr>|jjdkSt|j    dƒrV|j    jdkSt
d|j ƒ‚dS)z¦Whether the field distinguishes between unpopulated and default values.
 
    Raises:
      RuntimeError: singular field that is not linked with message nor file.
    FTrarozZhas_presence is not ready to use because field %s is not linked with message type nor fileN) r—rÚLABEL_REPEATEDr–ÚCPPTYPE_MESSAGErœÚhasattrrJrar™rCrIr!r r r Ú has_presencels  ÿ    ÿÿzFieldDescriptor.has_presencecCs2z tj|WStk
r,td|ƒ‚YnXdS)aïConverts from a Python proto type to a C++ Proto Type.
 
    The Python ProtocolBuffer classes specify both the 'Python' datatype and the
    'C++' datatype - and they're not the same. This helper method should
    translate from one to another.
 
    Args:
      proto_type: the Python proto type (descriptor.FieldDescriptor.TYPE_*)
    Returns:
      int: descriptor.FieldDescriptor.CPPTYPE_*, the C++ type.
    Raises:
      TypeTransformationError: when the Python proto type isn't known.
    zUnknown proto_type: %sN)rÚ_PYTHON_TO_CPP_PROTO_TYPE_MAPÚKeyErrorr )Z
proto_typer r r ÚProtoTypeToCppProtoType€s z'FieldDescriptor.ProtoTypeToCppProtoType)NNTNNNN)NNTNNNN)6rrr    r
Z TYPE_DOUBLEZ
TYPE_FLOATZ
TYPE_INT64Z TYPE_UINT64Z
TYPE_INT32Z TYPE_FIXED64Z TYPE_FIXED32Z    TYPE_BOOLZ TYPE_STRINGZ
TYPE_GROUPZ TYPE_MESSAGEZ
TYPE_BYTESZ TYPE_UINT32Z    TYPE_ENUMZ TYPE_SFIXED32Z TYPE_SFIXED64Z TYPE_SINT32Z TYPE_SINT64ZMAX_TYPEZ CPPTYPE_INT32Z CPPTYPE_INT64ZCPPTYPE_UINT32ZCPPTYPE_UINT64ZCPPTYPE_DOUBLEZ CPPTYPE_FLOATZ CPPTYPE_BOOLZ CPPTYPE_ENUMZCPPTYPE_STRINGr£Z MAX_CPPTYPEr¦ZLABEL_OPTIONALZLABEL_REQUIREDr¢Z    MAX_LABELZMAX_FIELD_NUMBERZFIRST_RESERVED_FIELD_NUMBERZLAST_RESERVED_FIELD_NUMBERrFrrrrr<r€rzr¥Ú staticmethodr¨rr r rr r¤sÆ5îû
û/
 
 
rcsBeZdZdZer ejZd    dd„Zd
‡fdd„    Z    ‡fdd„Z
‡Z S) ÚEnumDescriptoraÓDescriptor for an enum defined in a .proto file.
 
  Attributes:
    name (str): Name of the enum type.
    full_name (str): Full name of the type, including package name
      and any enclosing type(s).
 
    values (list[EnumValueDescriptor]): List of the values
      in this enum.
    values_by_name (dict(str, EnumValueDescriptor)): Same as :attr:`values`,
      but indexed by the "name" field of each EnumValueDescriptor.
    values_by_number (dict(int, EnumValueDescriptor)): Same as :attr:`values`,
      but indexed by the "number" field of each EnumValueDescriptor.
    containing_type (Descriptor): Descriptor of the immediate containing
      type of this enum, or None if this is an enum defined at the
      top level in a .proto file.  Set by Descriptor's constructor
      if we're passed into one.
    file (FileDescriptor): Reference to file descriptor.
    options (descriptor_pb2.EnumOptions): Enum options message or
      None to use default enum options.
  Nc Cstj ¡tj |¡Sr)rrVrWrXZFindEnumTypeByName) rr2rIrYrlrKr9r:rJrNrOrbr r r r°s
zEnumDescriptor.__new__c sz| tk    rtdƒtt|ƒj|d|||||    |
|d    ||_|jD]
} || _q>tdd„|Dƒƒ|_tdd„t    |ƒDƒƒ|_
dS)zÇArguments are as described in the attribute description above.
 
    Note that filename is an obsolete argument, that is not used anymore.
    Please use file.name to access this as an attribute.
    rªZ EnumOptionsrccss|]}|j|fVqdSrr1©rgrmr r r riËsz*EnumDescriptor.__init__.<locals>.<genexpr>css|]}|j|fVqdSrrdr«r r r riÍsN) rpr,rrªr<rlr•rqZvalues_by_nameÚreversedr|) rr2rIrYrlrKr9r:rJrNrOrbr~rr r r<·s$    
ý
zEnumDescriptor.__init__cstt|ƒ |¡dS)z‘Copies this to a descriptor_pb2.EnumDescriptorProto.
 
    Args:
      proto (descriptor_pb2.EnumDescriptorProto): An empty descriptor proto.
    N)rrªrTrRrr r rTÏszEnumDescriptor.CopyToProto)NNNNNNN)NNNNNNN) rrr    r
rFrrªrrr<rTrr r rr rª•s(ý
ýrªcs6eZdZdZer ejZddd„Zd‡fdd„    Z    ‡Z
S)    ÚEnumValueDescriptoraLDescriptor for a single value within an enum.
 
  Attributes:
    name (str): Name of this value.
    index (int): Dense, 0-indexed index giving the order that this
      value appears textually within its enum in the .proto file.
    number (int): Actual number assigned to this enum value.
    type (EnumDescriptor): :class:`EnumDescriptor` to which this value
      belongs.  Set by :class:`EnumDescriptor`'s constructor if we're
      passed into one.
    options (descriptor_pb2.EnumValueOptions): Enum value options message or
      None to use default enum value options options.
  NcCstj ¡dSr)rrVrW)rr2r”rer•r9r:rbr r r rìs
zEnumValueDescriptor.__new__cs@|tk    rtdƒtt|ƒ ||d¡||_||_||_||_dS)ú>Arguments are as described in the attribute description above.r­ZEnumValueOptionsN)    rpr,rr­r<r2r”rer•)rr2r”rer•r9r:rbrr r r<ös
ÿzEnumValueDescriptor.__init__)NNNN)NNNN) rrr    r
rFrr­rrr<rr r rr r­Ùsþ
þr­cs6eZdZdZer ejZddd„Zd‡fdd„    Z    ‡Z
S)    ÚOneofDescriptora'Descriptor for a oneof field.
 
  Attributes:
    name (str): Name of the oneof field.
    full_name (str): Full name of the oneof field, including package name.
    index (int): 0-based index giving the order of the oneof field inside
      its containing type.
    containing_type (Descriptor): :class:`Descriptor` of the protocol message
      type that contains this field.  Set by the :class:`Descriptor` constructor
      if we're passed into one.
    fields (list[FieldDescriptor]): The list of field descriptors this
      oneof can contain.
  Nc        Cstj ¡tj |¡Sr)rrVrWrXZFindOneofByName)    rr2rIr”rKrZr9r:rbr r r rs
zOneofDescriptor.__new__c        sF|tk    rtdƒtt|ƒ ||d¡||_||_||_||_||_    dS)r®r¯Z OneofOptionsN)
rpr,rr¯r<r2rIr”rKrZ)    rr2rIr”rKrZr9r:rbrr r r<s
ÿzOneofDescriptor.__init__)NNN)NNN) rrr    r
rFrr¯rrr<rr r rr r¯sþ
þr¯c
sJeZdZdZer ejZd dd„Zd ‡fdd„    Z    dd„Z
‡fd    d
„Z ‡Z S) ÚServiceDescriptoraÑDescriptor for a service.
 
  Attributes:
    name (str): Name of the service.
    full_name (str): Full name of the service, including package name.
    index (int): 0-indexed index giving the order that this services
      definition appears within the .proto file.
    methods (list[MethodDescriptor]): List of methods provided by this
      service.
    methods_by_name (dict(str, MethodDescriptor)): Same
      :class:`MethodDescriptor` objects as in :attr:`methods_by_name`, but
      indexed by "name" attribute in each :class:`MethodDescriptor`.
    options (descriptor_pb2.ServiceOptions): Service options message or
      None to use default service options.
    file (FileDescriptor): Reference to file info.
  Nc Cstj ¡tj |¡Sr)rrVrWrXZFindServiceByName) rr2rIr”Úmethodsr9r:rJrNrOrbr r r rCs
zServiceDescriptor.__new__c sh|
tk    rtdƒtt|ƒj|d|||d||    |d    ||_||_tdd„|Dƒƒ|_|jD]
} || _    qXdS)Nr°ZServiceOptionsrccss|]}|j|fVqdSrr1)rgÚmr r r ri^sz-ServiceDescriptor.__init__.<locals>.<genexpr>)
rpr,rr°r<r”r±rqÚmethods_by_nameÚcontaining_service) rr2rIr”r±r9r:rJrNrOrbÚmethodrr r r<Rs$
ý
zServiceDescriptor.__init__cCs|j |d¡S)zÚSearches for the specified method, and returns its descriptor.
 
    Args:
      name (str): Name of the method.
    Returns:
      MethodDescriptor or None: the descriptor for the requested method, if
      found.
    N)r³Úget)rr2r r r ÚFindMethodByNamecs    z"ServiceDescriptor.FindMethodByNamecstt|ƒ |¡dS)z—Copies this to a descriptor_pb2.ServiceDescriptorProto.
 
    Args:
      proto (descriptor_pb2.ServiceDescriptorProto): An empty descriptor proto.
    N)rr°rTrRrr r rTnszServiceDescriptor.CopyToProto)
NNNNNNNNNN)NNNNNN) rrr    r
rFrr°rrr<r·rTrr r rr r°-s.õ
þ r°cs>eZdZdZer ejZd
dd„Zd ‡fdd„    Z    dd    „Z
‡Z S) ÚMethodDescriptoraôDescriptor for a method in a service.
 
  Attributes:
    name (str): Name of the method within the service.
    full_name (str): Full name of method.
    index (int): 0-indexed index of the method inside the service.
    containing_service (ServiceDescriptor): The service that contains this
      method.
    input_type (Descriptor): The descriptor of the message that this method
      accepts.
    output_type (Descriptor): The descriptor of the message that this method
      returns.
    client_streaming (bool): Whether this method uses client streaming.
    server_streaming (bool): Whether this method uses server streaming.
    options (descriptor_pb2.MethodOptions or None): Method options message, or
      None to use default method options.
  FNc Cstj ¡tj |¡Sr)rrVrWrXr·) rr2rIr”r´Ú
input_typeÚ output_typeÚclient_streamingÚserver_streamingr9r:rbr r r rs
zMethodDescriptor.__new__c sX| tk    rtdƒtt|ƒ |    |
d¡||_||_||_||_||_    ||_
||_ ||_ dS)z²The arguments are as described in the description of MethodDescriptor
    attributes above.
 
    Note that containing_service may be None, and may be set later if necessary.
    r¸Z MethodOptionsN) rpr,rr¸r<r2rIr”r´r¹rºr»r¼) rr2rIr”r´r¹rºr»r¼r9r:rbrr r r<žs
ÿzMethodDescriptor.__init__cCsJ|jdk    r>ddlm}| ¡}|j |¡| |j|j¡ntdƒ‚dS)zýCopies this to a descriptor_pb2.MethodDescriptorProto.
 
    Args:
      proto (descriptor_pb2.MethodDescriptorProto): An empty descriptor proto.
 
    Raises:
      Error: If self couldn't be serialized, due to too few constructor
        arguments.
    Nrr>z&Descriptor does not contain a service.)    r´r@r?ZServiceDescriptorProtorTZCopyFromrµr”r)rrSr?Z service_protor r r rT½s
 
  zMethodDescriptor.CopyToProto)FFNNN)FFNNN) rrr    r
rFrr¸rrr<rTrr r rr r¸xs     õ
õr¸csBeZdZdZer$ejZd    ‡fdd„    Zd
‡fdd„    Z    dd„Z
‡Z S) ÚFileDescriptoraÖDescriptor for a file. Mimics the descriptor_pb2.FileDescriptorProto.
 
  Note that :attr:`enum_types_by_name`, :attr:`extensions_by_name`, and
  :attr:`dependencies` fields are only set by the
  :py:mod:`google.protobuf.message_factory` module, and not by the generated
  proto code.
 
  Attributes:
    name (str): Name of file, relative to root of source tree.
    package (str): Name of the package
    syntax (str): string indicating syntax of the file (can be "proto2" or
      "proto3")
    serialized_pb (bytes): Byte string of serialized
      :class:`descriptor_pb2.FileDescriptorProto`.
    dependencies (list[FileDescriptor]): List of other :class:`FileDescriptor`
      objects this :class:`FileDescriptor` depends on.
    public_dependencies (list[FileDescriptor]): A subset of
      :attr:`dependencies`, which were declared as "public".
    message_types_by_name (dict(str, Descriptor)): Mapping from message names
      to their :class:`Descriptor`.
    enum_types_by_name (dict(str, EnumDescriptor)): Mapping from enum names to
      their :class:`EnumDescriptor`.
    extensions_by_name (dict(str, FieldDescriptor)): Mapping from extension
      names declared at file scope to their :class:`FieldDescriptor`.
    services_by_name (dict(str, ServiceDescriptor)): Mapping from services'
      names to their :class:`ServiceDescriptor`.
    pool (DescriptorPool): The pool this descriptor belongs to.  When not
      passed to the constructor, the global default pool is used.
  Nc s^|dkr:ztj |¡WStk
r6td|ƒ‚YqZXn |rJtj |¡Stt|ƒ |¡SdS)Nóz'Please link in cpp generated lib for %s)    rrXÚFindFileByNamer§rCZAddSerializedFilerr½r) rr2Úpackager9r:rQÚ dependenciesÚpublic_dependenciesraÚpoolrbrr r ròs zFileDescriptor.__new__c s’|
tk    rtdƒtt|ƒ ||d¡|    dkr@ddlm} |  ¡}    |    |_i|_    ||_
||_ |p^d|_ ||_ i|_i|_i|_|p€g|_|pŠg|_dS)z Constructor.r½Z FileOptionsNr)Údescriptor_poolro)rpr,rr½r<r@rÄZDefaultrÃÚmessage_types_by_namer2rÀrarQrsruZservices_by_namerÁrÂ) rr2rÀr9r:rQrÁrÂrarÃrbrÄrr r r<s*
ÿ 
 
zFileDescriptor.__init__cCs| |j¡dS)z~Copies this to a descriptor_pb2.FileDescriptorProto.
 
    Args:
      proto: An empty descriptor_pb2.FileDescriptorProto.
    N)rPrQrRr r r rTszFileDescriptor.CopyToProto)NNNNNNNN)NNNNNNNN) rrr    r
rFrr½rrr<rTrr r rr r½Ðs,ýýr½cCs| |¡|S)zšParses serialized options.
 
  This helper function is used to parse serialized options in generated
  proto2 files. It must not be used outside proto2.
  )rP)ÚmessageÚstringr r r rD(s
rDcCsnd}g}|D]6}|dkr"|rBd}q |r:| | ¡¡d}q ||7}q |rd|d ¡rd|d ¡|d<d |¡S)z+Converts name to camel-case and returns it.FÚ_TrÚ)ÚappendÚupperÚisupperÚlowerÚjoin©r2Zcapitalize_nextÚresultÚcr r r r¡2s
r¡cCs| d¡r|jSdSdS)zCReturns the value of the field `options`, or None if it is not set.r9N)ÚHasFieldr9)Zdescriptor_protor r r Ú_OptionsOrNoneGs
rÓcCsJd}g}|D]2}|dkrd}q |r6| | ¡¡d}q ||7}q d |¡S)z*Converts name to Json name and returns it.FrÈTrÉ)rÊrËrÎrÏr r r rŸOs
rŸrÉcCsrt ¡dkr¦|r¦ddlm}| ¡}|j ¡ |¡t     t
  d¡¡  d¡}|rrt
j  | dd¡|d¡|_||_n
|d|_tj |¡tj |j¡}tr¦|j|jS|jg}|r¾| d|¡i}    |jD]B}
d ||
jg¡} t|
j| d    d
d „t|
jƒDƒtd } | |    | <qÈi} |jD]6}d ||jg¡} t|d |¡d |d}|| | <qg}|j D]Ü}d ||jg¡} d    } d    }|j!r†|j!}nd    }| "d¡rä|j#}d ||| $d¡dd    …g¡}|| krÒ| |}n||    krä|    |} t%|j| |j&d|j&|j't% (|j'¡|j)d    || d    d d    t*|ƒd |td}| +|¡qXd |¡}t,|j|d    d    |t-|  .¡ƒt-|     .¡ƒgt*|ƒtd
S)aMake a protobuf Descriptor given a DescriptorProto protobuf.
 
  Handles nested descriptors. Note that this is limited to the scope of defining
  a message inside of another message. Composite fields can currently only be
  resolved if the message is defined in the same scope as the field.
 
  Args:
    desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
    package: Optional package name for the new message Descriptor (string).
    build_file_if_cpp: Update the C++ descriptor pool if api matches.
                       Set to False on recursion, so no duplicates are created.
    syntax: The syntax/semantics that should be used.  Set to "proto3" to get
            proto3 field presence semantics.
  Returns:
    A Descriptor for protobuf messages.
  rrr>rÚasciiÚ.ú/z.protoNcSs$g|]\}}t|j||jtd‘qS)©rb)r­r2rerp)rgÚiiZenum_valr r r Ú
<listcomp>–sþ ÿz"MakeDescriptor.<locals>.<listcomp>r×F)rÀÚbuild_file_if_cppraÚ    type_namer()r9r›rrb)r9rb)/rr r@r?ZFileDescriptorProtor™ÚaddZ    MergeFromÚbinasciiÚhexlifyÚosÚurandomÚdecodeÚpathrÎÚreplacer2rÀrrXZAddr¿rFrÅÚinsertrxrªÚ    enumerater~rprwÚMakeDescriptorrvrrÒrÛÚrfindrrer•r¨r—rÓrÊrUÚlistrl)Z
desc_protorÀrÚrar?Zfile_descriptor_protoZ
proto_namerÐZfull_message_namer\Z
enum_protorIZ    enum_descr[Z nested_protoZ nested_descrZZ field_protorrÛZfull_type_namervZ    desc_namer r r ræ`sª ÿ
 
ýû
 
ý 
 ÿ
 
 
 
ú
 
 
ýræ)rÉTN)'r
Ú
__author__rr.Zgoogle.protobuf.internalrrFr rÝrßZgoogle.protobuf.pyextrÚ    Exceptionrr r•rrrrrr,r-rpr4rHrUrrªr­r¯r°r¸r½rDr¡rÓrŸrær r r r Ú<module>sN        G94rD,(KXX
ÿ