
    J
                        S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKr " S S\	5      r
\R                  " \R                  5       " S	 S
\	5      5       r " S S\5      r " S S\5      r " S S\5      r " S S\R"                  5      rg)zIAdd, replace or delete the cached resource URIs from a single collection.    )absolute_import)division)unicode_literalsN)resource_cachec                       \ rS rSrSrS rSrg)
_TableRows   z0An _UpdateCacheOp._GetTablesFromUris dict entry.c                     Xl         / U l        g N)tablerows)selfr   s     1lib/googlecloudsdk/core/cache/cache_update_ops.py__init___TableRows.__init__    s    JDI    )r   r   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__ r   r   r   r      s
    8r   r   c                   H    \ rS rSrSrS rS r\R                  S 5       r	Sr
g)_UpdateCacheOp%   z&The cache update operation base class.c                     Xl         g r   _completer_class)r   	completers     r   r   _UpdateCacheOp.__init__)   s    %r   c                     [         R                  " 5        nU R                  US9n0 nU H{  nUR                  U5      nUR	                  U5      nUR                  UR                  5      nU(       d  [        U5      nXUR                  '   UR                  R                  U5        M}     [        R                  " U5       H  u  pyU R                  Xy5        M     SSS5        g! , (       d  f       g= f! [         a     gf = f)z?Applies UpdateRows() to tables that contain the resources uris.)cacheN)r   ResourceCacher   StringToRowGetTableForRowgetnamer   r   appendsix	iteritems
UpdateRows	Exception)
r   urisr#   r    tablesurirowr   entryr   s
             r   Update_UpdateCacheOp.Update,   s    '')U)))6	C%%c*#**3/%**UZZ(%u%E!&5::
**

C
   ==0KE
//%
& 1 *))  
s/   C4 CC#C4 #
C1-C4 1C4 4
D Dc                     g)zUpdates table with rows.Nr   r   r   r   s      r   r,   _UpdateCacheOp.UpdateRows?   s     	r   r   N)r   r   r   r   r   r   r3   abcabstractmethodr,   r   r   r   r   r   r   %   s)    .&& 	 	r   r   c                       \ rS rSrSrS rSrg)AddToCacheOpE   zAn AddToCache operation.c                 &    UR                  U5        g)zAdds rows to table.N)AddRowsr6   s      r   r,   AddToCacheOp.UpdateRowsH   s    	MM$r   r   Nr   r   r   r   r   r,   r   r   r   r   r;   r;   E   s
     r   r;   c                       \ rS rSrSrS rSrg)DeleteFromCacheOpM   zA DeleteFromCache operation.c                 &    UR                  U5        g)zDeletes rows from table.N)
DeleteRowsr6   s      r   r,   DeleteFromCacheOp.UpdateRowsP   s    	Tr   r   Nr@   r   r   r   rB   rB   M   s
    $r   rB   c                       \ rS rSrSrS rSrg)ReplaceCacheOpU   zA ReplaceCache operation.c                 F    UR                  5         UR                  U5        g)zReplaces table with rows.N)rE   r>   r6   s      r   r,   ReplaceCacheOp.UpdateRowsX   s    		MM$r   r   Nr@   r   r   r   rH   rH   U   s
    !r   rH   c                       \ rS rSrSrSrg)NoCacheUpdater^   zNo cache updater.r   N)r   r   r   r   r   r   r   r   r   rM   rM   ^   s    r   rM   )r   
__future__r   r   r   r8   googlecloudsdk.core.cacher   r*   objectr   add_metaclassABCMetar   r;   rB   rH   BaseUpdaterrM   r   r   r   <module>rU      s     P &  ' 
 4 
  3;;	V 	  	>>  ^ ^// r   