
                            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  \R                   " \R"                  R$                  5      \R&                   " S S\R(                  5      5       5       r\R                   " \R"                  R,                  5       " S S\5      5       r\R                   " \R"                  R0                  5       " S S\5      5       rS rS rg)zDescribe worker pool command.    )absolute_import)division)unicode_literals)cloudbuild_util)client_util)base)
exceptions)
properties)	resourcesc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Describe   +Describe a worker pool used by Cloud Build.z{description}z          To get information about a worker pool named `wp1` in region `us-central1`, run:

            $ {command} wp1 --region=us-central1
          )DESCRIPTIONEXAMPLESc                 D    U R                  SSS9  U R                  SSS9  g)Register flags for this command.

Args:
  parser: An argparse.ArgumentParser-like object. It is mocked out in order
    to capture some information, but behaves like an ArgumentParser.
--region*The Cloud region where the worker pool is.helpWORKER_POOL&The ID of the worker pool to describe.N)add_argumentparsers    +lib/surface/builds/worker_pools/describe.pyArgsDescribe.Args-   s9     9  ; D  F    c                 4    [        XR                  5       5      $ )This is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Some value that we want to have printed later.
)_DescribeWorkerPoolFirstGenReleaseTrackselfargss     r   RunDescribe.Run;   s     't->->-@AAr     N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r(   __static_attributes__r*   r    r   r   r      s4     4 		- F FBr    r   c                   .    \ rS rSrSr\S 5       rS rSrg)DescribeBetaI   r   c                 p    U R                  SSS9  U R                  SS[        SS9  U R                  SS	S9  g
r   r   r   r   --generation   zGeneration of the worker pool.)defaulttyper   r   r   Nr   intr   s    r   r   DescribeBeta.ArgsM   Z     9  ; .	  1
 D  Fr    c                     UR                   S:X  a  [        XR                  5       5      $ UR                   S:X  a  [        U5      $ [        R
                  " SS5      er"   r9      r8   z=please use one of the following valid generation values: 1, 2
generationr#   r$   _DescribeWorkerPoolSecondGenr	   InvalidArgumentExceptionr%   s     r   r(   DescribeBeta.Run`   T     !(/@/@/BCC!)$//

-
-G r    r*   N	r+   r,   r-   r.   r/   r1   r   r(   r2   r*   r    r   r4   r4   I       3F F$r    r4   c                   .    \ rS rSrSr\S 5       rS rSrg)DescribeAlphav   r   c                 p    U R                  SSS9  U R                  SS[        SS9  U R                  SS	S9  g
r7   r<   r   s    r   r   DescribeAlpha.Argsz   r?   r    c                     UR                   S:X  a  [        XR                  5       5      $ UR                   S:X  a  [        U5      $ [        R
                  " SS5      erA   rC   r%   s     r   r(   DescribeAlpha.Run   rH   r    r*   NrI   r*   r    r   rL   rL   v   rJ   r    rL   c           	         [         R                  " 5       nUR                  nU R                  nU(       d2  [        R
                  R                  R                  R                  5       n[        R                  R                  SS[         R                  [        R
                  R                  R                  R                  SS9UU R                  S.S9nUR                   R                  UR#                  UR%                  5       S95      n [         R&                  " UR(                  5      Ul        U$ ! [*         a     U$ f = f)zDescribes a Worker Pool Second Generation.

Args:
  args: an argparse namespace. All the arguments that were provided to the
      create command invocation.

Returns:
  A Worker Pool Second Generation resource.
Nz1cloudbuild.projects.locations.workerPoolSecondGenTrequired)
projectsIdlocationsIdworkerPoolSecondGenId
collectionapi_versionparamsname)cloudbuild_v2_utilGetClientInstanceMESSAGES_MODULEregionr
   VALUESbuilds	GetOrFailr   REGISTRYParseGA_API_VERSIONcoreprojectGetr   &projects_locations_workerPoolSecondGen8CloudbuildProjectsLocationsWorkerPoolSecondGenGetRequestRelativeNameWorkerPoolSecondGenShortNamer]   
ValueError)r'   clientmessages	wp_regionwp_resourcewps         r   rE   rE      s    //1&##(kk)	!!((//99;I ""((
D$33"))..66::D:I"#'#3#3	 ) 	+ 4488GG'') H +,"
	 ==bggFBG 
) 
 		)	s   	%D0 0
D>=D>c           	         U R                   nU(       d2  [        R                  R                  R                   R	                  5       n[
        R                  " U5      n[
        R                  " U5      n[        R                  R                  R                  R                  SS9nU R                  n[        R                  R                  SS[
        R                  U   UUUS.S9nUR                   R                  UR#                  UR%                  5       S95      n [
        R&                  " UR(                  5      Ul        U$ ! [*         a     U$ f = f)a0  Describes a Worker Pool First Generation.

Args:
  args: an argparse namespace. All the arguments that were provided to the
      create command invocation.
  release_track: The desired value of the enum
    googlecloudsdk.calliope.base.ReleaseTrack.

Returns:
  A Worker Pool First Generation resource.
TrS   Nz)cloudbuild.projects.locations.workerPools)rU   rV   workerPoolsIdrX   r\   )ra   r
   rb   rc   rd   r   r_   GetMessagesModulerh   ri   rj   r   r   re   rf   RELEASE_TRACK_TO_API_VERSIONprojects_locations_workerPools0CloudbuildProjectsLocationsWorkerPoolsGetRequestrm   WorkerPoolShortNamer]   ro   )	r'   release_trackrr   rp   rq   parentwp_namers   rt   s	            r   r#   r#      s2    kk)	!!((//99;I,,];&..}=(!!))--t-<&' ""((
<!>>}M""	 ) 	+ ,,00??'') @ +,"
	11"'':BG 
) 
 		)	s   %E 
EEN)r/   
__future__r   r   r   !googlecloudsdk.api_lib.cloudbuildr   $googlecloudsdk.api_lib.cloudbuild.v2r   r^   googlecloudsdk.callioper   r	   googlecloudsdk.corer
   r   ReleaseTracksr$   GAUniverseCompatibleDescribeCommandr   BETAr4   ALPHArL   rE   r#   r*   r    r   <module>r      s    $ &  ' = R ( . * ) D%%(()'Bt## 'B  *'BT D%%**+)8 ) ,)X D%%++,)H ) -)X'T-r    