
    z                     >   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y)z+Command AnalyzeOrgPolicyGovernedAssets API.    )absolute_import)division)unicode_literals)client_util)basezE    Analyze organization policies governed assets under a scope.
    z    To list 10 assets governed by 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SCOPETa          Scope can only be an organization. The analysis is
        limited to the Cloud organization policies and assets within this scope. The caller must be
        granted the `cloudasset.assets.searchAllResources` and `cloudasset.assets.searchAllIamPolicies` permission on
        the desired scope.

        The allowed values are:

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

        Examples:

        * organizations/{ORGANIZATION_NUMBER}/customConstraints/{CUSTOM_CONSTRAINT_NAME}
          for a user-defined custom constraint.
        * organizations/{ORGANIZATION_NUMBER}/constraints/{CANNED_CONSTRAINT_NAME}
          for a gcp-service-defined canned 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)AnalyzeOrgPolicyGovernedAssets<Analyze organization policies governed assets under a scope.c                 n    t        |        t        |        t        j                  j	                  |        y Nr   r   r   URI_FLAGRemoveFromParserr   s    r   Argsz#AnalyzeOrgPolicyGovernedAssets.ArgsU   $    V&!MM""6*r   c                 L    t        j                         }|j                  |      S r   r   OrgPolicyAnalyzerClientr   selfargsclients      r   Runz"AnalyzeOrgPolicyGovernedAssets.Run[   !    002F0066r   N	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr"   r+    r   r   r   r   O   !    D-+ +
7r   r   c                   *    e Zd ZdZeZed        Zd Zy) AnalyzeOrgPolicyGovernedAssetsGAr   c                 n    t        |        t        |        t        j                  j	                  |        y r   r   r   s    r   r"   z%AnalyzeOrgPolicyGovernedAssetsGA.Argsf   r#   r   c                 L    t        j                         }|j                  |      S r   r%   r'   s      r   r+   z$AnalyzeOrgPolicyGovernedAssetsGA.Runl   r,   r   Nr-   r5   r   r   r8   r8   `   r6   r   r8   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.assetr   googlecloudsdk.callioper   r2   r   r   ReleaseTracksReleaseTrackBETAListCommandr   GAr8   r5   r   r   <module>rC      s    2 &  ' 4 (		", D%%**+7T%5%5 7 ,7  D%%(()7'E 7 *7r   