
                             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\R                  " \R                  5       " S S\R                  5      5       rg)	a  The Cloud SDK completion cache.

A completion cache is a persistent cache that stores the current list of names
for resources visible to the caller.  The cache generates lists of resources
that match prefixes and/or patterns, suitable for command line completers. The
name representation is resource specific.  See core.resource.resource_style for
details.

Refer to the resource_cache module for a detailed description of resource
parsing and representation.

    +---------------------------+
    | completion cache          |
    | +-----------------------+ |
    | | completer             | |
    | +-----------------------+ |
    |           ...             |
    +---------------------------+

A completion cache is implemented as an extended ResourceCache object that
contains Completer objects.  A Completer object:

* has a Complete() method that returns resource strings matching a pattern
* has methods to convert between strings and parameter tuples
* has an underlying ResourceCache Collection object that holds parameter tuples
* derives from resource_cache.Updater to update the collection parameter tuples

This module is resource agnostic.  All resource specific information is
encapsulated in resource specific Completer objects.
    )absolute_import)division)unicode_literalsN)resource_cachec                   p    \ rS rSrSr\R                  S 5       rS r\R                  S	S j5       r	S r
Srg)
	Completer:   aB  A completion cache resource string completer.

Along with the Complete() method, a completer has two main functions, each
handled by a mixin:
(1) Convert between resource string and parameter tuple representations.
(2) Retrieve the current list of resources for the collection. See
    resource_cache.Updater for details.
c                     g)zReturns the row representation of string.

May fill in some column values

Args:
  string: The resource string representation.

Returns:
  The row representation of string.
N )selfstrings     1lib/googlecloudsdk/core/cache/completion_cache.pyStringToRowCompleter.StringToRowE        	    c                     [        U5      n[        U5      U R                  :  a  US/U R                  [        U5      -
  -  -  nU Vs/ s H  nSU;   a  UOUS-   PM     sn$ s  snf )zReturns the row template of row for the Resource.Complete method.

By default all parameters are treated as prefixes.

Args:
  row: The resource parameter tuple.

Returns:
  The row template of row for the Resource.Complete method.
 *)listlencolumns)r   rowrow_templatecs       r   RowToTemplateCompleter.RowToTemplateS   sb     9L
3x$,,rddllSX566l0<=1Aq3w&===s   A"Nc                     g)zReturns the string representation of row.

Args:
  row: The resource parameter tuple.
  parameter_info: A ParamaterInfo object for accessing parameter values in
    the program state.

Returns:
  The string representation of row.
Nr   )r   r   parameter_infos      r   RowToStringCompleter.RowToStringc   r   r   c                     U R                  U5      nU R                  U5      nU R                  XB5      nU Vs/ s H  o0R                  X25      PM     sn$ s  snf )zReturns the list of strings matching prefix.

Args:
  prefix: The resource prefix string to match.
  parameter_info: A ParamaterInfo object for accessing parameter values in
    the program state.

Returns:
  The list of strings matching prefix.
)r   r   Selectr    )r   prefixr   r   r   rowss         r   CompleteCompleter.Completeq   sS     

6
"C%%c*L;;|4D=ABTcS1TBBBs   Ar   )N)__name__
__module____qualname____firstlineno____doc__abcabstractmethodr   r   r    r&   __static_attributes__r   r   r   r   r   :   sF     	 	>  	 	Cr   r   )r,   
__future__r   r   r   r-   googlecloudsdk.core.cacher   sixadd_metaclassABCMetaUpdaterr   r   r   r   <module>r6      sT    > '  ' 
 4 
 3;;DC&& DC  DCr   