
    	                         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
dZ e	j                  e	j                  j                          G d de	j"                               Zee_        y)z(Describe command for the Org Policy CLI.    )absolute_import)division)unicode_literals)service)base)	arguments)utilsz.      Describes an organization policy.
      z      To describe the policy associated with the constraint 'gcp.resourceLocations'
      and the Project 'foo-project', run:

      $ {command} gcp.resourceLocations --project=foo-project
      )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Describez Describe an organization policy.c                     t        j                  |        t        j                  |        | j                  ddd       y )Nz--effective
store_truezDescribe the effective policy.)actionhelp)r   AddConstraintArgToParserAddResourceFlagsToParseradd_argument)parsers    $lib/surface/org_policies/describe.pyArgszDescribe.Args-   s:    &&v.&&v.
-  /    c                     t        j                  | j                               }t        j                  |      }|j
                  r|j                  |      S |j                  |      S )a  Gets the (effective) organization policy.

    If --effective is not specified, then the policy is retrieved using
    GetPolicy.

    If --effective is specified, then the effective policy is retrieved using
    GetEffectivePolicy.

    Args:
      args: argparse.Namespace, An object that contains the values for the
        arguments specified in the Args method.

    Returns:
       The retrieved policy.
    )org_policy_serviceOrgPolicyApiReleaseTrackr	   GetPolicyNameFromArgs	effectiveGetEffectivePolicy	GetPolicy)selfargsorg_policy_apipolicy_names       r   RunzDescribe.Run6   sV      (44T5F5F5HIN--d3K~~..{;;##K00r   N)__name__
__module____qualname____doc__staticmethodr   r%    r   r   r   r   )   s    (/ /1r   r   N)r)   
__future__r   r   r    googlecloudsdk.api_lib.orgpolicyr   r   googlecloudsdk.callioper   'googlecloudsdk.command_lib.org_policiesr   r	   DETAILED_HELPReleaseTracksr   GADescribeCommandr   detailed_helpr+   r   r   <module>r5      su    / &  ' J ( = 9	
	
 D%%(()"1t## "1 *"1J ' r   