
¦Ñ®hi  ã               @   sL   d  d l  Z  d  d l m Z d  d l m Z Gd d „  d e  j j ƒ Z d S)é    N)Úcached_property)ÚMessagec               @   sŽ   e  Z d  Z d Z e d d „  ƒ Z d d „  Z d d „  Z d d	 „  Z d
 d „  Z	 d d „  Z
 d d „  Z d d „  Z e d d „  ƒ Z d S)ÚMapCompositez½A view around a mutable sequence in protocol buffers.

    This implements the full Python MutableMapping interface, but all methods
    modify the underlying field container directly.
    c             C   s   t  |  j j ƒ  ƒ  j ƒ S)z2Return the protocol buffer type for this sequence.)ÚtypeÚpbZGetEntryClassÚvalue)Úself© r	   úp/home/www/academy-backend.kofcorporation.com/venv/lib/python3.12/site-packages/proto/marshal/collections/maps.pyÚ_pb_type   s    zMapComposite._pb_typec            C   s   | |  _  | |  _ d S)zöInitialize a wrapper around a protobuf map.

        Args:
            sequence: A protocol buffers map.
            marshal (~.MarshalRegistry): An instantiated marshal, used to
                convert values going to and from this map.
        N)Ú_pbÚ_marshal)r   ZsequenceÚmarshalr	   r	   r
   Ú__init__"   s    	zMapComposite.__init__c             C   s   | t  |  j ƒ  ƒ k S)N)ÚtupleÚkeys)r   Úkeyr	   r	   r
   Ú__contains__-   s    zMapComposite.__contains__c             C   s5   | |  k r t  | ƒ ‚ |  j j |  j |  j | ƒ S)N)ÚKeyErrorr   Ú	to_pythonr   r   )r   r   r	   r	   r
   Ú__getitem__5   s    zMapComposite.__getitem__c             C   sG   |  j  j |  j | d d ƒ} |  j | j ƒ  |  j | j | ƒ d  S)NÚstrictT)r   Úto_protor   r   ZClearZ	MergeFrom)r   r   r   Úpb_valuer	   r	   r
   Ú__setitem__<   s    zMapComposite.__setitem__c             C   s   |  j  j | ƒ d  S)N)r   Úpop)r   r   r	   r	   r
   Ú__delitem__G   s    zMapComposite.__delitem__c             C   s   t  |  j ƒ S)N)Úlenr   )r   r	   r	   r
   Ú__len__J   s    zMapComposite.__len__c             C   s   t  |  j ƒ S)N)Úiterr   )r   r	   r	   r
   Ú__iter__M   s    zMapComposite.__iter__c             C   s   |  j  S)N)r   )r   r	   r	   r
   r   P   s    zMapComposite.pbN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r    Úpropertyr   r	   r	   r	   r
   r      s   r   )ÚcollectionsZproto.utilsr   Zgoogle.protobuf.messager   ÚabcÚMutableMappingr   r	   r	   r	   r
   Ú<module>   s   