
                             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	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 ej.                  d      dde_        y)z6Command for removing a Rule from a Compute Engine NAT.    )absolute_import)division)unicode_literalsN)base_classes)utils)base)flags)
nats_utils)rules_utilsc                   0    e Zd ZdZdZed        Zd Zd Zy)Deletez&Delete a Rule in a Compute Engine NAT.Nc                     t        j                         | _        | j                  j                  |       t	        j
                  |d       t	        j                  |       t        j                  |ddd       y )NT)pluralzNAT containing the Ruledelete)operation_typer   )	routers_flagsRouterArgumentForNat
ROUTER_ARGAddArgumentrules_flagsAddRuleNumberArgAddNatNameArgcompute_flagsAddRegionFlag)clsparsers     0lib/surface/compute/routers/nats/rules/delete.pyArgszDelete.Args%   s[    "779CNNNv&  5f%)(4Q    c           
         t        j                  | j                               }|j                  }| j                  j                  ||j                        }|j                  |j                  j                  d |j                  j                  di |j                         fg      }|d   }|j                  }|j                  }t        j                   ||      }	|D ]3  }
t#        j$                  |	|
      }|	j&                  j)                  |       5 t+        j,                  ddj/                  |j                  |      g       |j                  | j1                  |||      g      S )NGetr   Rulez{} in NAT {} )r   ComputeApiHolderReleaseTrackclientr   ResolveAsResource	resourcesMakeRequestsapitools_clientroutersmessagesComputeRoutersGetRequestAsDictnatrule_numberr
   FindNatOrRaiser   FindRuleOrRaiserulesremover   PromptForDeletionHelperformat_GetPatchRequest)selfargsholderr&   
router_refobjectsrouternat_namerule_numbersr/   r0   rules               r   Runz
Delete.Run/   sA   **4+<+<+>?F]]F2249I9IJJ!!				'	'	1	1	1	HJ4E4E4G	H	J# G QZFxxH##L

#
#FH
5C#((k:d	iit $ 
!!&&t'7'7BCE 			vz6	:;= =r   c                     |j                   j                  d|j                  j                  |j	                         ||j
                  |j                        fS )NPatch)r=   routerResourceregionproject)r*   r+   r,   ComputeRoutersPatchRequestNamerE   rF   )r8   r&   r;   r=   s       r   r7   zDelete._GetPatchRequestI   sS    ""**GOO66!(%!(("**	 7 ,- -r   )	__name__
__module____qualname____doc__r   classmethodr   rA   r7   r#   r   r   r   r       s(    .*Q Q=4-r   r   zL          *{command}* is used to delete a Rule on a Compute Engine NAT.
    zy    To delete Rule 1 in NAT 'n1' in router 'r1', run:

      $ {command} 1 --nat=n1 --router=r1 --region=us-central1
    )DESCRIPTIONEXAMPLES)rL   
__future__r   r   r   textwrapgooglecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r   *googlecloudsdk.command_lib.compute.routersr   /googlecloudsdk.command_lib.compute.routers.natsr
   5googlecloudsdk.command_lib.compute.routers.nats.rulesr   r   DeleteCommandr   dedentdetailed_helpr#   r   r   <module>r[      se    = &  '  7 0 ( E M F V M/-T /-h 	  			 r   