
                         z   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  \R$                  \R&                  " \R(                  R*                  \R(                  R,                  \R(                  R.                  5       " S S\R0                  5      5       5       rg)zLists all backups associated with a given instance.

Lists all backups associated with a given instance and configuration
in the reverse chronological order of the enqueued time.
    )absolute_import)division)unicode_literals)
list_pager)api_util)validate)base)filter_rewrite)flags)log)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)List$   zLists all backups associated with the project or a given instance.

Lists all backups associated with the project or a given Cloud SQL instance
and configuration in the reverse chronological order of the enqueued time.
c                     [         R                  " U S5        U R                  R                  S5        U R                  R	                  S 5        g )NTz
      table(
        id,
        windowStartTime.iso(),
        error.code.yesno(no="-"):label=ERROR,
        status,
        instance
      )
    )r   AddOptionalInstancedisplay_info	AddFormatAddCacheUpdater)parsers    lib/surface/sql/backups/list.pyArgs	List.Args.   sA    	fd+
!! # 	 ''-    c           
         [         R                  " [         R                  5      nUR                  nUR                  nUR
                  (       Gd>  UR                  5       R                  R                  R                  S5        [        R                  " 5       R                  UR                  5      u  Ul        nUR                  (       a!  [        R                  " SUR                  5        U(       a  [        R                  " SU5        [         R"                  " UR$                  UR'                  SR)                  [*        R,                  R.                  R0                  R3                  5       5      US9UR4                  UR6                  SSSS	9$ [8        R:                  " UR
                  5        UR<                  R?                  UR
                  S
[*        R,                  R.                  R0                  R2                  0SS9n[         R"                  " UR@                  URC                  UR0                  UR
                  S95      $ )zLists all backups associated with a given instance.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
      with.

Returns:
  A dict object that has the list of backup run resources if the command ran
  successfully.
a<  table(
            name,
            backupInterval.startTime.iso():label=WINDOW_START_TIME,
            error.errors[0].code.yesno(no="-"):label=ERROR,
            state:label=STATE,
            instance,
            type,
            instanceDeletionTime.iso(undefined='-'):label=INSTANCE_DELETION_TIME
          )zclient_filter: %szserver_filter: %szprojects/{0})parentfilterpageSizeListBackupsbackups)limit
batch_sizebatch_size_attributemethodfieldprojectzsql.instances)params
collection)r&   instance)"r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr)   
_GetParserair   r   r
   BackendRewriter   r   infor   YieldFromListr    SqlBackupsListBackupsRequestformatr   VALUEScorer&   	GetOrFailr!   	page_sizer   ValidateInstanceNameresource_parserParse
backupRunsSqlBackupRunsListRequest)selfargsclientr,   r-   server_filterinstance_refs          r   RunList.Run<   s     < <=F""J&&L=== oo''11 3  $2#9#9#;#C#C
++$ dk= 
$dkk2	$m4%%




3
3#**##((00::< #	 4  

^^)  !!$--0))//:,,1199CCD" 0 $L
 ##-- ((<3H3H 	. 	JK Kr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rD   __static_attributes__rF   r   r   r   r   $   s!     . .>Kr   r   N)rK   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.sqlr   r   googlecloudsdk.callioper	   googlecloudsdk.command_lib.sqlr
   r   googlecloudsdk.corer   r   DefaultUniverseOnlyReleaseTracksReleaseTrackGABETAALPHAListCommandr   rF   r   r   <module>r[      s    '  ' ' / / ( 9 0 # * D%%(($*;*;*@*@%%++-SK4 SK- SKr   