
    w
                     &   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 ddlmZ  e
j                  d	d
       e
j                   e
j"                  j$                         G d de
j&                                      Zddde_        y)z>Command for setting the security policy for a backend service.    )absolute_import)division)unicode_literals)base_classes)client)base)flagsFzvThis command is deprecated and will not be promoted to beta. Please use "gcloud beta backend-services update" instead.)
is_removedwarningc                   *    e Zd ZdZdZed        Zd Zy)SetSecurityPolicyz.Set the security policy for a backend service.Nc                     t         j                  j                  |       t        j                  dd      | _        | j
                  j                  |       y )Nzbackend serviceT)resourcerequired)r	   #GLOBAL_REGIONAL_BACKEND_SERVICE_ARGAddArgumentsecurity_policy_flags'SecurityPolicyArgumentForTargetResourceSECURITY_POLICY_ARG)clsparsers     ;lib/surface/compute/backend_services/set_security_policy.pyArgszSetSecurityPolicy.Args'   sG    	--99&AEE&	7  ''/    c                    t        j                  | j                               }t        j                  j                  ||j                        }|j                  sd }n4| j                  j                  ||j                        j                         }t        j                  ||j                        }|j                  |      S )N)compute_client)security_policy)r   ComputeApiHolderReleaseTrackr	   r   ResolveAsResource	resourcesr   r   SelfLinkr   BackendServicer   )selfargsholderrefsecurity_policy_refbackend_services         r   RunzSetSecurityPolicy.Run/   s    **4+<+<+>?F

3
3
E
Ef C   44FF
  ""*(*  ++CNO,,+ - - -r   )__name__
__module____qualname____doc__r   classmethodr   r*    r   r   r   r      s$     70 0-r   r   z-Set the security policy for a backend servicez
        *{command}* is used to set the security policy for a backend service.
        Setting an empty string will clear the existing security policy.  )briefDESCRIPTIONN)r.   
__future__r   r   r   googlecloudsdk.api_lib.computer   /googlecloudsdk.api_lib.compute.backend_servicesr   googlecloudsdk.callioper   3googlecloudsdk.command_lib.compute.backend_servicesr	   4googlecloudsdk.command_lib.compute.security_policiesr   	DeprecateReleaseTracksr   ALPHASilentCommandr   detailed_helpr0   r   r   <module>r>      s    E &  ' 7 B ( E$ IK D%%++,-** - -	K
-@ 	8	N	#  r   