
                            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
        a          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 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)EnableAlphai   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        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enableN)r   available_service_flagAddToParseradd_resource_argsr   
ASYNC_FLAGvalidate_only_argsskip_dependency_flagparsers    lib/surface/services/enable.pyArgsEnableAlpha.Argsn   s[     ''{;GGO""6*OO'##F8<%%f-    c           	         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[        R                  " UR                  UUUUR                  UR                  S9u  pVUR                  (       af  [        R                  UR                   5      n["        R$                  R'                  SU 35        U(       d  U(       d  [        R(                  " X&5        g[*        R,                  " UR                   [        R.                  5      nUR                  (       a  [*        R0                  " U5        g[*        R2                  " U5        UR4                  (       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)r#   r$   validate_onlyskip_dependency`Asynchronous operation is in progress... Use the following command to wait for its completion:
 )IsSpecifiedr    r   VALUEScoreGetr#   r$   r   AddEnableRuleservicer%   r&   async__OP_WAIT_CMDformatnamer   statusPrint(GenerateServiceIdentityForEnabledServicer   WaitOperationGetOperationV2BetaPrintOperationPrintOperationWithResponseerror)selfargsr    r#   r$   update_consumer_policy_opservices_enabledcmds           r   RunEnableAlpha.Run|   s    I&& 	##++///> 
 !,,X66T[[DF!--n==4  3?2L2L!((,,3/ {{ 9 > >?c	jj%!
 L==	
  - ; ;!&&(G(G! ""#<=../HI'--==	
   .r    N	__name__
__module____qualname____firstlineno____doc__staticmethodr   r?   __static_attributes__rA   r   r   r   r   i   s     Q. .7
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)   r*   r    r+   lenr-   r   EnableApiCallBatchEnableApiCalldoner.   r/   r0   r1   r   r2   r3   r   r5   GetOperationr7   )r:   r;   r    opr>   s        r   r?   
Enable.Run   s     $$,,00$0?G
4<<A%%g||A?b**7LLAb	ww{{(c	jj%!
 		$	$RWWl.G.G	HB  $r   rA   NrB   rA   r   r   rK   rK      s    8	( 	(%r   rK   N)rG   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer   r   _OP_BASE_CMDr/   _DETAILED_HELP_ALPHA_DETAILED_HELPUniverseCompatibleReleaseTracksReleaseTrackALPHABETASilentCommandr   detailed_helpGArK   rA   r   r   <module>rg      s      9 8 ( < # *1j(+ \@ D%%++T->->-C-CDH
$$$ H
 E H
V 1  D%%(())%T )% *)%X & r   