
    ~                         S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJ	r	  SSK
Jr  SS	KJr  S
SS.r\	R                  " \	R                   R"                  5       " S S\	R$                  5      5       r\\l        g)zCreate attachment command.    )absolute_import)division)unicode_literalsN)attachment_api)base)attachment_flags)labels_utila?  
          Create a firewall attachment. Successful creation of an attachment results
          in an attachment in READY state. Check the progress of attachment creation
          by using `gcloud network-security firewall-attachments list`.

          For more examples, refer to the EXAMPLES section below.

        a?  
            To create 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
            --producer-forwarding-rule=projects/my-proj/locations/us-central1-a/forwardingRule/my-fw

        )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)Create0   zCreate a Firewall attachment.c                 R   [         R                  " U R                  5       U5        [         R                  " US5        [         R                  " U5        [
        R                  R                  U5        [
        R                  R                  US5        [        R                  " U5        g )N60mT)r   AddAttachmentResourceReleaseTrack
AddMaxWaitAddProducerForwardingRuleArgr   
ASYNC_FLAGAddToParser
SetDefaultr	   AddCreateLabelsFlags)clsparsers     ;lib/surface/network_security/firewall_attachments/create.pyArgsCreate.Args4   sm    **3+;+;+=vF.11&9OO'OOvt,$$V,    c                    [         R                  " U R                  5       5      nUR                  R                  R                  5       n[        R                  " XR                  R                  R                  5      nUR                  n[        R                  " UR                  S9nUR                  UR!                  5       UR#                  5       R%                  5       ['        US5      US9nU(       a  UR)                  S5      (       d  SUl        U$ UR-                  UR/                  U5      SR+                  UR%                  5       5      SUS9$ )	N)secondsproducer_forwarding_rule)attachment_idparentproducer_forwarding_rule_namelabelsformatdefaultz2waiting for firewall attachment [{}] to be createdT)operation_refmessage
has_resultmax_wait)r   Clientr   CONCEPTSfirewall_attachmentParser	   ParseCreateArgsmessagesFirewallAttachmentLabelsValueasync_datetime	timedeltar+   CreateAttachmentNameParentRelativeNamegetattrIsSpecifiedr&   WaitForOperationGetOperationRef)selfargsclient
attachmentr%   is_asyncr+   	operations           r   Run
Create.Run=   s   ""4#4#4#67F2288:J((oo00<<F {{H!!$--8H'' oo'  "//1&-d4N&O	 ( I  h''"",,Y7@VJ++-. #  r    N)	__name__
__module____qualname____firstlineno____doc__classmethodr   rE   __static_attributes__rG   r   r   r   r   0   s    %- - r   r   )rL   
__future__r   r   r   r5   <googlecloudsdk.api_lib.network_security.firewall_attachmentsr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.network_securityr   $googlecloudsdk.command_lib.util.argsr	   DETAILED_HELPReleaseTracksr   ALPHACreateCommandr   detailed_helprG   r   r   <module>rY      sv    ! &  '  W ( H <( D%%++,,T , -,^ % r   