+
    i                         R t ^ RIHt ^ RIHt ^ RIHtHtHtHtH	t	H
t
 ]t]
]]3,          t ! R R]P                  4      tR# )zCImplementation of the metadata abstraction for gRPC Asyncio Python.)OrderedDict)abc)AnyIteratorListOptionalTupleUnionc                     a  ] tR t^t o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltV 3R lR	 lt	V 3R
 lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR*V 3R lR lltV 3R lR ltV 3R lR  ltV 3R! lR" ltV 3R# lR$ ltV 3R% lR& ltV 3R' lR( ltR)tV tR# )+Metadataa  Metadata abstraction for the asynchronous calls and interceptors.

The metadata is a mapping from str -> List[str]

Traits
    * Multiple entries are allowed for the same key
    * The order of the values by key is preserved
    * Getting by an element by key, retrieves the first mapped value
    * Supports an immutable view of the data
    * Allows partial mutation on the data without recreating the new object from scratch.
c                :   < V ^8  d   QhRS[ S[S[3,          RR/# )   argsreturnN)r   MetadataKeyMetadataValue)format__classdict__s   "e/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/grpc/aio/_metadata.py__annotate__Metadata.__annotate__$   s%     ' 'eK$>? 'D '    c                \    \        4       V n        V F  w  r#V P                  W#4       K  	  R # N)r   	_metadataadd)selfr   md_keymd_values   &*  r   __init__Metadata.__init__$   s$    $ $FHHV& !%r   c                    < V ^8  d   QhRS[ /# )r   raw_metadata)tuple)r   r   s   "r   r   r   *   s      e r   c                ,    V'       d   V ! V!  # V ! 4       # r    )clsr"   s   &&r   
from_tupleMetadata.from_tuple)   s    %%ur   c                *   < V ^8  d   QhRS[ RS[RR/# r   keyvaluer   Nr   r   )r   r   s   "r   r   r   /   s"     * *{ *= *T *r   c                    V P                   P                  V. 4       V P                   V,          P                  V4       R # r   )r   
setdefaultappend)r   r+   r,   s   &&&r   r   Metadata.add/   s-    !!#r*s""5)r   c                    < V ^8  d   QhRS[ /# r   r   )int)r   r   s   "r   r   r   3   s     6 6 6r   c                d    \        \        \        V P                  P	                  4       4      4      # )zpReturn the total number of elements that there are in the metadata,
including multiple values for the same key.
)summaplenr   valuesr   s   &r   __len__Metadata.__len__3   s#     3sDNN113455r   c                &   < V ^8  d   QhRS[ RS[/# r   r+   r   r-   )r   r   s   "r   r   r   9   s     - -{ -} -r   c                     V P                   V,          ^ ,          #   \        \        3 d   pT: p\        T4      ThRp?ii ; i)z]When calling <metadata>[<key>], the first element of all those
mapped for <key> is returned.
N)r   
ValueError
IndexErrorKeyError)r   r+   e	error_msgs   &&  r   __getitem__Metadata.__getitem__9   sD    	->>#&q))J' 	-'I9%1,	-s    A=Ac                *   < V ^8  d   QhRS[ RS[RR/# r*   r-   )r   r   s   "r   r   r   C   s"     ? ?{ ?= ?T ?r   c                    W9  d   V.V P                   V&   R# V P                  V4      pV.VR,          OV P                   V&   R# )zOCalling metadata[<key>] = <value>
Maps <value> to the first instance of <key>.
   NNN)r   get_all)r   r+   r,   current_valuess   &&& r   __setitem__Metadata.__setitem__C   sB     ?#('DNN3!\\#.N#(">>"+=">DNN3r   c                $   < V ^8  d   QhRS[ RR/# r   r+   r   Nr   )r   r   s   "r   r   r   M   s     1 1{ 1t 1r   c                    V P                  V4      pV'       g   \        \        V4      4      hVR,          V P                  V&   R# )z<``del metadata[<key>]`` deletes the first mapping for <key>.rI   N)rK   rB   reprr   )r   r+   rL   s   && r   __delitem__Metadata.__delitem__M   s5    c*49%%,R0sr   c                $   < V ^8  d   QhRS[ RR/# rP   rQ   )r   r   s   "r   r   r   T   s        k  d  r   c                     V P                   V R# )zDelete all mappings for <key>.Nr   r   r+   s   &&r   
