
    ,                        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r\S	-   rS
SS.rSSS.r\R                  \R                   " \R"                  R$                  \R"                  R&                  5       " S S\R(                  5      5       5       r\\l        \R                   " \R"                  R.                  5       " S S\R(                  5      5       r\\l        g)zservices enable command.    )services_util)serviceusage)base)common_flags)log)
propertiesz gcloud beta services operations zwait {0}a          This command enables a service for consumption for a project, folder or organization.

        To see a list of available services for a project, run:

          $ {parent_command} list --available

     More information on listing services can be found at:
     https://cloud.google.com/service-usage/docs/list-services and on
     disabling a service at:
     https://cloud.google.com/service-usage/docs/enable-disable
        aj          To enable a service called `my-consumed-service` on the current
        project, run:

          $ {command} my-consumed-service

        To enable a service called `my-consumed-service` on the project
        `my-project`, run:

          $ {command} my-consumed-service --project=my-project

        To enable a service called `my-consumed-service` on the project
        `my-project` in group `groups`, run:

          $ {command} my-consumed-service --project=my-project --group=groups

        To enable a service called `my-consumed-service` on the folder
        `my-folder, run:

          $ {command} my-consumed-service --folder=my-folder

        To enable a service called `my-consumed-service` on the organization
        `my-organization`, run:

          $ {command} my-consumed-service --organization=my-organization

        To run the same command asynchronously (non-blocking), run:

          $ {command} my-consumed-service --async

        To enable services called `service1`, `service2`, and `service3` on the
        current project, run:

          $ {command} service1 service2 service3
        )DESCRIPTIONEXAMPLESa          This command enables a service for consumption for a project.

        To see a list of available services for a project, run:

          $ {parent_command} list --available

     More information on listing services can be found at:
     https://cloud.google.com/service-usage/docs/list-services and on
     disabling a service at:
     https://cloud.google.com/service-usage/docs/enable-disable
        a          To enable a service called `my-consumed-service` on the current
        project, run:

          $ {command} my-consumed-service

        To run the same command asynchronously (non-blocking), run:

          $ {command} my-consumed-service --async

        To enable services called `service1`, `service2`, and `service3` on the
        current project, run:

          $ {command} service1 service2 service3
        c                   .    \ rS rSrSr\S 5       rS rSrg)EnableAlphar   zHEnables a service for consumption for a project, folder or organization.c                 ,   [         R                  " SS9R                  U 5        [         R                  " U 5        [        R
                  R                  U 5        [         R                  " U SS9  [         R                  " U 5        U R                  SSSS9  g)	zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
	to enablesuffixenablez--groupdependencieszThe service group name.)defaulthelpN)	r   available_service_flagAddToParseradd_resource_argsr   
ASYNC_FLAGvalidate_only_argsskip_dependency_flagadd_argumentparsers    lib/surface/services/enable.pyArgsEnableAlpha.Argsw   sw     ''{;GGO""6*OO'##F8<%%f-
&      c                 8   UR                  S5      (       a  UR                  O0[        R                  R                  R                  R                  SS9nUR                  S5      (       a  UR                  OSnUR                  S5      (       a  UR                  OSnUR                  S5      (       a  SOSn[        R                  " UR                  UUUUR                  UR                  UR                  US	9u  pgUc  gUR                  (       af  [        R!                  UR"                  5      n[$        R&                  R)                  S
U 35        U(       d  U(       d  [        R*                  " X'5        g[,        R.                  " UR"                  [        R0                  5      nUR                  (       a  [,        R2                  " U5        g[,        R4                  " U5        UR6                  (       d'  U(       d  U(       d  [        R*                  " X'5        gggg)zRun 'services enable'.

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

Returns:
  Nothing.
projectTrequiredfolderNorganizationgroupF)r'   r(   validate_onlyskip_dependencyr)   inputted_group`Asynchronous operation is in progress... Use the following command to wait for its completion:
 )IsSpecifiedr$   r   VALUEScoreGetr'   r(   r   AddEnableRuleservicer*   r+   r)   async__OP_WAIT_CMDformatnamer   statusPrint(GenerateServiceIdentityForEnabledServicer   WaitOperationGetOperationV2BetaPrintOperationPrintOperationWithResponseerror)	selfargsr$   r'   r(   r,   update_consumer_policy_opservices_enabledcmds	            r   RunEnableAlpha.Run   s    I&& 	##++///> 
 !,,X66T[[DF!--n==4  "--g66TEN2>2L2L!((,,jj%	3/ !({{ 9 > >?c	jj%!
 L==	
  - ; ;!&&(G(G! ""#<=../HI'--==	
   .r"    N	__name__
__module____qualname____firstlineno____doc__staticmethodr    rE   __static_attributes__rG   r"   r   r   r   r   s     Q $=
r"   r   c                   .    \ rS rSrSr\S 5       rS rSrg)Enable   z0Enables a service for consumption for a project.c                     [         R                  " SS9R                  U 5        [        R                  R                  U 5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
r   r   N)r   r   r   r   r   r   s    r   r    Enable.Args   s/     ''{;GGOOO'r"   c                 t   [         R                  R                  R                  R	                  SS9n[        UR                  5      S:X  a$  [        R                  " X!R                  S   5      nO [        R                  " X!R                  5      nUR                  (       a  gUR                  (       aB  [        R                  UR                  5      n[        R                   R#                  SU 35        g[$        R&                  " UR                  [        R(                  5      n[$        R*                  " U5        g)zRun 'services enable'.

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

Returns:
  Nothing.
Tr%      r   Nr-   )r   r/   r0   r$   r1   lenr3   r   EnableApiCallBatchEnableApiCalldoner4   r5   r6   r7   r   r8   r9   r   r;   GetOperationr=   )r@   rA   r$   oprD   s        r   rE   
Enable.Run   s     $$,,00$0?G
4<<A%%g||A?b**7LLAb	ww{{(c	jj%!
 		$	$RWWl.G.G	HB  $r"   rG   NrH   rG   r"   r   rQ   rQ      s    8	( 	(%r"   rQ   N)rM   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer   r   _OP_BASE_CMDr5   _DETAILED_HELP_ALPHA_DETAILED_HELPUniverseCompatibleReleaseTracksReleaseTrackALPHABETASilentCommandr   detailed_helpGArQ   rG   r"   r   <module>rm      s      9 8 ( < # *1j(	"	!4 n@ D%%++T->->-C-CDS
$$$ S
 E S
l 1  D%%(())%T )% *)%X & r"   