hfjdZddlmZddlZddlZddlmZddlmZddlmZddlm Z dZ d d Z d Z dS) zDynamic Protobuf class creator.) OrderedDictN)descriptor_pb2) descriptor)descriptor_pool)message_factorycX||}tj|}|S)a-Get a proto class from the MessageFactory by name. Args: pool: a descriptor pool. full_name: str, the fully qualified name of the proto type. Returns: A class, for the type identified by full_name. Raises: KeyError, if the proto is not found in the factory's descriptor pool. )FindMessageTypeByNamerGetMessageClass)pool full_nameproto_descriptor proto_clss /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/google/protobuf/proto_builder.py_GetMessageFromFactoryr+s/// ::-.>??) c|ptj}|# t||}|S#t$rYnwxYw|}t |t st|}tj }|D]b\}}| | d| t| dc| dz} |:d| z} t||}|S#t$rYnwxYw|t| ||t||S)aCreate a Protobuf class whose fields are basic types. Note: this doesn't validate field names! Args: fields: dict of {name: field_type} mappings for each field in the proto. If this is an OrderedDict the order will be maintained, otherwise the fields will be sorted by name. full_name: optional str, the fully-qualified name of the proto type. pool: optional DescriptorPool instance. Returns: a class, the new protobuf class with a FileDescriptor. Nzutf-8z.protoz6net.proto2.python.public.proto_builder.AnonymousProto_)rDescriptorPoolrKeyErroritems isinstancersortedhashlibsha1updateencodestr hexdigestAdd_MakeFileDescriptorProto) fieldsr r pool_instancer field_items fields_hashf_namef_typeproto_file_names rMakeSimpleProtoClassr';s:/8::- ( BBi      d  + FK ( (&%%K +#44nffv}}W--...s6{{))'223333))++h6/I&&(()I ( BBi      d  ;GGIII  y 9 99s+ 88D.. D;:D;cT|dd\}}tj}tj|dd||_||_|j }||_t|dD]\}\}} |j } || _|tjjkr)|tjjtjjz dzz }|| _tjj| _| | _|S)zAPopulate FileDescriptorProto for MessageFactory's DescriptorPool../)rsplitrFileDescriptorProtoospathjoinreplacenamepackage message_typeadd enumeratefieldrFieldDescriptorFIRST_RESERVED_FIELD_NUMBERLAST_RESERVED_FIELD_NUMBERnumberFieldDescriptorProtoLABEL_OPTIONALlabeltype) r&r r"r3r2 file_proto desc_protof_numberr$r% field_protos rrrrs""3**-'4133*GLLc!:!:OLL*/*&**,,**/$-k1$=$=   h "&&((KK:-III  $ ?  $ @ ACD EFh"K&;JKK r)NN) __doc__ collectionsrrr.google.protobufrrrrrr'rrrrHs>&%###### ******&&&&&&++++++++++++    4:4:4:4:nr