
                         ,   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  \R                  \R                  " \R                   R"                  \R                   R$                  5       " S
 S\R&                  5      5       5       rg)z!Command to update an SCC service.    )absolute_import)division)unicode_literals)clients)base)flags)parsing)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)Update   ab  Update a Security Command Center service.

Update the enablement state of the Security Center service and its
corresponding modules for the specified folder, project or organization.

## EXAMPLES

To update a Security Center Service with name `sha` for organization 123, run:

    $ {command} sha
        --organization=organizations/123 --enablement-state="ENABLED"

To update a Security Center Service with name `sha` and its modules for
organization 123, run:

    $ {command} sha
        --organization=organizations/123 --enablement-state="ENABLED"
        --module-config-file=module_config.yaml

To validate an update of Security Center Service with name `sha` and its
modules for organization 123, run:

    $ {command} sha
        --organization=organizations/123 --enablement-state="ENABLED"
        --module-config-file=module_config.yaml --validate-only
c                     [         R                  " 5       R                  U 5        [         R                  " SS9R                  U 5        [         R                  " SS9R                  U 5        [         R
                  " SSS9R                  U 5        g )NT)requiredFzJSON or YAML)r   	file_type)r   CreateServiceNameArgAddToParserCreateParentFlagCreateValidateOnlyFlagCreateServiceUpdateFlags)parsers    )lib/surface/scc/manage/services/update.pyArgsUpdate.Args:   sk    	 ,,V4	D)55f=	  %0<<VD	""  k&    c                    [         R                  " U5      nUR                  n[         R                  " UR                  5      n[         R
                  " UR                  5      n[         R                  " U5      nU(       d$  [        R                  " SR                  U5      SS9  [        R                  " 5       nUR                  UUUUUS9$ )Nz@Are you sure you want to update the Security Center Service {}?
T)messagecancel_on_no)namevalidate_onlymodule_configenablement_stateupdate_mask)r	   GetServiceNameFromArgsr   GetModuleConfigValueFromArgsmodule_config_file!GetServiceEnablementStateFromArgsr!   "CreateUpdateMaskFromArgsForServicer
   PromptContinueformatr   SecurityCenterServicesClientr   )selfargsr   r   r    r!   r"   clients           r   Run
Update.RunD   s    ))$/D&&M88M @@ <<TBKvd| 113F==##)   r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r.   __static_attributes__r0   r   r   r   r      s     6  r   r   N)r5   
__future__r   r   r   *googlecloudsdk.api_lib.scc.manage.servicesr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.scc.manager   r	   googlecloudsdk.core.consoler
   DefaultUniverseOnlyReleaseTracksReleaseTrackGAALPHACommandr   r0   r   r   <module>rC      sx    ( &  ' > ( 7 9 2 D%%(($*;*;*A*ABBT\\ B C Br   