
    k7i                         S SK Jr  S SKJrJrJrJr  \ " S S\5      5       r\ " S S\5      5       r\ " S S\5      5       r	\ " S	 S
\5      5       r
\ " S S\5      5       r\ " S S\5      5       r " S S\\5      rg)    )Sequence)AnyProtocolSupportsFloatruntime_checkablec                      \ rS rSrSrSS.S\S\S-  S\\\4   S-  4S jjrSS.S\S\S-  S\	\\\4   S-  \
S-  4   4S	 jjrSSS
.S\S\\\4   S\S-  S\S-  SS4
S jjrSS.S\S\S-  S\4S jjrSS.S\\   S\S-  S\\\\4   S-     4S jjrSS.S\\   S\S-  S\\	\\\4   S-  \
S-  4      4S jjrSSS
.S\\   S\\\\4      S\S-  S\\S-     S-  SS4
S jjrSS.S\\   S\S-  S\4S jjrSrg)AsyncKeyValueProtocol   zQA subset of KV operations: get/put/delete and TTL variants, including bulk calls.N)
collectionkeyr   returnc                   #    g7f)aI  Retrieve a value by key from the specified collection.

Args:
    key: The key to retrieve the value from.
    collection: The collection to retrieve the value from. If no collection is provided, it will use the default collection.

Returns:
    The value associated with the key. If the key is not found, None will be returned.
N selfr   r   s      [/home/james-whalen/.local/lib/python3.13/site-packages/key_value/aio/protocols/key_value.pygetAsyncKeyValueProtocol.get	   s
      	   c                   #    g7f)a  Retrieve the value and TTL information for a key-value pair from the specified collection.

Args:
    key: The key to retrieve the TTL information from.
    collection: The collection to retrieve the TTL information from. If no collection is provided,
                it will use the default collection.

Returns:
    The value and TTL information for the key. If the key is not found, (None, None) will be returned.
Nr   r   s      r   ttlAsyncKeyValueProtocol.ttl   
      	r   )r   r   valuer   c                   #    g7f)a  Store a key-value pair in the specified collection with optional TTL.

Args:
    key: The key to store the value in.
    value: The value to store.
    collection: The collection to store the value in. If no collection is provided, it will use the default collection.
    ttl: The optional time-to-live (expiry duration) in seconds for the key-value pair. Defaults to no TTL. Note: The
        backend store will convert the provided format to its own internal format.
Nr   )r   r   r   r   r   s        r   putAsyncKeyValueProtocol.put'   
      	r   c                   #    g7f)zDelete a key-value pair from the specified collection.

Args:
    key: The key to delete the value from.
    collection: The collection to delete the value from. If no collection is provided, it will use the default collection.
Nr   r   s      r   deleteAsyncKeyValueProtocol.delete3   
      	r   keysc                   #    g7f)aX  Retrieve multiple values by key from the specified collection.

Args:
    keys: The keys to retrieve the values from.
    collection: The collection to retrieve keys from. If no collection is provided, it will use the default collection.

Returns:
    A list of values for the keys. Each value is either a dict or None if the key is not found.
Nr   r   r#   r   s      r   get_manyAsyncKeyValueProtocol.get_many<   r   r   c                   #    g7f)a  Retrieve multiple values and TTL information by key from the specified collection.

Args:
    keys: The keys to retrieve the values and TTL information from.
    collection: The collection to retrieve keys from. If no collection is provided, it will use the default collection.

Returns:
    A list of tuples containing (value, ttl) for each key. Each tuple contains either (dict, float) or (None, None) if the
    key is not found.
Nr   r%   s      r   ttl_manyAsyncKeyValueProtocol.ttl_manyH   r   r   valuesc                   #    g7f)a  Store multiple key-value pairs in the specified collection.

Args:
    keys: The keys to store the values in.
    values: The values to store.
    collection: The collection to store keys in. If no collection is provided, it will use the default collection.
    ttl: The optional time-to-live (expiry duration) in seconds for the key-value pairs. Defaults to no TTL. Note: The
        backend store will convert the provided format to its own internal format.
Nr   )r   r#   r+   r   r   s        r   put_manyAsyncKeyValueProtocol.put_manyU   s
     " 	r   c                   #    g7f)a  Delete multiple key-value pairs from the specified collection.

