
                         ,   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  \R                  " \R                  R                  \R                  R                   \R                  R"                  5       " S	 S
\R$                  5      5       rg)zMCommand to list Organization Policies associated with the specified resource.    )absolute_import)division)unicode_literals)org_policies)base)org_policies_base)org_policies_flagsc                   N    \ rS rSrSr\S 5       rS r\S 5       r\S 5       r	Sr
g)	List   a  List Organization Policies associated with the specified resource.

## EXAMPLES

The following command lists all set Organization Policies associated with
project `foo-project`:

  $ {command} --project=foo-project

The following command lists all available constraints in addition to set
Organization Policies associated with project `foo-project`:

  $ {command} --project=foo-project --show-unset
c                     [         R                  " U 5        [        R                  " SSSSSS9R	                  U 5        U R
                  R                  S5        g )Nz--show-unset
store_trueFz
        Show available constraints. For more information about constraints, see
        https://cloud.google.com/resource-manager/docs/organization-policy/understanding-constraints
        )actionrequireddefaulthelpz
          table(
            constraint,
            listPolicy.yesno(no="-", yes="SET"),
            booleanPolicy.yesno(no="-", yes="SET"),
            etag
          )
        )flagsAddParentResourceFlagsToParserr   ArgumentAddToParserdisplay_info	AddFormat)parsers    1lib/surface/resource_manager/org_policies/list.pyArgs	List.Args.   sR    	((0MM [ 
!! #     c                    [         R                  " U5      nUR                  U R                  U5      5      nUR                  (       a  UR                  U R                  U5      5      nUR                   Vs/ s H  oUR                  PM     nn[        R                  " 5       nUR                   HG  nUR                  U;  d  M  UR                  R                  UR                  UR                  S95        MI     UR                  $ s  snf )N)
constraint)r   OrgPoliciesServiceListOrgPoliciesListOrgPoliciesRequest
show_unset!ListAvailableOrgPolicyConstraints(ListAvailableOrgPolicyConstraintsRequestpoliciesr   r   OrgPoliciesMessagesconstraintsnameappend	OrgPolicy)	selfargsserviceresponser(   policyexisting_policiesmessagesr   s	            r   RunList.RunC   s    2248G&&t'B'B4'HIH==

7
7
=?k;C;L;LM;L,,;LM113h#//*??"33



"
"  JOO <> 0
  Ns   6Dc                 :   [         R                  " 5       n[        R                  " U 5      nUR	                  5       nU R
                  (       a  UR                  X#S9$ U R                  (       a  UR                  X#S9$ U R                  (       a  UR                  X#S9$ g )N)
projectsIdlistOrgPoliciesRequest)organizationsIdr7   )	foldersIdr7   )r   r'   r   GetResourcer"   project2CloudresourcemanagerProjectsListOrgPoliciesRequestorganization7CloudresourcemanagerOrganizationsListOrgPoliciesRequestfolder1CloudresourcemanagerFoldersListOrgPoliciesRequestr-   r2   resource_idrequests       r   r"   List.ListOrgPoliciesRequestT   s    //1H#//5K--/G||HH  I B B			MM% N G G	GG H A Ar   c                 @   [         R                  " 5       n[        R                  " U 5      nUR	                  5       nU R
                  (       a  UR                  UUS9$ U R                  (       a  UR                  UUS9$ U R                  (       a  UR                  UUS9$ g )N)r6   (listAvailableOrgPolicyConstraintsRequest)r8   rF   )r9   rF   )r   r'   r   r:   r%   r;   DCloudresourcemanagerProjectsListAvailableOrgPolicyConstraintsRequestr=   ICloudresourcemanagerOrganizationsListAvailableOrgPolicyConstraintsRequestr?   CCloudresourcemanagerFoldersListAvailableOrgPolicyConstraintsRequestrA   s       r   r%   -List.ListAvailableOrgPolicyConstraintsRequestd   s    //1H#//5K??AG||ZZ 3: [ < < 
		__%3: ` < < 
YY3: Z < < r    N)__name__
__module____qualname____firstlineno____doc__staticmethodr   r3   r"   r%   __static_attributes__rK   r   r   r   r      sH      ("    r   r   N)rP   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr   r	   r   ReleaseTracksReleaseTrackALPHABETAGAListCommandr   rK   r   r   <module>r]      sz     T &  ' @ ( I S D%%++T->->-C-C%%((*[4 [*[r   