
    rh                     x    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y)    )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y)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              s;t        |t        t
        f      r|}t        j                  }n|}t        j                  }|| _	        || _
        || _        || _        || _        || _        || _        d | _        y )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           _/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/proto/fields.py__init__zField.__init__   s      *c* *x&AB!&^^
$&..
 $	" 

      c           	      f   | j                   sd}t        | j                  t              r_| j                  j	                  | j
                        s,dj                  | j
                  | j                        | _        | j                  }n=| j                  rWt        | j                  d      r | j                  j                  j                  n| j                  j                  j                  }nt        | j                  t              r^| j                  j	                  | j
                        s,dj                  | j
                  | j                        | _        | j                  }nb| j                  rVt        | 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 !LL	 t||\: LL++55++55 
 DIIs+yy++DLL9 2 9 9 $!YY !: !DI !II	 tyy,7 II((2222   .BBYY{{==aa__#.. $ 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                  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   sS     9999 ||??" 4<<)<<??$$||r   )__name__
__module____qualname____doc__r-   r   r&   boolr   propertyr.   r   r   r6    r   r   r   r      s    B H (  	(  (  (  ( T ,  , \ &c & & ) ) )  r   r   c                       e Zd ZdZdZy)RepeatedFieldz9A representation of a repeated field in protocol buffers.TN)r7   r8   r9   r:   r-   r=   r   r   r?   r?      s
    CHr   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         |   ||||       || _        y )N)r   r	   r
   )superr   map_key_type)r   key_type
value_typer   r	   r
   	__class__s         r   r   zMapField.__init__   s!    FG$O$r   )r7   r8   r9   r:   r   r   __classcell__)rG   s   @r   rA   rA      s    >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 &y yxE %u %r   