+
     h=  c                   s    ^ RI t ^ RIHtHt ^ RIHtHtHtHtH	t	 ^ RI
Ht ^ RIHt ^RIHt ^RIHt ^RIHt  ! R	 R
4      tR# )i    N)JSONDecodeErrorloads)DictListOptionalTupleUnion)	DataError)deprecated_function)JsonType)decode_dict_keys)Pathc                   s8  a  ] tR t^t o Rt]P                  ! 4       3V 3R lR lltR?V 3R lR lltV 3R lR lt	]P                  ! 4       3V 3R	 lR
 llt
]P                  ! 4       R@3V 3R lR lltV 3R lR lt]P                  ! 4       3V 3R lR llt]P                  ! 4       3V 3R lR llt]P                  ! 4       3V 3R lR llt]P                  ! 4       3V 3R lR lltV 3R lR lt]! RRR7      V 3R lR l4       t]P                  ! 4       3V 3R lR llt]P                  ! 4       3V 3R  lR! llt]tR"R#/V 3R$ lR% lltV 3R& lR' ltRAV 3R( lR) lltV 3R* lR+ ltRBV 3R, lR- lltRAV 3R. lR/ lltRAV 3R0 lR1 lltRCV 3R2 lR3 llt]P                  ! 4       3V 3R4 lR5 llt]P                  ! 4       3V 3R6 lR7 llt R]P                  ! 4       3V 3R8 lR9 llt!]! RR:R7      R; 4       t"]! RR:R7      R< 4       t#]! RR:R7      R= 4       t$R>t%V t&R# )DJSONCommandszjson commands.c                sv   < V ^8  d   QhRS[ RS[S[ ,          RS[S[,          RS[S[S[R3,          ,          /# )   namepathargsreturnN)strr   r   r	   r   intZformat__classdict__   "A/usr/lib/python3.14/site-packages/redis/commands/json/commands.py__annotate__JSONCommands.__annotate__   sC     ? ??'}?HLX?	eCI	?    c                s    V\        V4      .pV F#  pVP                  V P                  V4      4       K%  	  V P                  ! R.VO5!  # )zAppend the objects ``args`` to the array under the
``path` in key ``name``.

For more information see `JSON.ARRAPPEND <https://redis.io/commands/json.arrappend>`_..
zJSON.ARRAPPENDr   append_encodeexecute_command)selfr   r   r   piecesos   &&&*  r   	arrappendZJSONCommands.arrappend   sG     D	"AMM$,,q/* ##$4>v>>r   Nc                s   < V ^8  d   QhRS[ RS[ RS[RS[S[,          RS[S[,          RS[S[S[R3,          ,          /# )r   r   r   scalarstartstopr   N)r   r   r   r   r   r   r   r   r   r      se     K KK K 	K
 }K smK 
eCI	Kr   c                s    V\        V4      V P                  V4      .pVe'   VP                  V4       Ve   VP                  V4       V P                  ! R.VO5RV./ # )a
  
Return the index of ``scalar`` in the JSON array under ``path`` at key
``name``.

The search can be limited using the optional inclusive ``start``
and exclusive ``stop`` indices.

