
    P                        S r SSKJr  SSKJr  SSKJr  SSKrSSK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\R*                  5      r\R.                  \R0                  " \R2                  R4                  5       " S S\R6                  5      5       5       r\R:                  \R0                  " \R2                  R<                  5       " S S\5      5       5       rg)zCommand to list Transfer jobs.    )absolute_import)division)unicode_literalsN)
list_pager)apis)arg_parsers)base)	list_util)	name_util)
properties)resource_printerc                        \ rS rSrSrSrSrSrg)JobType"   zThe type of the job.transferreplication N)__name__
__module____qualname____firstlineno____doc__TRANSFERREPLICATION__static_attributes__r       !lib/surface/transfer/jobs/list.pyr   r   "   s    (+r   r   c                   >    \ rS rSrSrSSS.r\S 5       rS rS r	S	r
g
)List(   $List Transfer Service transfer jobs.z}      List Transfer Service transfer jobs in a given project to show their
      configurations and latest operations.
      a        To list all jobs in your current project, run:

        $ {command}

      To list all disabled jobs in your project, run:

        $ {command} --job-statuses=disabled

      To list jobs 'foo' and 'bar', run:

        $ {command} --job-names=foo,bar

      To list all information about all jobs formatted as JSON, run:

        $ {command} --format=json

      To list all information about jobs 'foo' and 'bar' formatted as YAML, run:

        $ {command} --job-names=foo,bar --format=YAML
      )DESCRIPTIONEXAMPLESc                    U R                  S5        [        R                  " U 5        U R                  S[        R
                  " 5       SSS9  U R                  S[        R
                  " 5       SSS9  U R                  S	S
SS9  U R                  S[        R                  R                  [        R                  R                  /[        R                  R                  SS9  g )NFz--job-names	JOB_NAMESzThe names of the jobs you want to list. Separate multiple job names with commas (e.g., --job-names=foo,bar). If not specified, all jobs will be listed.)typemetavarhelpz--job-statusesJOB_STATUSESzList only jobs with the statuses you specify. Options include 'enabled', 'disabled', 'deleted' (case insensitive). Separate multiple statuses with commas (e.g., --job-statuses=enabled,deleted). If not specified, all jobs will be listed.z--expand-table
store_truezInclude additional table columns (job name, source, destination, frequency, lastest operation name, job status) in command output. Tip: increase the size of your terminal before running the command.)actionr(   z
--job-typez%The type of the job you want to list.)choicesdefaultr(   )
SetSortArgsr
   add_common_list_flagsadd_argumentr   ArgListr   r   valuer   parsers    r   Args	List.ArgsK   s    
u##F+
  "$	  %   "	   O  P !!'')<)<)B)BC  &&4	  r   c                     UR                   (       a  SnOSn[        R                  " X!R                  =(       d    U5        g)zAPI response display logic.a  table(
          name.slice(13:).join(sep=''),
          firstof(transferSpec, replicationSpec).firstof(
            gcsDataSource, awsS3DataSource, httpDataSource,
            azureBlobStorageDataSource, posixDataSource, hdfsDataSource
          ).firstof(
            bucketName, listUrl, container, rootDirectory, path
          ).trailoff(45):label=SOURCE,
          firstof(transferSpec, replicationSpec).firstof(
              gcsDataSink, posixDataSink
          ).firstof(
              bucketName, rootDirectory
          ).trailoff(45):label=DESTINATION,
          latestOperationName.slice(19:).join(sep=''),
          status)
      zltable(
          name.slice(13:).join(sep=''),
          latestOperationName.slice(19:).join(sep=''))
      N)expand_tabler   Printformat)selfargs	resourcesformat_strings       r   DisplayList.Displayl   s2    
m"
m 9kk&B]Cr   c           	         [         R                  " SS5      n[         R                  " SS5      nUR                  (       a!  [        R
                  " UR                  5      nOSnUR                  =(       d    SnUU[        R                  R                  R                  R                  5       S.nUR                  [        R                  R                  :X  a  SUS'   [         R"                  " U5      n[$        R&                  " UR(                  UR+                  US9UR,                  SS	UR.                  S
9n[0        R2                  " UU R4                  U5        g)zCommand execution logic.r   v1N)jobNamesjobStatuses	projectIdQUERY_REPLICATION_CONFIGSdataBackend)filterpageSizetransferJobs)
batch_sizebatch_size_attributefieldlimit)r   GetClientInstanceGetMessagesModule	job_namesr   add_job_prefixjob_statusesr   VALUEScoreprojectGetjob_typer   r   r2   jsondumpsr   YieldFromListrJ   &StoragetransferTransferJobsListRequest	page_sizerN   r
   !print_transfer_resources_iteratorr?   )	r;   r<   clientmessagesformatted_job_namesrS   filter_dictionaryfilter_stringresources_iterators	            r   RunList.Run   s   ##J5F%%j$7H~~%44T^^D $$,L (#&&++33779
 }}++111)D&JJ01M#1177}7M>>'jj //0B04dDr   r   N)r   r   r   r   r   detailed_helpstaticmethodr5   r?   re   r   r   r   r   r   r   (   s9     -


-<  @D6Dr   r   c                   (    \ rS rSrSr\S 5       rSrg)	ListAlpha   r!   c                 .    [         R                  U 5        g )N)r   r5   r3   s    r   r5   ListAlpha.Args   s    IIfr   r   N)r   r   r   r   r   rh   r5   r   r   r   r   rj   rj      s     - r   rj   ) r   
__future__r   r   r   enumrY   apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r	   #googlecloudsdk.command_lib.transferr
   r   googlecloudsdk.corer   googlecloudsdk.core.resourcer   Enumr   UniverseCompatibleReleaseTracksReleaseTrackGACommandr   DefaultUniverseOnlyALPHArj   r   r   r   <module>r~      s    % &  '   ' , / ( 9 9 * 9dii  D%%((){D4<< {D * {D| D%%++,  - r   