Args:
    keys: The keys to delete the values from.
    collection: The collection to delete keys from. If no collection is provided, it will use the default collection.

Returns:
    The number of keys deleted.
Nr   r%   s      r   delete_many!AsyncKeyValueProtocol.delete_manyh   r   r   r   )__name__
__module____qualname____firstlineno____doc__strdictr   r   tuplefloatr   r   r   boolr    listr&   r)   r   r-   intr0   __static_attributes__r       r   r	   r	      s+   [ "&	 $J	
 
c3h$	" ?C S t uTRUWZRZ^^bMbdilpdpMpGq  VZw{ 
S 
c3h 
d
 
`mpt`t 
  AE 
 BF  C$J $  KO 
49 
S4Z 
SWX\]`be]eXfimXmSn 
 KO 49 S4Z SWX]^bcfhkck^los^suz  ~B  vB  _B  YC  TD $ "&593i c3h(
 $J md*+d2 
& NR 
d3i 
d
 
VY 
 
r?   r	   c                       \ rS rSrSS jrSrg)AsyncCullProtocolu   Nc                    #    g7f)zCCull the store.

This will remove all expired keys from the store.
Nr   r   s    r   cullAsyncCullProtocol.cullw   
     
 	r   r   )r   N)r2   r3   r4   r5   rE   r>   r   r?   r   rA   rA   u   s    r?   rA   c            	       L    \ rS rSrSrS
SS.S\S-  S\S-  S\\   4S jjjrS	r	g)AsyncEnumerateKeysProtocol   z3Protocol segment to enumerate keys in a collection.Nlimitr   rL   r   c                   #    g7f)a  List all keys in the specified collection.

Args:
    collection: The collection to list the keys from. If no collection is provided, it will use the default collection.
    limit: The maximum number of keys to list. The behavior when no limit is provided is store-dependent.
Nr   )r   r   rL   s      r   r#   AsyncEnumerateKeysProtocol.keys   r"   r   r   )N)
r2   r3   r4   r5   r6   r7   r=   r<   r#   r>   r   r?   r   rI   rI      s:    =t S4Z #* X\]`Xa  r?   rI   c                   :    \ rS rSrSS.S\S-  S\\   4S jjrSrg)!AsyncEnumerateCollectionsProtocol   NrK   rL   r   c                   #    g7f)zList all available collection names (may include empty collections).

Args:
    limit: The maximum number of collections to list. The behavior when no limit is provided is store-dependent.
Nr   )r   rL   s     r   collections-AsyncEnumerateCollectionsProtocol.collections   
      	r   r   )	r2   r3   r4   r5   r=   r<   r7   rS   r>   r   r?   r   rP   rP      s%    7; #* S	  r?   rP   c                   &    \ rS rSrSrS\4S jrSrg)AsyncDestroyStoreProtocol   z1Protocol segment for store-destruction semantics.r   c                    #    g7f)zPDestroy the keystore.

This will clear all collections and keys from the store.
Nr   rD   s    r   destroy!AsyncDestroyStoreProtocol.destroy   rG   r   r   N)r2   r3   r4   r5   r6   r;   rZ   r>   r   r?   r   rW   rW      s    ;t r?   rW   c                   &    \ rS rSrS\S\4S jrSrg)AsyncDestroyCollectionProtocol   r   r   c                    #    g7f)zTDestroy the specified collection.

Args:
    collection: The collection to destroy.
Nr   )r   r   s     r   destroy_collection1AsyncDestroyCollectionProtocol.destroy_collection   rU   r   r   N)r2   r3   r4   r5   r7   r;   r`   r>   r   r?   r   r]   r]      s    3 4 r?   r]   c                       \ rS rSrSrSrg)AsyncKeyValue   zA protocol for key-value store operations.

Includes basic operations: get, put, delete, ttl
Includes bulk operations: get_many, put_many, delete_many, ttl_many.
r   N)r2   r3   r4   r5   r6   r>   r   r?   r   rc   rc      s    r?   rc   N)collections.abcr   typingr   r   r   r   r	   rA   rI   rP   rW   r]   rc   r   r?   r   <module>rg      s    $ B B lH l l^    
 
 
       X  )8 r?   