delete_allMetadata.delete_allT   s    NN3r   c                F   < V ^8  d   QhRS[ S[S[S[3,          ,          /# r3   )r   r   r   r   )r   r   s   "r   r   r   X   s#     # #(5m)C#DE #r   c              #  p   "   V P                   P                  4        F  w  rV F  pW3x  K
  	  K  	  R # 5ir   )r   items)r   r+   r9   r,   s   &   r   __iter__Metadata.__iter__X   s0     >>//1KCl"   2s   46c                4   < V ^8  d   QhRS[ P                  /# r3   r   KeysView)r   r   s   "r   r   r   ]   s     " "cll "r   c                .    \         P                  ! V 4      # r   rb   r:   s   &r   keysMetadata.keys]   s    ||D!!r   c                4   < V ^8  d   QhRS[ P                  /# r3   r   
ValuesView)r   r   s   "r   r   r   `   s     $ $ $r   c                .    \         P                  ! V 4      # r   rh   r:   s   &r   r9   Metadata.values`   s    ~~d##r   c                4   < V ^8  d   QhRS[ P                  /# r3   r   	ItemsView)r   r   s   "r   r   r   c   s     # #s}} #r   c                .    \         P                  ! V 4      # r   rm   r:   s   &r   r^   Metadata.itemsc   s    }}T""r   Nc                <   < V ^8  d   QhRS[ RS[RS[S[,          /# )r   r+   defaultr   )r   r   r   )r   r   s   "r   r   r   f   s*      )6	-	 r   c                :     W,          #   \          d    Tu # i ; ir   )rB   )r   r+   rr   s   &&&r   getMetadata.getf   s#    	9 	N	s   
 c                6   < V ^8  d   QhRS[ RS[S[,          /# r>   r   r   r   )r   r   s   "r   r   r   n   s      + +; +4+> +r   c                :    V P                   P                  V. 4      # )zFor compatibility with other Metadata abstraction objects (like in Java),
this would return all items under the desired <key>.
)r   rt   rY   s   &&r   rK   Metadata.get_alln   s     ~~!!#r**r   c                :   < V ^8  d   QhRS[ RS[S[,          RR/# )r   r+   r9   r   Nrw   )r   r   s   "r   r   r   t   s'     % %; %]0C % %r   c                "    W P                   V&   R # r   rX   )r   r+   r9   s   &&&r   set_allMetadata.set_allt   s    $sr   c                &   < V ^8  d   QhRS[ RS[/# r>   )r   bool)r   r   s   "r   r   r   w   s     % % % %r   c                    WP                   9   # r   rX   rY   s   &&r   __contains__Metadata.__contains__w   s    nn$$r   c                &   < V ^8  d   QhRS[ RS[/# )r   otherr   )objectr   )r   r   s   "r   r   r   z   s      F t r   c                    \        WP                  4      '       d   V P                  VP                  8H  # \        V\        4      '       d   \        V 4      V8H  # \        # r   )
isinstance	__class__r   r#   NotImplementedr   r   s   &&r   __eq__Metadata.__eq__z   sF    e^^,,>>U__44eU##;%''r   c                $   < V ^8  d   QhRS[ RR/# )r   r   r   r   )r   )r   r   s   "r   r   r      s      S Z r   c                    \        WP                  4      '       d#   \        \        V 4      \        V4      ,           !  # \        V\        4      '       d   \        \        V 4      V,           !  # \        # r   )r   r   r   r#   r   r   s   &&r   __add__Metadata.__add__   sP    e^^,,eDkE%L8::eU##eDkE133r   c                    < V ^8  d   QhRS[ /# r3   )str)r   r   s   "r   r   r      s     B B# Br   c                d    \        V 4      pR P                  V P                  P                  V4      # )z
{0}({1!r}))r#   r   r   __name__)r   views   & r   __repr__Metadata.__repr__   s(    T{""4>>#:#:DAAr   rX   r   )r   
__module____qualname____firstlineno____doc__r   classmethodr'   r   r;   rE   rM   rT   rZ   r_   re   r9   r^   rt   rK   r|   r   r   r   r   __static_attributes____classdictcell__)r   s   @r   r   r      s     
' '
  
* *6 6- -? ?1 1   # #
" "$ $# # + +% %% %  B Br   r   N)r   collectionsr   r   typingr   r   r   r   r   r	   r   r   bytesr   
Collectionr   r%   r   r   <module>r      s>    J #  > >c5j!sBs~~ sBr   