
    +                         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 dd
lmZ ddlmZ ddlmZ  G d de	j*                        Z G d dej.                        Zy)zCommand to delete SSL policies.    )absolute_import)division)unicode_literals)base_classes)utils)poller)ssl_policies_utils)waiter)base)scope)flagsc                   &     e Zd Zd fd	Zd Z xZS )DeleteBatchPollerc                 0    t         t        |   |||       y N)superr   __init__)selfcompute_adapterresource_servicetarget_refs	__class__s       *lib/surface/compute/ssl_policies/delete.pyr   zDeleteBatchPoller.__init__!   s    	
T+O=M,79    c                      y r    )r   operation_batchs     r   	GetResultzDeleteBatchPoller.GetResult%   s     r   r   )__name__
__module____qualname__r   r   __classcell__)r   s   @r   r   r      s    9r   r   c                   *    e Zd ZdZdZed        Zd Zy)Deletear  Delete Compute Engine SSL policies.

  *{command}* is used to delete one or more Compute Engine SSL policies.
  SSL policies can only be deleted when no other resources (e.g.,
  Target HTTPS proxies, Target SSL proxies) refer to them.

  An SSL policy specifies the server-side support for SSL features. An SSL
  policy can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects
  connections between clients and the load balancer. SSL
  policies do not affect the connection between the load balancers and the
  backends. SSL policies are used by Application Load Balancers and proxy
  Network Load Balancers.
  Nc                     |j                   j                  t        j                         t        j                  d      | _        | j
                  j                  |d       y )NT)pluraldelete)operation_type)display_infoAddCacheUpdaterr   SslPoliciesCompleterGetSslPolicyMultiScopeArgumentSSL_POLICY_ARGAddArgument)clsparsers     r   ArgszDelete.Args<   sH    
''(B(BC==TJC""6("Cr   c                 d   t        j                  | j                               }t        j                  |      }|j
                  j                  }| j                  j                  ||j                  t        j                  j                        }t        j                  |       |D cg c]  }|j                  |       }}dj!                  t#        |      dkD  rdnd      }t%        |j
                  |j&                        }	t)        j*                  |	t-        j.                  |      |      S c c}w )z*Issues the request to delete a SSL policy.)default_scopezDeleting SSL {}   policiespolicy)r   ComputeApiHolderReleaseTrackr	   SslPolicyHelperclientapitools_clientr-   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALr   PromptForDeletionr$   formatlenr   sslPoliciesr
   WaitForr   OperationBatch)
r   argsholderhelperr:   refsrefoperation_refswait_messageoperation_pollers
             r   Runz
Delete.RunB   s    **4+<+<+>?F//7F]]**F00fm.E.E.L.L 1 ND	D!489DSfmmC(DN9$++N+a/hAL(8J8JK>>* //?O O	 :s   (D-)r   r    r!   __doc__r-   classmethodr1   rO   r   r   r   r$   r$   +   s(     .D D
Or   r$   N)rP   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   )googlecloudsdk.api_lib.compute.operationsr   +googlecloudsdk.api_lib.compute.ssl_policiesr	   googlecloudsdk.api_lib.utilr
   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r>   /googlecloudsdk.command_lib.compute.ssl_policiesr   BatchPollerr   DeleteCommandr$   r   r   r   <module>r\      sQ    & &  ' 7 0 < J . ( E A	** 	%OT %Or   