
    x                         d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ d	d
dZ e	j                  e	j                  j                         G d de	j                                Zee_        y)zDelete attachment command.    )absolute_import)division)unicode_literalsN)attachment_api)base)attachment_flagsz
          Delete a firewall attachment. Check the progress of attachment deletion
          by using `gcloud network-security firewall-attachments list`.

          For more examples, refer to the EXAMPLES section below.

        a>  
            To delete a firewall attachment called `my-attachment`, in zone
            `us-central1-a` and project my-proj, run:

            $ {command} my-attachment --zone=us-central1-a --project=my-proj

            $ {command} projects/my-proj/locations/us-central1-a/firewallAttachments/my-attachment

        )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)DeletezDelete a Firewall attachment.c                     t        j                  | j                         |       t        j                  |d       t        j
                  j                  |       t        j
                  j                  |d       y )N60mT)r   AddAttachmentResourceReleaseTrack
AddMaxWaitr   
ASYNC_FLAGAddToParser
SetDefault)clsparsers     ;lib/surface/network_security/firewall_attachments/delete.pyArgszDelete.Args3   sQ    **3+;+;+=vF.OO'OOvt,    c                    t        j                  | j                               }|j                  j                  j                         }|j                  }t        j                  |j                        }|j                  |j                               }|r|j                  d      sd|_        |S |j                  |j                  |      dj                  |j                               d|      S )N)seconds)nameformatdefaultz2waiting for firewall attachment [{}] to be deletedT)operation_refmessage
has_resultmax_wait)r   Clientr   CONCEPTSfirewall_attachmentParseasync_datetime	timedeltar"   DeleteAttachmentRelativeNameIsSpecifiedr   WaitForOperationGetOperationRef)selfargsclient
attachmentis_asyncr"   	operations          r   Runz
Delete.Run:   s    ""4#4#4#67F2288:J{{H!!$--8H''$$& ( I  h'"",,Y7@VJ++-. #  r   N)__name__
__module____qualname____doc__classmethodr   r5    r   r   r   r   /   s    %- -r   r   )r9   
__future__r   r   r   r(   <googlecloudsdk.api_lib.network_security.firewall_attachmentsr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.network_securityr   DETAILED_HELPReleaseTracksr   ALPHADeleteCommandr   detailed_helpr;   r   r   <module>rE      su    ! &  '  W ( H( D%%++,$T $ -$N % r   