
    |
                        S 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\R                  \R                  " \R                  R                   \R                  R"                  5       " S
 S\R$                  5      5       5       rg)z'services policies test-enabled command.    )serviceusage)base)common_flags)
propertieszprojects/%sz
folders/%szorganizations/%szservices/%sc                   .    \ rS rSrSr\S 5       rS rSrg)TestEnabled   ap  Test a value against the result of merging consumer policies in the resource hierarchy.

Test a value against the result of merging consumer policies in the resource
hierarchy.

## EXAMPLES

Test for service my-service for current project:

  $ {command} my-service

Test for service my-service for project `my-project`:

  $ {command} my-service --project=my-project
c                 P    [         R                  " U 5        U R                  SSS9  g )NservicezName of the service.)help)r   add_resource_argsadd_argument)parsers    -lib/surface/services/policies/test_enabled.pyArgsTestEnabled.Args.   s$    ""6*
	(>?    c                 0   UR                  S5      (       a  [        UR                  -  nOUR                  S5      (       a  [        UR                  -  nOdUR                  S5      (       a  [
        UR                  -  nO:[        R                  R                  R                  R                  SS9n[
        U-  n[        R                  " U[        UR                  -  5      nUR                  (       a  SUR                   SU S3$ SUR                   S	U S3$ )
zRun command.

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

Returns:
  The enablement of the given service.
folderorganizationprojectT)requiredzService z is ENABLED for resource .z is NOT ENABLED for resource )IsSpecified_FOLDER_RESOURCEr   _ORGANIZATION_RESOURCEr   _PROJECT_RESOURCEr   r   VALUEScoreGetr   r   _SERVICEr   enableRules)selfargsresource_namer   responses        r   RunTestEnabled.Run3   s     !!&4m			.	)	),t/@/@@m			)	$	$'$,,6m!!&&..22D2Ag''1m''x$,,7NOH ~%>}oQOO T\\N"?a
Pr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r'   __static_attributes__r)   r   r   r   r      s"      @ @r   r   N)r.   googlecloudsdk.api_lib.servicesr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer   r   r   r   r!   UniverseCompatibleReleaseTracksReleaseTrackALPHABETACommandr   r)   r   r   <module>r;      s    . 8 ( < *!  +  D%%++T->->-C-CD2$,, 2 E 2r   