
                         *   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                   R$                  5       " S
 S\R&                  5      5       5       5       rg)z+services mcp 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   aj  Test a service against the result of merging MCP policies in the resource hierarchy.

Test a service against the result of merging MCP 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servicez3Name of the service. example: foobar.googleapis.com)help)r   add_resource_argsadd_argument)parsers    1lib/surface/services/mcp/policies/test_enabled.pyArgsTestEnabled.Args0   s)    ""6*
M      c                 H   SnUR                  S5      (       a  [        UR                  -  nSnOUR                  S5      (       a  [        UR                  -  nS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U S	3$ S
UR                   SU 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.
projectfolderorganizationT)requiredzMCP is ENABLED for Service z	 for the  .zMCP is NOT ENABLED for Service )IsSpecified_FOLDER_RESOURCEr   _ORGANIZATION_RESOURCEr   _PROJECT_RESOURCEr   r   VALUEScoreGetr   TestMcpEnabled_SERVICEr   mcpEnableRules)selfargsresourceresource_namer   responses         r   RunTestEnabled.Run7   s    H!!&4mh			.	)	),t/@/@@mh			)	$	$'$,,6m!!&&..22D2Ag''1m**x$,,.H
 '~ 6Zqq* ,DLL> :Zqq*r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r*   __static_attributes__r,   r   r   r   r      s        %r   r   N)r1   googlecloudsdk.api_lib.servicesr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   googlecloudsdk.corer   r   r   r   r#   UniverseCompatibleHiddenReleaseTracksReleaseTrackALPHABETACommandr   r,   r   r   <module>r?      s    2 8 ( < *!  +  D%%++T->->-C-CD=$,, = E  =r   