For more information see `JSON.ARRINDEX <https://redis.io/commands/json.arrindex>`_.
zJSON.ARRINDEXkeys)r   r   r   r   )r   r   r   r#   r$   r%   r    s   &&&&&& r   arrindexZJSONCommands.arrindex   s^    " D	4<<#78MM% d###OJfJD6JJr   c                sl   < V ^8  d   QhRS[ RS[ RS[RS[S[,          RS[S[S[R3,          ,          /# )r   r   r   indexr   r   N)r   r   r   r	   r   r   r   r   r   r   6   sG     ? ??"?+.?7;H~?	eCI	?r   c                s    V\        V4      V.pV F#  pVP                  V P                  V4      4       K%  	  V P                  ! R.VO5!  # )zInsert the objects ``args`` to the array at index ``index``
under the ``path` in key ``name``.

For more information see `JSON.ARRINSERT <https://redis.io/commands/json.arrinsert>`_.
zJSON.ARRINSERTr   )r   r   r   r(   r   r    r!   s   &&&&*  r   	arrinsertZJSONCommands.arrinsert6   sI     D	5)AMM$,,q/* ##$4>v>>r   c          	      `   < V ^8  d   QhRS[ RS[S[ ,          RS[S[S[R3,          ,          /# r   r   r   r   Nr   r   r   r   r   r   r   r   r   r   C   s<     Q QQ'}Q	eCI	Qr   c                @    V P                  RV\        V4      V.R7      # )zReturn the length of the array JSON value under ``path``
at key``name``.

For more information see `JSON.ARRLEN <https://redis.io/commands/json.arrlen>`_.
zJSON.ARRLENr&   r   r   r   r   r      &&&r   arrlenZJSONCommands.arrlenC   $     ##M4T$#PPr   c                sv   < V ^8  d   QhRS[ RS[S[ ,          RS[S[,          RS[S[S[ R3,          ,          /# )r   r   r   r(   r   N)r   r   r   r   r   r   r   r   r   r   M   sO     K KK smK }	K
 
eCI	Kr   c                s<    V P                  RV\        V4      V4      # )zPop the element at ``index`` in the array JSON value under
``path`` at key ``name``.

For more information see `JSON.ARRPOP <https://redis.io/commands/json.arrpop>`_.
zJSON.ARRPOPr/   )r   r   r   r(      &&&&r   arrpopZJSONCommands.arrpopM   s     ##M4TEJJr   c                s\   < V ^8  d   QhRS[ RS[ RS[RS[RS[S[S[R3,          ,          /# )r   r   r   r$   r%   r   N)r   r   r   r   r   r   r   r   r   Z   sJ     R RR"R+.R69R	eCI	Rr   c                s<    V P                  RV\        V4      W44      # )zTrim the array JSON value under ``path`` at key ``name`` to the
inclusive range given by ``start`` and ``stop``.

For more information see `JSON.ARRTRIM <https://redis.io/commands/json.arrtrim>`_.
zJSON.ARRTRIMr/   )r   r   r   r$   r%   s   &&&&&r   arrtrimZJSONCommands.arrtrimZ   s     ##ND#d)UQQr   c                sL   < V ^8  d   QhRS[ RS[S[ ,          RS[S[ ,          /# r   r   r   r   r   r   r   r   r   r   r   r   d   s/     O O OHSM Oc Or   c                r-   )zGet the type of the JSON value under ``path`` from key ``name``.

For more information see `JSON.TYPE <https://redis.io/commands/json.type>`_.
z	JSON.TYPEr.   r/   r0   r1   r   typeZJSONCommands.typed   $    
 ##Ks4yv#NNr   c                <   < V ^8  d   QhRS[ RS[S[ ,          RS[/# r7   r8   r   r   r   r   r   k   s+     O O OHSM O Or   c                r-   )zReturn the JSON value under ``path`` at key ``name``.

For more information see `JSON.RESP <https://redis.io/commands/json.resp>`_.
z	JSON.RESPr.   r/   r0   r1   r   respZJSONCommands.respk   r:   r   c          	      sp   < V ^8  d   QhRS[ RS[S[ ,          RS[S[S[S[ ,          R3,          ,          /# r+   )r   r   r   r   r   r   r   r   r   r   s@     R RR'}R	eDItO$	%Rr   c                r-   )zReturn the key names in the dictionary JSON value under ``path`` at
key ``name``.

For more information see `JSON.OBJKEYS <https://redis.io/commands/json.objkeys>`_.
zJSON.OBJKEYSr.   r/   r0   r1   r   objkeysZJSONCommands.objkeysr   s$     ##ND#d)4&#QQr   c                s\   < V ^8  d   QhRS[ RS[S[ ,          RS[S[S[,          ,          /# r7   )r   r   r   r   r   r   r   r   r   |   s7     Q QQ'}Q	hsm	Qr   c                r-   )zReturn the length of the dictionary JSON value under ``path`` at key
``name``.

For more information see `JSON.OBJLEN <https://redis.io/commands/json.objlen>`_.
zJSON.OBJLENr.   r/   r0   r1   r   objlenZJSONCommands.objlen|   r3   r   c                2   < V ^8  d   QhRS[ RS[ RS[RS[ /# r   r   r   numberr   r   r   r   r   r   r   r      )     
 
c 
 
c 
c 
r   c                Z    V P                  RV\        V4      V P                  V4      4      # )zIncrement the numeric (integer or floating point) JSON value under
``path`` at key ``name`` by the provided ``number``.

For more information see `JSON.NUMINCRBY <https://redis.io/commands/json.numincrby>`_.
zJSON.NUMINCRBYr   r   r   r   r   r   rA   r4   r   	numincrbyZJSONCommands.numincrby   s-     ##dCIt||F/C
 	
r   z4.0.0z deprecated since redisjson 1.0.0)ZversionZreasonc                r?   r@   rB   r   r   r   r   r      rC   r   c                rD   )zMultiply the numeric (integer or floating point) JSON value under
``path`` at key ``name`` with the provided ``number``.

For more information see `JSON.NUMMULTBY <https://redis.io/commands/json.nummultby>`_.
zJSON.NUMMULTBYrE   rF   r4   r   	nummultbyZJSONCommands.nummultby   s-     ##dCIt||F/C
 	
r   c                r;   r7   r   r   r   r   r   r   r   r      s+     	C 	C# 	CXc] 	C# 	Cr   c                :    V P                  RV\        V4      4      # )zEmpty arrays and objects (to have zero slots/keys without deleting the
array/object).

Return the count of cleared paths (ignoring non-array and non-objects
paths).

For more information see `JSON.CLEAR <https://redis.io/commands/json.clear>`_.
z
JSON.CLEARr/   r0   r1   r   clearZJSONCommands.clear   s     ##L$D	BBr   c                r;   )r   keyr   r   rI   r   r   r   r   r      s+     @ @# @Xc] @# @r   c                rJ   )zDelete the JSON value stored at key ``key`` under ``path``.

For more information see `JSON.DEL <https://redis.io/commands/json.del>`_.
zJSON.DELr/   )r   rL   r   r1   r   deleteZJSONCommands.delete   s    
 ##JSY??r   	no_escapeFc                s\   < V ^8  d   QhRS[ RS[S[,          RS[S[S[,          ,          /# )r   r   rN   r   )r   r   boolr   r	   r   r   r   r   r      s2      +3D>	$x.	!r   c               s>   V.pV'       d   VP                  R4       \        V4      ^ 8X  d&   VP                  \        P                  ! 4       4       M#V F  pVP                  \	        V4      4       K  	   V P
                  ! R.VO5RV./ #   \         d     R# i ; i)a  
Get the object stored as a JSON value at key ``name``.

``args`` is zero or more paths, and defaults to root path
```no_escape`` is a boolean flag to add no_escape option to get
non-ascii characters

For more information see `JSON.GET <https://redis.io/commands/json.get>`_.
ZnoescapezJSON.GETr&   N)r   Zlenr   	root_pathr   r   Z	TypeError)r   r   rN   r   r    Zps   &&$*  r   getZJSONCommands.get   s     MM*%t9>MM$..*+ c!f% 
	''
IVI4&II 		s   6B BBc                sL   < V ^8  d   QhRS[ S[,          RS[RS[ S[,          /# )r   r&   r   r   )r   r   r	   r   r   r   r   r      s/     
E 
Ec 
E# 
E$x. 
Er   c                sv    . pW1,          pVP                  \        V4      4       V P                  ! R.VO5RV/ # )z
Get the objects stored as a JSON values under ``path``. ``keys``
is a list of one or more keys.

For more information see `JSON.MGET <https://redis.io/commands/json.mget>`_.
z	JSON.MGETr&   r   r   r   )r   r&   r   r       &&& r   mgetZJSONCommands.mget   s;     c$i ##KD&DtDDr   c                s   < V ^8  d   QhRS[ RS[ RS[RS[S[,          RS[S[,          RS[S[,          RS[S[ ,          /# )r   r   r   objnxxxdecode_keysr   r   r	   r   rO   r   r   r   r   r      sa     %9 %9%9 %9 	%9
 TN%9 TN%9 d^%9 
#%9r   c                s&   V'       d   \        V4      pV\        V4      V P                  V4      .pV'       d   V'       d   \        R4      hV'       d   VP	                  R4       MV'       d   VP	                  R4       V P
                  ! R.VO5!  # )a  
Set the JSON value at key ``name`` under the ``path`` to ``obj``.

``nx`` if set to True, set ``value`` only if it does not exist.
``xx`` if set to True, set ``value`` only if it exists.
``decode_keys`` If set to True, the keys of ``obj`` will be decoded
with utf-8.

For the purpose of using this within a pipeline, this command is also
aliased to JSON.SET.

For more information see `JSON.SET <https://redis.io/commands/json.set>`_.
zNnx and xx are mutually exclusive: use one, the other or neither - but not bothZNXZXXzJSON.SET)r
   r   r   Z	Exceptionr   r   )r   r   r   rU   rV   rW   rX   r    s   &&&&&&& r   setZJSONCommands.set   sy    , "3'CD	4<<#45 "2  MM$MM$##J888r   c                s`   < V ^8  d   QhRS[ S[S[S[S[3,          ,          RS[S[,          /# )r   tripletsr   )r   r   r   r	   r   r   r   r   r   r     s0     : :T%S((:";< :# :r   c           	     s    . pV FD  pVP                  V^ ,          \        V^,          4      V P                  V^,          4      .4       KF  	  V P                  ! R.VO5!  # )aH  
Set the JSON value at key ``name`` under the ``path`` to ``obj``
for one or more keys.

``triplets`` is a list of one or more triplets of key, path, value.

For the purpose of using this within a pipeline, this command is also
aliased to JSON.MSET.

For more information see `JSON.MSET <https://redis.io/commands/json.mset>`_.
z	JSON.MSET)Zextendr   r   r   )r   r[   r    Ztriplets   &&  r   msetZJSONCommands.mset  sU     GMM71:s71:WQZ8PQR  ##K9&99r   c                sX   < V ^8  d   QhRS[ RS[ RS[RS[S[,          RS[S[ ,          /# )r   r   r   rU   rX   r   rY   r   r   r   r   r     sE     ; ;; ; 	;
 d^; 
#;r   c                s    V'       d   \        V4      pV\        V4      V P                  V4      .pV P                  ! R.VO5!  # )a1  
Merges a given JSON value into matching paths. Consequently, JSON values
at matching paths are updated, deleted, or expanded with new children

``decode_keys`` If set to True, the keys of ``obj`` will be decoded
with utf-8.

For more information see `JSON.MERGE <https://redis.io/commands/json.merge>`_.
z
JSON.MERGE)r
   r   r   r   )r   r   r   rU   rX   r    s   &&&&& r   mergeZJSONCommands.merge  s@      "3'CD	4<<#45##L:6::r   c                s   < V ^8  d   QhRS[ RS[ RS[ RS[S[,          RS[S[,          RS[S[,          RS[S[ ,          /# )r   r   r   	file_namerV   rW   rX   r   )r   r   rO   r   r   r   r   r   )  sj     Y YY Y 	Y
 TNY TNY d^Y 
#Yr   c           	     s    \        V4      ;_uu_ 4       p\        VP                  4       4      pRRR4       V P                  WXWEVR7      #   + '       g   i     L%; i)a0  
Set the JSON value at key ``name`` under the ``path`` to the content
of the json file ``file_name``.

``nx`` if set to True, set ``value`` only if it does not exist.
``xx`` if set to True, set ``value`` only if it exists.
``decode_keys`` If set to True, the keys of ``obj`` will be decoded
with utf-8.

NrV   rW   rX   )Zopenr   ZreadrZ   )	r   r   r   r^   rV   rW   rX   ZfpZfile_contents	   &&&&&&&  r   set_fileZJSONCommands.set_file)  sE    ( )__ +L  xxLRKxXX _s   AA	c                s   < V ^8  d   QhRS[ RS[ RS[S[,          RS[S[,          RS[S[,          RS[S[ S[3,          /# )r   	json_pathroot_folderrV   rW   rX   r   )r   r   rO   r   r   r   r   r   r   B  s[     $  $ $  $  TN	$ 
 TN$  d^$  
c4i$ r   c                s.   / p\         P                  ! V4       Fb  w  rxp	V	 FV  p
\         P                  P                  Wz4      p VP	                  R4      ^ ,          pV P                  VVVVVVR7       RWk&   KX  	  Kd  	  V#   \         d	    RYk&    Kr  i ; i)a=  
Iterate over ``root_folder`` and set each JSON file to a value
under ``json_path`` with the file name as the key.

``nx`` if set to True, set ``value`` only if it does not exist.
``xx`` if set to True, set ``value`` only if it exists.
``decode_keys`` If set to True, the keys of ``obj`` will be decoded
with utf-8.

Z.r_   TF)osZwalkr   ZjoinZrsplitr`   r    )r   ra   rb   rV   rW   rX   Zset_files_resultZrootZdirsZfilesZfileZ	file_pathr^   s   &&&&&&       r   set_pathZJSONCommands.set_pathB  s    $ !#!5DGGLL4	8 ) 0 0 5a 8IMM!!!$/ "  37$/  "6"   ' 827$/8s   3BBBc          	      r*   r+   r,   r   r   r   r   r   h  s9     	I 	I3 	Ihsm 	ItE#t)DT?U 	Ir   c                sr    V.pVe   VP                  \        V4      4       V P                  ! R.VO5RV./ # )zReturn the length of the string JSON value under ``path`` at key
``name``.

For more information see `JSON.STRLEN <https://redis.io/commands/json.strlen>`_.
zJSON.STRLENr&   rR   )r   r   r   r    rS   r   strlenZJSONCommands.strlenh  s>     MM#d)$##MHFH$HHr   c          
      sr   < V ^8  d   QhRS[ RS[S[ ,          RS[S[S[S[S[,          ,          3,          /# r7   )r   r   r   rO   r   r   r   r   r   r   r   s  sA     D DD'}D	tT(3-((	)Dr   c                rJ   )zToggle boolean value under ``path`` at key ``name``.
returning the new value.

For more information see `JSON.TOGGLE <https://redis.io/commands/json.toggle>`_.
zJSON.TOGGLEr/   r0   r1   r   toggleZJSONCommands.toggles  s     ##M4TCCr   c                sx   < V ^8  d   QhRS[ RS[ RS[S[ ,          RS[S[S[S[S[,          ,          3,          /# )r   r   valuer   r   r   r   r   r   r   r   r   r   r   r   }  sD     
? 
?
? #
?+3C=
?	sD#''	(
?r   c                sd    V\        V4      V P                  V4      .pV P                  ! R.VO5!  # )a#  Append to the string JSON value. If two options are specified after
the key name, the path is determined to be the first. If a single
option is passed, then the root_path (i.e Path.root_path()) is used.

For more information see `JSON.STRAPPEND <https://redis.io/commands/json.strappend>`_.
zJSON.STRAPPEND)r   r   r   )r   r   rg   r   r    s   &&&& r   	strappendZJSONCommands.strappend}  s4     D	4<<#67##$4>v>>r   c                sx   < V ^8  d   QhRS[ RS[S[ ,          RS[S[ ,          RS[S[S[S[ ,          3,          /# )r   
subcommandrL   r   r   rh   r   r   r   r   r     sH     ; ;; c]; sm	;
 
sDI~	;r   c                s    RR.pW9  d   \        R\        V4      4      hV.pVR8X  d;   Vf   \        R4      hVP                  V4       VP                  \        V4      4       V P                  ! R.VO5!  # )zReturn the memory usage in bytes of a value under ``path`` from
key ``name``.

For more information see `JSON.DEBUG <https://redis.io/commands/json.debug>`_.
ZMEMORYZHELPzThe only valid subcommands are zNo key specifiedz
JSON.DEBUG)r   r   r   r   )r   rj   rL   r   Zvalid_subcommandsr    s   &&&&  r   debugZJSONCommands.debug  s{     &v..=sCT?UVV!{ 233MM#MM#d)$##L:6::r   z/redisjson-py supported this, call get directly.c                &    V P                   ! V/ VB # N)rQ   r   r   Zkwargs   &*,r   jsongetZJSONCommands.jsonget       xx(((r   c                rl   rm   )rT   rn   ro   r   jsonmgetZJSONCommands.jsonmget  s     yy$)&))r   c                rl   rm   )rZ   rn   ro   r   jsonsetZJSONCommands.jsonset  rq   r    )NNi)FFF)Frm   )'Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   rP   r"   r'   r)   r2   r5   r6   r9   r<   r=   r>   rG   r   rH   rK   rM   ZforgetrQ   rT   rZ   r\   r]   r`   rd   re   rf   ri   rk   rp   rr   rs   Z__static_attributes__Z__classdictcell__)r   s   @r   r   r      s6     04~~/?? ?K K2? ? 04~~/?Q Q #nn.!	K KR R 59NN4D O O 59NN4D O O 04~~/?R R 04~~/?Q Q
 
 1ST
 U
 6:^^5E 	C 	C 6:^^5E @ @ F<A <
E 
E%9 %9N: :"; ;.Y Y2$  $ L	I 	I 04~~/?D D <@>>;K
? 
? ""nn.	; ;,  Q))  Q**  Q))r   r   )rc   Zjsonr    r   Ztypingr   r   r   r   r   Zredis.exceptionsr   Zredis.utilsr   Z_utilr	   Zdecodersr
   r   r   r   rt   r   r   <module>ru      s,    	 ' 5 5 & +  & b) b)r   