
    	                         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Zd
Z G d de
j                  e
j                         Zddie_        y	)zKCommand for listing the associations of an organization or folder resource.    )absolute_import)division)unicode_literals)base_classes)client)base)flagsNz<  table(
    name,
    displayName,
    firewallPolicyId
  )c                   &    e Zd ZdZed        Zd Zy)ListzList the associations of an organization or folder resource.

  *{command}* is used to list the associations of an organization or folder
   resource.
  c                 l    t        j                  |       |j                  j                  t               y )N)r	   AddArgsListAssociationdisplay_info	AddFormatDEFAULT_LIST_FORMAT)clsparsers     :lib/surface/compute/firewall_policies/associations/list.pyArgsz	List.Args+   s%    	  (
!!"56    c                    t        j                  | j                               }t        j                  |j                  |j
                  t        j                  | j                               j                               }d }|j                  d      rd|j                  z   }n |j                  d      rd|j                  z   }|j                  |d      }|sy |d   j                  S )	N)compute_client	resourcesversionorganizationzorganizations/folderzfolders/F)target_resourceonly_generate_requestr   )r   ComputeApiHolderReleaseTrackr   OrgFirewallPolicyr   six	text_typelowerIsSpecifiedr   r   ListAssociationsassociations)selfargsholderorg_firewall_policyr   ress         r   RunzList.Run0   s    **4+<+<+>?F 22}}""d//1288:<
 O'(4+<+<<o			(	#"T[[0o

.
.'u / FCq6r   N)__name__
__module____qualname____doc__classmethodr   r,    r   r   r   r   $   s      7 7r   r   EXAMPLESzp    To list the associations of the folder with ID ``987654321", run:

      $ {command} --folder=987654321
    )r0   
__future__r   r   r   googlecloudsdk.api_lib.computer   0googlecloudsdk.api_lib.compute.firewall_policiesr   googlecloudsdk.callioper   4googlecloudsdk.command_lib.compute.firewall_policiesr	   r!   r   DescribeCommandListCommandr   detailed_helpr2   r   r   <module>r<      sZ    R &  ' 7 C ( F 
 4!1!1 D 	 r   