
                             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  G d
 dej                        Zddie_        y)z:Command for deleting network firewall policy associations.    )absolute_import)division)unicode_literals)base_classes)client)region_client)base)flagsc                   *    e Zd ZdZdZed        Zd Zy)DeletezDelete a new association between a firewall policy and an network or folder resource.

  *{command}* is used to delete network firewall policy associations. An
  network firewall policy is a set of rules that controls access to various
  resources.
  Nc                     t        j                  dd      | _        | j                  j                  |d       t        j                  |       |j
                  j                  t         j                         y )NTdelete)required	operation)operation_type)r
   (NetworkFirewallPolicyAssociationArgumentNETWORK_FIREWALL_POLICY_ARGAddArgumentAddArgsDeleteAssociationdisplay_infoAddCacheUpdater NetworkFirewallPoliciesCompleter)clsparsers     Dlib/surface/compute/network_firewall_policies/associations/delete.pyArgszDelete.Args%   sb     	66X	/ # ##//x/P	""6*
''(N(NO    c                    t        j                  | j                               }| j                  j	                  ||j
                        }t        j                  ||j                        }t        |d      r!t        j                  ||j                        }|j                  |j                  |j                  d      S )N)compute_clientregionF)firewall_policynameonly_generate_request)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcesr   NetworkFirewallPolicyhasattrr   RegionNetworkFirewallPolicyDeleteAssociationr!   r"   )selfargsholderrefnetwork_firewall_policys        r   Runz
Delete.Run.   s    **4+<+<+>?F

*
*
<
<f C %::FMM+sH - I I
fmm!- #44,,YY# 5 % %r   )__name__
__module____qualname____doc__NEWORK_FIREWALL_POLICY_ARGclassmethodr   r1    r   r   r   r      s(      $P P%r   r   EXAMPLESa=      To delete an association from a global network firewall policy with NAME
    ``my-policy'' and association name ``my-association'', run:

      $ {command}
          --firewall-policy=my-policy
          --name=my-association
          --global-firewall-policy

    To delete an association from a regional network firewall policy with NAME
    ``my-policy'' in region ``region-a'' and association name
    ``my-association'', run:

      $ {command}
          --firewall-policy=my-policy
          --name=my-association
          --firewall-policy-region=region-a
    N)r5   
__future__r   r   r   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.network_firewall_policiesr   r   googlecloudsdk.callioper	   <googlecloudsdk.command_lib.compute.network_firewall_policiesr
   CreateCommandr   detailed_helpr8   r   r   <module>rA      sJ    A &  ' 7 K R ( N %T  %H 	 r   