
    v                     h   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SrSrSr\S-   r\R(                  \R*                  \R,                  " \R.                  R0                  \R.                  R2                  5       " S S\R4                  5      5       5       5       rg)z-services policies remove-enable-rule command.    )services_util)serviceusage)base)arg_parsers)common_flags)log)
properties)
console_iozprojects/{}z
folders/{}zorganizations/{}z/consumerPolicies/{}z gcloud beta services operations zwait {0}c                   .    \ rS rSrSr\S 5       rS rSrg)RemovedEnableRules%   a  Remove service(s) from a consumer policy for a project, folder or organization.

Remove service(s) from a consumer policy for a project, folder or
organization.

## EXAMPLES
To remove service called `my-consumed-service` from the default consumer
policy on the current project, run:

  $ {command} my-consumed-service
      OR
  $ {command} my-consumed-service --policy-name=default

 To remove service called `my-consumed-service` from from the default consumer
 policy on project `my-project`, run:

  $ {command} my-consumed-service --project=my-project
      OR
  $ {command} my-consumed-service --policy-name=default

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

  $ {command} my-consumed-service --async
c                 "   [         R                  " SS9R                  U 5        U R                  SSSS9  [         R                  " U 5        [
        R                  R                  U 5        U R                  SSS	S
9  [         R                  " U 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.
zto remove enable rule for)suffixz--policy-namezCName of the consumer policy. Currently only "default" is supported.default)helpr   z--force
store_truea  If specified, the remove-enable-rules call will proceed even if there are enabled services which depend on the service to be removed from enable rule or the service to be removed was used in the last 30 days, or the service to be removed was enabled in the last 3 days. Forcing the call means that the services which depend on the service to be removed from the enable rule will also be removed.)actionr   zremove enable ruleN)r   consumer_service_flagAddToParseradd_argumentadd_resource_argsr   
ASYNC_FLAGvalidate_only_args)parsers    4lib/surface/services/policies/remove_enable_rules.pyArgsRemovedEnableRules.ArgsB   s     &&*k&
    ""6*OO'
 	   ##F3GH    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/ 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     [        R"                  " UUUR$                  UR&                  UUUR(                  SUR&                  S
9	n	UR*                  (       aB  [,        R/                  U	R0                  5      n
[2        R4                  R7                  SU
 35        g[8        R:                  " U	R0                  [        R<                  5      n	UR(                  (       a  [8        R>                  " U	5        g[8        R@                  " U	5        g)zRun services policies remove-enable-rules.

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

Returns:
  The services in the consumer policy.
projectT)requiredfolderNorganizationquietF)r   throw_if_unattended)skip_dependency_checkdisable_dependency_servicesz`Asynchronous operation is in progress... Use the following command to wait for its completion:
 )!IsSpecifiedr    r	   VALUEScoreGetr"   r#   servicer   GetServiceNameFromArgr   GetProtectedServiceWarningr
   RequiredPromptErrorPromptContinueappendRemoveEnableRulepolicy_nameforcevalidate_onlyasync__OP_WAIT_CMDformatnamer   statusPrintr   WaitOperationGetOperationV2BetaPrintOperationPrintOperationWithResponse)selfargsr    r"   r#   service_namesservice_nameprotected_msg
do_disableopcmds              r   RunRemovedEnableRules.Runf   s    I&& 	##++///> 
 !,,X66T[[DF!--n==4  M 66|Dl"==lKm	G$$..0
0..5d

 
<( % 
	&	&

#$(JJ

B {{(c	jj%!
 		$	$RWWl.M.M	NB""2&..r2r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rH   __static_attributes__rJ   r   r   r   r   %   s#    2 !I !IF=3r   r   N)rO   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   r   googlecloudsdk.corer   r	   googlecloudsdk.core.consoler
   _PROJECT_RESOURCE_FOLDER_RESOURCE_ORGANIZATION_RESOURCE_CONSUMER_POLICY_DEFAULT_OP_BASE_CMDr7   UniverseCompatibleHiddenReleaseTracksReleaseTrackALPHABETASilentCommandr   rJ   r   r   <module>rc      s     4 9 8 ( ; < # * 2!  + 1 1j( D%%++T->->-C-CD{3++ {3 E  {3r   