
                            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d	Z	d
 Z
d Z ej                  ej                  j                         G d dej                               Z ej                  ej                  j"                         G d de             Z ej                  ej                  j&                         G d de             Zy)zCommand AnalyzeOrgPolicies API.    )absolute_import)division)unicode_literals)client_util)basez5    Analyze organization policies under a scope.
    z    To list 10 organization policies of a constraint in an organization, run:

      $ {command} --scope=organizations/YOUR_ORG_ID --constraint=YOUR_CONSTRAINT_NAME --limit=10
    )DESCRIPTIONEXAMPLESc                 .    | j                  dddd       y )Nz--scopeSCOPETax          Scope can only be an organization. The analysis is
        limited to the Cloud organization policies within this scope. The caller must be
        granted the `cloudasset.assets.searchAllResources` permission on
        the desired scope.

        The allowed values are:

          * ```organizations/{ORGANIZATION_NUMBER}``` (e.g. ``organizations/123456'')
        metavarrequiredhelpadd_argumentparsers    )lib/surface/asset/analyze_org_policies.pyAddScopeArgumentr   (   s#    		      c                 .    | j                  dddd       y )Nz--constraint
CONSTRAINTTaT          The name of the constraint to analyze organization policies for. The
        response only contains analyzed organization policies for the provided
        constraint.

        Example:

        * organizations/{ORGANIZATION_NUMBER}/customConstraints/{CUSTOM_CONSTRAINT_NAME}
          for a user-defined custom constraint.
        r   r   r   s    r   AddConstraintArgumentr   9   s#    		  r   c                   *    e Zd ZdZeZed        Zd Zy)AnalyzeOrgPolicies,Analyze organization policies under a scope.c                 n    t        |        t        |        t        j                  j	                  |        y Nr   r   r   URI_FLAGRemoveFromParserr   s    r   ArgszAnalyzeOrgPolicies.ArgsS   $    V&!MM""6*r   c                 L    t        j                         }|j                  |      S r   r   OrgPolicyAnalyzerClientr   selfargsclients      r   RunzAnalyzeOrgPolicies.RunY   !    002F$$T**r   N	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr"   r+    r   r   r   r   M   !    4-+ +
+r   r   c                   *    e Zd ZdZeZed        Zd Zy)AnalyzeOrgPoliciesBetar   c                 n    t        |        t        |        t        j                  j	                  |        y r   r   r   s    r   r"   zAnalyzeOrgPoliciesBeta.Argsd   r#   r   c                 L    t        j                         }|j                  |      S r   r%   r'   s      r   r+   zAnalyzeOrgPoliciesBeta.Runj   r,   r   Nr-   r5   r   r   r8   r8   ^   r6   r   r8   c                   *    e Zd ZdZeZed        Zd Zy)AnalyzeOrgPoliciesGAr   c                 n    t        |        t        |        t        j                  j	                  |        y r   r   r   s    r   r"   zAnalyzeOrgPoliciesGA.Argsu   r#   r   c                 L    t        j                         }|j                  |      S r   r%   r'   s      r   r+   zAnalyzeOrgPoliciesGA.Run{   r,   r   Nr-   r5   r   r   r<   r<   o   r6   r   r<   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.assetr   googlecloudsdk.callioper   r2   r   r   ReleaseTracksReleaseTrackALPHAListCommandr   BETAr8   GAr<   r5   r   r   <module>rH      s    & &  ' 4 (		"( D%%++,+)) + -+  D%%**++/ + ,+  D%%(()+- + *+r   