
                         $   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 dZ ej                  ej                  j                  ej                  j                  ej                  j                          G d	 d
ej"                               Zy)zLists AlloyDB backups.    )absolute_import)division)unicode_literals)api_util)base)
propertiesz
    table(
        name,
        state:label=STATUS,
        cluster_name,
        create_time,
        encryptionInfo.encryptionType:label=ENCRYPTION_TYPE
    )
c                   0    e Zd ZdZdddZed        Zd Zy)ListzLists AlloyDB backups in a given project.

  Lists AlloyDB backups in a given project in the alphabetical order of the
    backup name.
  z{description}a2          To list backups, run:

          $ {command} --region=us-central1

        Use the --format flag to customize the fields that are outputted. For
        example, to list backups with their names and sizes, run:

          $ {command} --region=us-central1 --format="table(name, size_bytes)"
        )DESCRIPTIONEXAMPLESc                 j    | j                  ddd       | j                  j                  t               y)zySpecifies additional command flags.

    Args:
      parser: argparse.Parser: Parser object for command line inputs.
    z--region-zRegional location (e.g. asia-east1, us-east1). See the full list of regions at https://cloud.google.com/sql/docs/instance-locations. Default: list clusters in all regions.)defaulthelpN)add_argumentdisplay_info	AddFormatBACKUP_FORMAT)parsers    #lib/surface/alloydb/backups/list.pyArgsz	List.Args=   s8     7  9 !!-0    c                    t        j                  | j                               }|j                  }|j                  }|j
                  j                  dt        j                  j                  j                  j                  |j                        }t        j                  |j                  |j                  |j!                               d|j"                  |j$                  d      }|S )zConstructs and sends request.

    Args:
      args: argparse.Namespace, An object that contains the values for the
          arguments specified in the .Args() method.

    Returns:
      ProcessHttpResponse of the request made.
    zalloydb.projects.locations)
projectsIdlocationsId)parentbackupspageSize)fieldlimit
batch_sizebatch_size_attribute)r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserCreater   VALUEScoreproject	GetOrFailregion YieldFromListHandlingUnreachableprojects_locations_backups*AlloydbProjectsLocationsBackupsListRequestRelativeNamer    	page_size)selfargsclientr%   r&   location_refresults          r   RunzList.RunM   s     ##D$5$5$78F**N..))00$$$))11;;KK 1 !L
 6611CC,,. 	D 	0jj>>'F Mr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r8    r   r   r
   r
   $   s1     		-  1 1r   r
   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   googlecloudsdk.corer   r   ReleaseTracksr$   ALPHABETAGAListCommandr
   r?   r   r   <module>rI      s     &  ' 3 ( * D%%++T->->-C-C%%((*C4 C*Cr   