
    $                        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
r\S-   r\R                   \R"                  " \R$                  R&                  \R$                  R(                  5       " S S\R*                  5      5       5       r\R"                  " \R$                  R.                  5       " S S\R*                  5      5       rg)zservices disable command.    )services_util)serviceusage)base)arg_parsers)common_flags)log)
properties)
console_ioz gcloud beta services operations zwait {0}c                   .    \ rS rSrSr\S 5       rS rSrg)DisableAlpha!   a\  Disable a service for consumption for a project, folder or organization.

This command disables one or more previously-enabled services for
consumption.

To see a list of the enabled services for a project, run:

  $ {parent_command} list

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

## EXAMPLES
To disable a service called `my-consumed-service` for the current
project, run:

  $ {command} my-consumed-service

To disable a service called `my-consumed-service` for the project
`my-project`, run:

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

To disable a service called `my-consumed-service` for the folder
`my-folder`, run:

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

To disable a service called `my-consumed-service` for 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
c                 X   [         R                  " SS9R                  U 5        [         R                  " U 5        [        R
                  R                  U 5        [         R                  " U SS9  [         R                  " U 5        [         R                  " U 5        U R                  SSSS9  g)	Args 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 disablesuffixdisable--force
store_truea  If specified, the disable call will proceed even if there are enabled services which depend on the service to be disabled, or the service to be disabled was used in the last 30 days, or the service to be disabled was enabled in the last 3 days. Forcing the call means that the services which depend on the service to be disabled will also be disabled. (Note): If  --bypass-api-usage-check, --bypass-dependency-service-check, or --disable-dependency-services flags are used, they will take precedence over --force.actionhelpN)
r   consumer_service_flagAddToParseradd_resource_argsr   
ASYNC_FLAGvalidate_only_argsbypass_api_usage_check_flagadd_dependency_check_argsadd_argumentparsers    lib/surface/services/disable.pyArgsDisableAlpha.ArgsL   s     &&l;GGO""6*OO'##F9=,,V4**62
(	      c                 4   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                  nSnSnUR                  S5      (       d  UR                  S	5      (       a  SnUR                  S
5      (       a  SnUR                  S5      (       a  Sn/ nUR                   H  n	[        R                  " U	5      n	[        R                  " U	5      n
U
(       aJ  UR                  S5      (       a  [        R                  " 5       e[        R                   " U
SSS9nU(       d  M  UR#                  U	5        M     U(       d  g[        R$                  " UUUUUUR&                  UUS9nUR(                  (       aA  [*        R-                  UR.                  5      n[0        R2                  R5                  SU 35        [6        R8                  " UR.                  [        R:                  5      nUR&                  (       a  [6        R<                  " U5        g[6        R>                  " U5        g)Run 'services disable'.

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

Returns:
  Nothing.
projectTrequiredfolderNorganizationFforcedisable_dependency_servicesbypass_api_usage_checkbypass_dependency_service_checkquietdefaultthrow_if_unattended)r.   r,   r-   validate_onlyskip_dependency_checkr/   `Asynchronous operation is in progress... Use the following command to wait for its completion:
 ) IsSpecifiedr)   r	   VALUEScoreGetr,   r-   r.   servicer   GetServiceNameFromArgr   GetProtectedServiceWarningr
   RequiredPromptErrorPromptContinueappendRemoveEnableRuler6   async_OP_WAIT_CMDformatnamer   statusPrintr   WaitOperationGetOperationV2BetaPrintOperation1PrintOperationWithResponseForUpdateConsumerPolicy)selfargsr)   r,   r-   r0   r7   r/   service_namesservice_nameprotected_msg
do_disableopcmds                 r#   RunDisableAlpha.Runj   s;    I&& 	##++///> 
 !,,X66T[[DF!--n==4  "ZZ
 ""'   D$4$4%% % %)! 011# 9::"M 66|Dl"==lKm	G$$..0
0..5d

 
<( % 		&	&$!((3$?	
B {{rww'c	jj4475: 
	$	$RWWl.M.M	NB""2&EEbIr&    N	__name__
__module____qualname____firstlineno____doc__staticmethodr$   rV   __static_attributes__rX   r&   r#   r   r   !   s#    &P  :RJr&   r   c                   .    \ rS rSrSr\S 5       rS rSrg)Disable   a  Disable a service for consumption for a project.

This command disables one or more previously-enabled services for
consumption.

To see a list of the enabled services for a project, run:

  $ {parent_command} list

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

## EXAMPLES
To disable a service called `my-consumed-service` for the active
project, run:

  $ {command} my-consumed-service

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

  $ {command} my-consumed-service --async
c                     [         R                  " SS9R                  U 5        [        R                  R                  U 5        U R                  SSSS9  g)r   r   r   r   r   a1  If specified, the disable call will proceed even if there are enabled services which depend on the service to be disabled or disable the service used in last 30 days or was enabled in recent 3 days. Forcing the call means that the services which depend on the service to be disabled will also be disabled.r   N)r   r   r   r   r   r    r!   s    r#   r$   Disable.Args   sN     &&l;GGOOO'
K	  
r&   c                 &   [         R                  R                  R                  R	                  SS9nUR
                   GHO  n[        R                  " U5      n[        R                  " U5      nU(       aJ  UR                  S5      (       a  [        R                  " 5       e[        R                  " USSS9nU(       d  M  [        R                  " X#UR                  5      nUR                   (       a  M  UR"                  (       aD  [$        R'                  UR(                  5      n[*        R,                  R/                  SU 35        GM
  [0        R2                  " UR(                  [        R4                  5      n[0        R6                  " U5        GMR     g)r(   Tr*   r2   Fr3   r8   N)r	   r:   r;   r)   r<   r=   r   r>   r   r?   r9   r
   r@   rA   DisableApiCallr.   donerD   rE   rF   rG   r   rH   rI   r   rJ   GetOperationrL   )rN   rO   r)   rQ   rR   rS   rT   rU   s           r#   rV   Disable.Run   s$    $$,,00$0?G 66|Dl"==lKm	G$$..0
0..5d

 
&&wdjjIb		  )

 E#	

 	&&rww0I0IJb""2&1 %r&   rX   NrY   rX   r&   r#   rb   rb      s     2  *#'r&   rb   N)r^   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   r   googlecloudsdk.corer   r	   googlecloudsdk.core.consoler
   OP_BASE_CMDrE   UniverseCompatibleReleaseTracksReleaseTrackALPHABETASilentCommandr   GArb   rX   r&   r#   <module>rx      s       9 8 ( ; < # * 2 1J& D%%++T->->-C-CDYJ4%% YJ E YJx D%%(()S'd   S' *S'r&   