
    Q	                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ  G d d	ej                  ej                  e
j                        Zy
)z6The command to suspend the Policy Controller webhooks.    )absolute_import)division)unicode_literals)base)command)flagsc                   4    e Zd ZdZdZdZed        Zd Zd Z	y)Suspenda  Suspend Policy Controller Feature.

  Suspends the Policy Controller. This will disable all kubernetes webhooks on
  the configured cluster, thereby removing admission and mutation functionality.
  Audit functionality will remain in place.

  ## EXAMPLES

  To suspend Policy Controller, run:

    $ {command}

  To re-enable Policy Controller webhooks, use the `enable` command:

    $ {parent_command} enable
  policycontrollerc                 P    t        j                  |d      }|j                          y )Nsuspend)r   	PocoFlagsadd_memberships)clsparser	cmd_flagss      7lib/surface/container/fleet/policycontroller/suspend.pyArgszSuspend.Args0   s    	2I    c                     | j                  |      }|j                         D ci c]  \  }}|| j                  |       }}}| j                  |      S c c}}w )N)
path_specsitemsr   update_specs)selfargsspecspathspecupdated_specss         r   RunzSuspend.Run5   s\    OOD!E38;;=3@ZT4dll4  =   ]++s   Ac                     | j                   j                  j                  j                  |j                  j
                  _        |S )zSets the membership spec to SUSPENDED.

    Args:
      spec: The spec to be suspended.

    Returns:
      Updated spec, based on message api version.
    )messagesPolicyControllerHubConfigInstallSpecValueValuesEnumINSTALL_SPEC_SUSPENDEDr   policyControllerHubConfiginstallSpec)r   r   s     r   r   zSuspend.suspend<   s8     	//JJaa 	33? Kr   N)
__name__
__module____qualname____doc__feature_namemf_nameclassmethodr   r    r    r   r   r
   r
      s/    " $,'   ,r   r
   N)r+   
__future__r   r   r   3googlecloudsdk.command_lib.container.fleet.featuresr   =googlecloudsdk.command_lib.container.fleet.membershipfeaturesmf_base;googlecloudsdk.command_lib.container.fleet.policycontrollerr   r   UpdateCommandPocoCommandr
   r/   r   r   <module>r7      sA    = &  ' D Y O M-d  '"7"79L9L -r   