${'=2 j d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z d Z dd Zd ZdS )zDynamic Protobuf class creator. )OrderedDictN)descriptor_pb2) descriptor)descriptor_pool)message_factoryc X | | }t j | }|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. )FindMessageTypeByNamer GetMessageClass)pool full_nameproto_descriptor proto_clss /builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib64/python3.11/site-packages/google/protobuf/proto_builder.py_GetMessageFromFactoryr + s/ // ::-.>??) c |pt j }|# t || }|S # t $ r Y nw xY w| }t | t st | }t j }|D ]b\ }}| | d | t | d c| dz } |:d| z } t || }|S # t $ r Y nw xY w| t | || t || S )a Create 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_)r DescriptorPoolr KeyErroritems isinstancer sortedhashlibsha1updateencodestr hexdigestAdd_MakeFileDescriptorProto) fieldsr r pool_instancer field_itemsfields_hashf_namef_typeproto_file_names r MakeSimpleProtoClassr' ; s :/8::-( BBi d + FK ( ( &%%K +# 4 4nffv}}W--...s6{{))'223333))++h6/ I&&(()I( BBi d ;GGI I I y 9 99s + 88D. . D;:D;c T | dd \ }}t j }t j | dd | |_ ||_ |j }||_ t |d D ]\ }\ }} |j } || _ |t j j k r)|t j j t j j z dz z }|| _ t j j | _ | | _ |S )zAPopulate FileDescriptorProto for MessageFactory's DescriptorPool.. /)rsplitr FileDescriptorProtoospathjoinreplacenamepackagemessage_typeadd enumeratefieldr FieldDescriptorFIRST_RESERVED_FIELD_NUMBERLAST_RESERVED_FIELD_NUMBERnumberFieldDescriptorProtoLABEL_OPTIONALlabeltype)r&