K irdZdZddlZddlZddlZddlZddlZddlmZdZ ejdk7rejZ e ddl m Z dZ Gd d eZGd d eZe r Gd deZn ej&ZGddeZej,Z d0dZdZdZdZdZdZde_eZGddeZ Gdde Z!Gdde!Z"Gdde Z#Gdd e!Z$Gd!d"e Z%Gd#d$e Z&Gd%d&e!Z'Gd'd(e Z(Gd)d*e Z)d+Z*d,Z+d-Z,d.Z- d1d/Z.y)2zDescriptors 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_implementationFpython)_messageTceZdZdZy)ErrorzBase error for this module.N__name__ __module__ __qualname____doc__`/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/google/protobuf/descriptor.pyrr!s#rrceZdZdZy)TypeTransformationErrorzHError transforming between python proto type and corresponding C++ type.Nrr rrrr%sPrrceZdZfdZxZS)DescriptorMetaclassc\tt| |ryt||jryy)NTF)superr__instancecheck__ isinstance_C_DESCRIPTOR_CLASS)clsobj __class__s rrz%DescriptorMetaclass.__instancecheck__0s, "C :3 ? C00 1 r)r r r r __classcell__rs@rrr.s rrc"eZdZdZdZdZdZy)_Lockz>Wrapper class of threading.Lock(), which is allowed by 'with'.cbtj|}tj|_|SN)object__new__ threadingLock_lock)rselfs rr#z _Lock.__new__?s# >># D!DJ Krc8|jjyr!)r&acquirer's r __enter__z_Lock.__enter__DJJrc8|jjyr!)r&release)r'exc_type exc_valueexc_tbs r__exit__z_Lock.__exit__Gr,rN)r r r r r#r+r2r rrrr<sF rrctjdkDr=txjdzc_tjd|d|dtdyy)NrzCall to deprecated z, use z instead.)category stacklevel) _DeprecatedcountwarningswarnDeprecationWarning)name alternatives rr8r8NsB MM48+F#rr5r4dcjeZdZdZerdZdZeejdZ dZ dZ dZ dZd Zy ) DescriptorBaseaDescriptors 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. file (FileDescriptor): Reference to file info. r cd|_||_||_dx|_|_||_||_|jduxs|j du|_y)zInitialize 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) _featuresfile_original_options_options_loaded_options_options_class_name_serialized_options has_options)r'rEoptionsserialized_optionsoptions_class_names r__init__zDescriptorBase.__init__sf DNDI$D,0/DMD(1D1D..d:   , rcyr!r r*s r_parentzDescriptorBase._parents rcy)a,Infers features from proto2/proto3 syntax so that editions logic can be used everywhere. Args: edition: The edition to infer features for. options: The options for this descriptor that are being processed. features: The feature set object to modify with inferred features. Nr )r'editionrLfeaturess r_InferLegacyFeaturesz#DescriptorBase._InferLegacyFeaturess rcR|js|j|jSr!)rD_LazyLoadOptionsr*s r _GetFeatureszDescriptorBase._GetFeaturess >>  >>rcddlm}|jr:|j}|j |jj n%|j jj|}|j}|j |j|j||||j||j jj|S)aResolves features from the raw options of this descriptor. Args: edition: The edition to use for feature defaults. raw_options: The options for this descriptor that are being processed. Returns: A fully resolved feature set for making runtime decisions. rdescriptor_pb2) google.protobufr[rQ FeatureSetCopyFromrXrEpool_CreateDefaultFeaturesrTrU MergeFrom_InternFeatures)r'rS raw_optionsr[rT unresolveds r_ResolveFeatureszDescriptorBase._ResolveFeaturess/ ||**,h 113466w?h**,J ,,-g{J? z" 99>> ) )( 33rc|jr|j|jk(ryddlm}t ||j st d|j zt||j }d}|jj}|jsr|js0|j|jj||}t5|x|_|_|js||_ dddy|j s |j"}nt%||j }|js+|j|jj||}t5|x|_|_|js||_ |j'dr;|j)d|j+s|x|_|_d|_ dddy#1swYyxYw#1swYyxYw)zCLazily initializes descriptor options towards the end of the build.NrrZzUnknown options class name %s!rTF)rGrHr\r[hasattrrI RuntimeErrorgetattrrE_editionrKrDreEditionValuer&rJrF _ParseOptionsHasField ClearFieldSerializeToString)r'r[ options_classrTrSrLs rrWzDescriptorBase._LazyLoadOptionss }}--> / >4#;#; <  *T-E-E E ND,D,DEMHii  G    ^^((  " " ( ( 1=?  $/<> ,~~#$.$$  % %(( 1I1IJ ^^((  " " ( ( 17  %/66 ,~~#$.   J '   Z (**,3@? BDMD0$D %%$$%%s'G/8A.G;/G8;Hcj|jr |js|j|jS)zZRetrieves descriptor options. Returns: The options set on this descriptor. )rGrHrWr*s r GetOptionszDescriptorBase.GetOptionss) == 4 4  ==rN)r r r r _USE_C_DESCRIPTORSrrOpropertyabcabstractmethodrQrUrXrerWrsr rrrBrBlsU *      44,%\ rrB) metaclassc0eZdZdZ dfd ZdZxZS)_NestedDescriptorBasez0Common class for descriptors that can be nested.c xtt| ||| |||_||_||_||_||_y)aLConstructor. 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. 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)rrzrOr= full_namecontaining_type_serialized_start_serialized_end) r'rLrNr=r|rEr}serialized_startserialized_endrMrs rrOz_NestedDescriptorBase.__init__sJ: / g)+=DIDN*D-D)Drc|jU|jI|j=|j|jj|j|jyt d)zCopies 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.)rEr~rParseFromString serialized_pbrr'protos r CopyToProtoz!_NestedDescriptorBase.CopyToProto*sb   " " .  ,  )) ! !$"8"84;O;O P > ??rNNN)r r r r rOrrrs@rrzrzs8(*T@rrzceZdZdZer#ej Z ddZ d fd Z e dZ e dZ dZ fdZxZS) DescriptoraL 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. is_map_entry: If the message type is a map entry. c|tjjtjj |Sr!)rMessage_CheckCalledFromGeneratedFile default_poolFindMessageTypeByName)rr=r|filenamer}fields nested_types enum_types extensionsrLrM is_extendableextension_rangesoneofsrErrsyntax is_map_entry create_keys rr#zDescriptor.__new__os-,446  " " 8 8 CCrc 8|tur tdtt|| d|||||||  ||_|j D]}||_||_td|D|_ td|D|_ d|_ ||_ |D] }||_ td|D|_ ||_|jD] }||_ td|D|_td |D|_||_|j"D] }||_ td |D|_| |_| |_| | ng|_td |j,D|_|j,D]}||_||_||_y) zArguments 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. zcreate function Descriptor()MessageOptionsrrrMc38K|]}|j|fywr!number.0fs r z&Descriptor.__init__..s ?1!((A ?c38K|]}|j|fywr!r=rs rrz&Descriptor.__init__..;q{;rNc38K|]}|j|fywr!rrts rrz&Descriptor.__init__..s$GQaffa[$Grc38K|]}|j|fywr!rrs rrz&Descriptor.__init__.."C1AFFA;"Crc3ZK|]#}|jD]}|j|f%ywr!)valuesr=)rrvs rrz&Descriptor.__init__..s3$$,- $$s)+c38K|]}|j|fywr!rrs rrz&Descriptor.__init__..rrc38K|]}|j|fywr!r)ros rrz&Descriptor.__init__..s@q{@r)_internal_create_keyr8rrrOrr}rEdictfields_by_numberfields_by_name_fields_by_camelcase_namernested_types_by_namerenum_types_by_nameenum_values_by_namerextension_scopeextensions_by_namerrroneofs_by_name _is_map_entry)r'r=r|rr}rrrrrLrMrrrrErrrrrfield nested_type enum_type extensiononeofrs rrOzDescriptor.__init__s:--01 *d$  )%-% "DK"eej! ? ??D;F;;D%)D"$D#) $(k!) $$G,$G GD DO__' "&i'""C "CCD#$'$ D!DO__' "&i'""C "CCD&D,D".&BDK@DKK@@D"eej&Drc6|jxs |jSr!r}rEr*s rrQzDescriptor._parent    ,499,rct|j!td|jD|_|jS)zsSame FieldDescriptor objects as in :attr:`fields`, but indexed by :attr:`FieldDescriptor.camelcase_name`. c38K|]}|j|fywr!)camelcase_namers rrz6Descriptor.fields_by_camelcase_name..s ,$%1  Q ,r)rrrr*s rfields_by_camelcase_namez#Descriptor.fields_by_camelcase_names<  %%-'+,)-,(d$  ) ))rcN|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. )rvalues_by_numberr=)r'enumvalues r EnumValueNamezDescriptor.EnumValueNames&  " "4 ( 9 9% @ E EErc,tt| |y)zvCopies this to a descriptor_pb2.DescriptorProto. Args: proto: An empty descriptor_pb2.DescriptorProto. N)rrrr'rrs rrzDescriptor.CopyToProtos *d'.r)NNNNNNNNNNTNNNNNNFN) NNTNNNNNNFN)r r r r rtrrrr#rOrurQrrrrrs@rrr@s)V"-- )DL   )Q&f - -  *  *F$//rrc$eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd Zd Z d Z!ieeeeeeeeeeeeeee eeeeeeeeee eeee ee eee e e iZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)e*re+jXZ- d$dZ. d$fd Z/e0dZ1dZ2e0dZ3e3jhdZ3e0dZ5e0dZ6e0dZ7e0d Z8e0d!Z9e0d"Z:e;d#Z<xZ=S)%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. r4r?r5 ii8JiNctjj| rtjj |Stjj |Sr!)rrrrFindExtensionByNameFindFieldByName)rr=r|indexrtypecpp_typelabel default_value message_typerr} is_extensionrrLrMhas_default_valuecontaining_oneof json_namerErs rr#zFieldDescriptor.__new__sG.446 $$88CC$$44Y??rc@|tur tdtt||||d||_||_d|_|t||_ n||_ ||_ ||_ ||_ ||_ ||_||_||_| |_| |_| |_| |_| |_||_t/j0dk(rd|_y| r%t4j6j9||_yt4j6j;||_y)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. z!create function FieldDescriptor() FieldOptionsNr)rr8rrrOr=r|_camelcase_name _ToJsonNamerrr_typer_labelrrr}rrrrrrType _cdescriptorrrrr)r'r=r|rrrrrrrrr}rrrLrMrrrrErrs rrOzFieldDescriptor.__init__s>--56 /4) g)>DIDND"4(dn dnDJDKDJDMDK.D&D*D$DDN$D*D,D H,d $11EEiP$11AA)Lrc|jr |jS|jr|jxs |jS|jSr!)rrrrEr}r*s rrQzFieldDescriptor._parentsA   " ""   ! ! .TYY.   rcddlm}||jjk\ry|jt j k(r%|jjj|_ |jt jk(r%|jjj|_|j!drR|j"r |jj$j&n|jj$j(|_yy)NrrZpacked)r\r[rk EDITION_2023rrLABEL_REQUIREDr] FieldPresenceLEGACY_REQUIREDfield_presencer TYPE_GROUPMessageEncoding DELIMITEDmessage_encodingrnrRepeatedFieldEncodingPACKEDEXPANDEDrepeated_field_encoding)r'rSrLrTr[s rrUz$FieldDescriptor._InferLegacyFeaturess..((555  {{o444  # # 1 1 A A zz_///  # # 3 3 = =!^^  # # 9 9 @ @((>>GG&"rc$|jjtk(rd|jrX|jj j s4|j j j stjS|jSr!) rXr&_FEATURESET_MESSAGE_ENCODING_DELIMITEDrrs map_entryr}rrrr*s rrzFieldDescriptor.type sm ,, 1 2   !!,,.88$$//1;;  ' '' ::rc||_yr!)r)r'vals rrzFieldDescriptor.types DJrctdd|jjtk(rtj S|j S)Nzlabel propertyz%is_required or is_repeated properties)r8rXr*_FEATURESET_FIELD_PRESENCE_LEGACY_REQUIREDrrrr*s rrzFieldDescriptor.labelsB "IJ ** 5 6 + ++ ;;rcD|jjtk(S)z!Returns if the field is required.)rXrrr*s r is_requiredzFieldDescriptor.is_required%s# ** 5 6rc<|jtjk(S)z!Returns if the field is repeated.)rrLABEL_REPEATEDr*s r is_repeatedzFieldDescriptor.is_repeated-s ;;/88 88rcf|jt|j|_|jS)zRCamelcase name of this field. Returns: str: the name in CamelCase. )r _ToCamelCaser=r*s rrzFieldDescriptor.camelcase_name2s- #)$))4d   rc|jry|jtjk(s|js |j ry|j jtk7S)zWhether the field distinguishes between unpopulated and default values. Raises: RuntimeError: singular field that is not linked with message nor file. FT) rrrCPPTYPE_MESSAGErrrXr#_FEATURESET_FIELD_PRESENCE_IMPLICITr*s r has_presencezFieldDescriptor.has_presence=sX   888      ** . /rc|jsy|j}|tjk(s9|tjk(s&|tj k(s|tj k(ry|jjtk(S)zReturns if the field is packed.F) rrr TYPE_STRINGr TYPE_MESSAGE TYPE_BYTESrXr*_FEATURESET_REPEATED_FIELD_ENCODING_PACKED)r' field_types r is_packedzFieldDescriptor.is_packedRsu    Jo111 33 3 55 5 33 3  33 5 6rc` tj|S#t$rtd|zwxYw)aConverts 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: %s)r_PYTHON_TO_CPP_PROTO_TYPE_MAPKeyErrorr) proto_types rProtoTypeToCppProtoTypez'FieldDescriptor.ProtoTypeToCppProtoTypees; K  : :: FF K #$r r r r TYPE_DOUBLE TYPE_FLOAT TYPE_INT64 TYPE_UINT64 TYPE_INT32 TYPE_FIXED64 TYPE_FIXED32 TYPE_BOOLrrrr TYPE_UINT32 TYPE_ENUM TYPE_SFIXED32 TYPE_SFIXED64 TYPE_SINT32 TYPE_SINT64MAX_TYPE CPPTYPE_INT32 CPPTYPE_INT64CPPTYPE_UINT32CPPTYPE_UINT64CPPTYPE_DOUBLE CPPTYPE_FLOAT CPPTYPE_BOOL CPPTYPE_ENUMCPPTYPE_STRINGr MAX_CPPTYPEr#LABEL_OPTIONALrr MAX_LABELMAX_FIELD_NUMBERFIRST_RESERVED_FIELD_NUMBERLAST_RESERVED_FIELD_NUMBERrtrrrr#rOrurQrUrsetterrrrrrr! staticmethodr&rrs@rrrs%V+**+*,,)+*,*+)--++ ( --...-,,./+#>#-##- # = # ] #>#N#-#]#=#>#N#.#># !#"O##$/%#2...)# %$"22" +@X +?MB    0    ;;     9 9      (  $KKrrceZdZdZerej Z ddZ dfd Z e dZ e dZ fdZ xZS)EnumDescriptoraDescriptor 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. c |tjjtjj |Sr!)rrrrFindEnumTypeByName) rr=r|rrr}rLrMrErrrs rr#zEnumDescriptor.__new__s-446  " " 5 5i @@rc | tur tdtt||d||||| | | ||_|j D]} || _|| _td|D|_ tdt|D|_ y)zArguments 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. z create function EnumDescriptor() EnumOptionsrc38K|]}|j|fywr!rrrs rrz*EnumDescriptor.__init__..rrc38K|]}|j|fywr!rrNs rrz*EnumDescriptor.__init__..s I1!((A IrN) rr8rrHrOrrErrvalues_by_namereversedr)r'r=r|rrr}rLrMrErrrrrs rrOzEnumDescriptor.__init__s&--45 .$(  )%-) DKejej;F;;D I8H IIDrc6|jxs |jSr!rr*s rrQzEnumDescriptor._parentrrcD|jjtk(S)a:Returns true whether this is a "closed" enum. This means that it: - Has a fixed set of values, rather than being equivalent to an int32. - Encountering values not in this set causes them to be treated as unknown fields. - The first value (i.e., the default) may be nonzero. WARNING: Some runtimes currently have a quirk where non-closed enums are treated as closed when used as the type of fields defined in a `syntax = proto2;` file. This quirk is not present in all runtimes; as of writing, we know that: - C++, Java, and C++-based Python share this quirk. - UPB and UPB-based Python do not. - PHP and Ruby treat all enums as open regardless of declaration. Care should be taken when using this function to respect the target runtime's enum handling quirks. )rXr_FEATURESET_ENUM_TYPE_CLOSEDr*s r is_closedzEnumDescriptor.is_closeds,     ( (,H HHrc,tt| |y)zCopies this to a descriptor_pb2.EnumDescriptorProto. Args: proto (descriptor_pb2.EnumDescriptorProto): An empty descriptor proto. N)rrHrrs rrzEnumDescriptor.CopyToProtos .$+E2r)NNNNNNN)r r r r rtrrHrr#rOrurQrUrrrs@rrHrH{s&"11 A. (JT - - I I.33rrHcheZdZdZerej Z ddZ dfd Z e dZ xZ S)EnumValueDescriptoraEDescriptor 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. c@tjjyr!)rrr)rr=rrrrLrMrs rr#zEnumValueDescriptor.__new__s446 rc|tur tdtt||r |j nd||d||_||_||_||_ y)>Arguments are as described in the attribute description above.z%create function EnumValueDescriptor()NEnumValueOptions) rr8rrXrOrEr=rrr) r'r=rrrrLrMrrs rrOzEnumValueDescriptor.__init__sY--9: t- t  DIDJDKDIrc|jSr!)rr*s rrQzEnumValueDescriptor._parent. 99r)NNNN) r r r r rtrrXrr#rOrurQrrs@rrXrXsS "66, 2  rrXcdeZdZdZerej Z ddZ dfd Z e dZ xZ 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. c |tjjtjj |Sr!)rrrrFindOneofByName) rr=r|rr}rrLrMrs rr#zOneofDescriptor.__new__Es-446  " " 2 29 ==rc |tur tdtt||r |j nd||d||_||_||_||_ ||_ y)r[z!create function OneofDescriptor()N OneofOptions) rr8rr`rOrEr=r|rr}r) r'r=r|rr}rrLrMrrs rrOzOneofDescriptor.__init__Ssb--56 /4) /T  DIDNDJ*DDKrc|jSr!)r}r*s rrQzOneofDescriptor._parentns   rr) r r r r rtrr`rr#rOrurQrrs@rr`r`3sM "22 >*6    rr`ceZdZdZerej Z ddZ dfd Z e dZ dZ fdZ xZS) ServiceDescriptoraDescriptor 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. c |tjjtjj |Sr!)rrrrFindServiceByName) rr=r|rmethodsrLrMrErrrs rr#zServiceDescriptor.__new__s-446  " " 4 4Y ??rc | tur tdtt||d|||d|| | ||_||_td|D|_|j D]} |j| _ || _ y)Nz#create function ServiceDescriptor()ServiceOptionsrc38K|]}|j|fywr!r)rms rrz-ServiceDescriptor.__init__..s= =r) rr8rrgrOrrjrmethods_by_namerEcontaining_service) r'r=r|rrjrLrMrErrrmethodrs rrOzServiceDescriptor.__init__s--78 T+   )%-, DJDL=W==D,,'IIfk"&f'rc|jSr!)rEr*s rrQzServiceDescriptor._parentr^rc |j|S)aSearches for the specified method, and returns its descriptor. Args: name (str): Name of the method. Returns: MethodDescriptor: The descriptor for the requested method. Raises: KeyError: if the method cannot be found in the service. )ro)r'r=s rFindMethodByNamez"ServiceDescriptor.FindMethodByNames    %%rc,tt| |y)zCopies this to a descriptor_pb2.ServiceDescriptorProto. Args: proto (descriptor_pb2.ServiceDescriptorProto): An empty descriptor proto. N)rrgrrs rrzServiceDescriptor.CopyToProtos T.u5r) NNNNNNNNNN)NNNNNN)r r r r rtrrgrr#rOrurQrtrrrs@rrgrgss| "44 @, !'F   &66rrgcreZdZdZerej Z ddZ dfd Z e dZ dZ xZ S)MethodDescriptoraDescriptor 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. c |tjjtjj |Sr!)rrrrrt) rr=r|rrp input_type output_typeclient_streamingserver_streamingrLrMrs rr#zMethodDescriptor.__new__s-446  " " 3 3I >>rc | tur tdtt||r |j nd| | d||_||_||_||_ ||_ ||_ ||_ ||_ y)zThe 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. z"create function MethodDescriptor()N MethodOptions)rr8rrwrOrEr=r|rrpryrzr{r|) r'r=r|rrpryrzr{r|rLrMrrs rrOzMethodDescriptor.__init__s|(--67 D*#54  DIDNDJ0D DO"D,D,Drc|jSr!)rpr*s rrQzMethodDescriptor._parent#s  " ""rc|jZddlm}|j}|jj ||j |j |jytd)zCopies 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. NrrZz&Descriptor does not contain a service.) rpr\r[ServiceDescriptorProtorr^rqrr)r'rr[ service_protos rrzMethodDescriptor.CopyToProto's\ *0$;;=m ))-8 nn]))$**56 : ;;r)FFNNN)r r r r rtrrwrr#rOrurQrrrs@rrwrws_$"33?2$-L # #|jdr |jSy)zCReturns the value of the field `options`, or None if it is not set.rLN)rnrL)descriptor_protos r_OptionsOrNonersy)  # ## rcd}g}|D]3}|dk(rd} |r"|j|jd}/||z }5dj|S)z*Converts name to Json name and returns it.FrTr)rrrrs rrrsZ/ & aCxo  mmAGGIo kf rcDddlm}tjt j dj d}|r4tjj|jdd|dz}n|dz}tjdk7r|r|j} | jjj||r|| _|| _t$j&j)| t$j&j+| j"} t,r| j.|j"S|t1d ||||d d ggt2 }|j"g} |r| j5d|i} |j6D]} dj| | j"gz}t9| j"|d t;| j<Dcgc],\}}t?|j"||j@t2 .c}}|t2 }|| |<i}|jBD]F}dj| |j"gz}tE|dj| d|||}|||<Hg}|jFD](}dj| |j"gz}d }d }|jHr |jH}nd }|jKdrI|jL}dj| ||jOddzd gz}||vr||}n || vr| |}tQ|j"||j@dz |j@|jRtPjU|jR|jVd ||d dd tY|d||t2}|j[|+dj| }t]|j"|d d |t_|jat_| jagtY||t2 Scc}}w)apMake 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. edition: The edition that should be used if syntax is "edition". file_desc: A FileDescriptor to place this descriptor into. Returns: A Descriptor for protobuf messages. rrZrascii./z.protorNr) r_r=rrrSrLrrrr)r)rErF)rbuild_file_if_cpprrS file_desc type_namer4)rLrrrEr)rLrEr)1r\r[binasciihexlifyosurandomdecodepathrreplacerrFileDescriptorProtoraddrarr=rrAddFindFileByNamertrrrinsertrrH enumeraterrXrrMakeDescriptorrrrnrrfindrrr&rrrrlistr) desc_protorrrrSrr[ proto_name file_namefile_descriptor_protorfull_message_namer enum_protor|iienum_val enum_descr nested_proto nested_descr field_protorrfull_type_namer desc_names rrrs8-  2/66w?*  W__S#6 X8MNIX%I(*/@ +>>@&&**,66zB&-#!* 34  " " 1 12G2L2L MF  ) )*// ::  ' I"' Q(*((&j*joo->>?I !***:*: ; H  /   'I &Jy%&*, ,, *l*l.?.?-@@AI!*+ K*L * &%%&k*k.>.>-??@IIK''iiK(''ixx y)=)A)CDE En < '">2 Z '~. Q// 0@0@A    {+ '% E( MM%M&Phh()) oo    <   ! :   Z( %  Q s1P)zEget/find descriptors from generated code or query the descriptor_pool)rTNNN)/r __author__rvrrr$r:google.protobuf.internalrrtr _c_modulergoogle.protobuf.pyext ExceptionrrrrABCMetar"rr%r&r8r rrrrTr9rrBrzrrrHrXr`rgrwrrmrrrrr rrrs 3  7(  ) )( .$I$QeQ D  F    X  *+&&'#-.*-.*  xN2Nb@@N@@FG/&G/jcKncKL u3*u3p=.=@= n= @`6-`6Fb<~b