
                         8   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  SS	K
Jr  \	R                  " \	R                  R                   \	R                  R"                  \	R                  R$                  5       " S
 S\	R&                  5      5       rg)z+Command to describe an Organization Policy.    )absolute_import)division)unicode_literals)
exceptions)org_policies)base)org_policies_base)org_policies_flagsc                   B    \ rS rSrSrSr\S 5       rS r\S 5       r	Sr
g)	Describe   a  Describe an Organization Policy.

Describes an Organization Policy associated with the specified resource.

## EXAMPLES

The following command retrieves an Organization Policy
for constraint `serviceuser.services` on project `foo-project`:

  $ {command} serviceuser.services --project=foo-project

The following command retrieves the effective Organization Policy
for constraint `serviceuser.services` on project `foo-project`:

  $ {command} serviceuser.services --project=foo-project --effective
zyThis policy has been set with Tags through Organization Policy V2 API, please use `gcloud org-policies` commands instead.c                     [         R                  " U 5        [         R                  " U 5        [        R                  " SSSSSS9R                  U 5        g )Nz--effective
store_trueFzShow the effective policy.)actionrequireddefaulthelp)flagsAddIdArgToParserAddParentResourceFlagsToParserr   ArgumentAddToParser)parsers    5lib/surface/resource_manager/org_policies/describe.pyArgsDescribe.Args4   sE    	6"	((0MM)+
 ,7;v+>    c                 \   [         R                  " U5      nUR                  (       dd  UR                  [         R                  " U5      5      nUR
                  b0  UR
                  S:X  a   [        R                  " U R                  5      eU$ UR                  U R                  U5      5      nU$ )N   )r	   OrgPoliciesService	effectiveGetOrgPolicyGetOrgPolicyRequestversionr   ResourceManagerErrorPOLICY_V2_WARNINGGetEffectiveOrgPolicyGetEffectiveOrgPolicyRequest)selfargsserviceresponses       r   RunDescribe.Run?   s    2248G>>%%

/
/
57h				%(*:*:a*?--d.D.DEE O ..

+
+D
13hOr   c                 t   [         R                  " 5       n[        R                  " U 5      nUR	                  [         R
                  " U R                  5      S9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)
constraint)
projectsIdgetEffectiveOrgPolicyRequest)organizationsIdr2   )	foldersIdr2   )r   OrgPoliciesMessagesr	   GetResourcer(   FormatConstraintidproject8CloudresourcemanagerProjectsGetEffectiveOrgPolicyRequestorganization=CloudresourcemanagerOrganizationsGetEffectiveOrgPolicyRequestfolder7CloudresourcemanagerFoldersGetEffectiveOrgPolicyRequest)r*   mresource_idrequests       r   r(   %Describe.GetEffectiveOrgPolicyRequestL   s    ((*A#//5K,,009 - ;G ||GG  H H H			LL% M M M	FF G G Gr    N)__name__
__module____qualname____firstlineno____doc__r&   staticmethodr   r-   r(   __static_attributes__rC   r   r   r   r      s<    "+ ? ?  r   r   N)rH   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   r   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr	   r
   r   ReleaseTracksReleaseTrackALPHABETAGADescribeCommandr   rC   r   r   <module>rU      sy    2 &  ' > @ ( I S D%%++T->->-C-C%%((*>t## >*>r   