;iddlmZddlmZddlmZddlmZGddZGddeZ Gd d eZ d Z d S) )EnumMeta)descriptor_pb2)EnumTypeWrapper) ProtoTypec eZdZdZdZdddddddedededefd Ze d Z e d efd Z e d efd Z e dZ dS)Fieldz8A representation of a type of field in protocol buffers.FN)messageenumoneof json_nameoptionalnumberr r r c.d|_d|_t|ts9t|tt fr|}t j}n|}t j}||_ ||_ ||_ ||_ ||_ ||_||_d|_dS)N) mcls_dataparent isinstanceintrrrENUMMESSAGEr proto_typer r r r r _descriptor)selfrrr r r r r s @C:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\proto/fields.py__init__zField.__init__s *c** /*x&ABB /!&^ $&.  $  "    c >|jsd}t|jtrM|j|js&d|j|j|_|j}n|jr8t|jdr|jjj n|jj j }nt|j trM|j |js&d|j|j |_ |j }n>|j r7t|j dr|j jj n|j j j }tj |j|j|jrdnd|j||j|j|_|jS)z$Return the descriptor for the field.Nz{package}.{name})packagename DESCRIPTOR)rrlabeltype type_namer proto3_optional)rrr str startswithrformathasattrr full_name_metar rFieldDescriptorProtorrrepeatedrr r )rr$s r descriptorzField.descriptorHs' I$,,, |..t|<<#5#<#< $ !\$=$$DL!L  t|\::6DL+55+5 DIs++ y++DL99 2 9 9 $ !Y!:!!DI!I  ty,773DI(222 .BY{=/aaa_#. $    D rreturnc|jdS)zReturn the name of the field.rrrs rrz Field.namews~f%%rc|jdS)z Return the package of the field.rr1r2s rrz Field.package|s~i((rc|jr|jS|js|jSt|jdr|jS|jS)zMReturn the composite type of the field, or the primitive type if a primitive.r+)r r rr)pbr2s rpb_typez Field.pb_typesZ 9 9 | #? " 4< ) ) %>EIPT%%%%%%%%%%%%%rrA)rrAr?N) r rgoogle.protobufr*google.protobuf.internal.enum_type_wrapperrproto.primitivesrrr?rA__all__r=rrrMs******FFFFFF&&&&&&yyyyyyyyxE %%%%%u%%% r