
    Ng                         d dl mZ d dlmZ d dlmZ d dlmZ  G d d          Z G d de          Z	 G d	 d
e          Z
dZdS )    )EnumMeta)descriptor_pb2)EnumTypeWrapper)	ProtoTypec            	           e Zd ZdZdZdddddddedededefd	Ze	d
             Z
e	defd            Ze	defd            Ze	d             ZdS )Fieldz8A representation of a type of field in protocol buffers.FN)messageenumoneof	json_nameoptionalnumberr   r   r   c                .   d | _         d | _        t          |t                    s9t          |t          t
          f          r|}t          j        }n|}t          j        }|| _	        || _
        || _        || _        || _        || _        || _        d | _        d S )N)	mcls_dataparent
isinstanceintr   r   r   ENUMMESSAGEr   
proto_typer	   r
   r   r   r   _descriptor)selfr   r   r	   r
   r   r   r   s           H/var/www/html/ai-engine/env/lib/python3.11/site-packages/proto/fields.py__init__zField.__init__   s      *c** 	/ *x&ABB /!&^

$&.
 $	" 

      c           	      >   | j         sd}t          | j        t                    rM| j                            | j                  s&d                    | j        | j                  | _        | j        }n| j        r8t          | j        d          r| j        j        j	        n| j        j
        j	        }nt          | j        t                    rM| j                            | j                  s&d                    | j        | j                  | _        | j        }n>| j        r7t          | j        d          r| j        j        j	        n| j        j
        j	        }t          j        | j        | j        | j        rdnd| j        || j        | j                  | _         | j         S )z$Return the descriptor for the field.Nz{package}.{name})packagename
DESCRIPTOR      )r   r   labeltype	type_namer   proto3_optional)r   r   r	   str
startswithr   formathasattrr   	full_name_metar
   r   FieldDescriptorProtor   r   repeatedr   r   r   )r   r$   s     r   
descriptorzField.descriptorH   s     '	I$,,, |..t|<< #5#<#< $!\ $= $ $DL !L		  t|\::6DL+55+5 	
 DIs++ y++DL99  2 9 9 $!Y !: ! !DI !I		  ty,773DI(222   .BY{=/aaa_#. $     D r   returnc                     | j         d         S )zReturn the name of the field.r   r   r   s    r   r   z
Field.namew   s     ~f%%r   c                     | j         d         S )z Return the package of the field.r   r1   r2   s    r   r   zField.package|   s     ~i((r   c                     | j         r| j         S | j        s| j        S t          | j        d          r| j                                        S | j        S )zMReturn the composite type of the field, or the primitive type if a primitive.r+   )r
   r	   r   r)   pbr2   s    r   pb_typezField.pb_type   sZ     9 	9 | 	#?" 4<)) 	%<??$$$|r   )__name__
__module____qualname____doc__r-   r   r&   boolr   propertyr.   r   r   r6    r   r   r   r      s        BB H (  (  (  	(  (  (  (  (  (  ( T ,  ,  X, \ &c & & & X& ) ) ) ) X)   X  r   r   c                       e Zd ZdZdZdS )RepeatedFieldz9A representation of a repeated field in protocol buffers.TN)r7   r8   r9   r:   r-   r=   r   r   r?   r?      s        CCHHHr   r?   c                   0     e Zd ZdZddddef fdZ xZS )MapFieldz4A representation of a map field in protocol buffers.N)r	   r
   r   c                `    t                                          ||||           || _        d S )N)r   r	   r
   )superr   map_key_type)r   key_type
value_typer   r	   r
   	__class__s         r   r   zMapField.__init__   s2    FG$OOO$r   )r7   r8   r9   r:   r   r   __classcell__)rG   s   @r   rA   rA      sZ        >>EIPT % % % % % % % % % % % % %r   rA   )r   rA   r?   N)r
   r   google.protobufr   *google.protobuf.internal.enum_type_wrapperr   proto.primitivesr   r   r?   rA   __all__r=   r   r   <module>rM      s          * * * * * * F F F F F F & & & & & &y y y y y y y yx    E   % % % % %u % % %r   