
    F                        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  S
rSSS.r\R"                  " \R$                  R&                  5       " S S\R(                  5      5       r\R"                  " \R$                  R,                  5       " S S\5      5       r\R"                  " \R$                  R0                  5       " S S\5      5       rg)zICommand to analyze IAM policy asynchronously in the specified root asset.    )absolute_import)division)unicode_literals)client_util)base)flags)utils)logz gcloud asset operations describez      Analyzes IAM policies that match a request asynchronously and writes
      the results to Google Cloud Storage or BigQuery destination.
      a        To find out which users have been granted the
      iam.serviceAccounts.actAs permission on a service account, and write
      analysis results to Google Cloud Storage, run:

        $ {command} --organization=YOUR_ORG_ID --full-resource-name=YOUR_SERVICE_ACCOUNT_FULL_RESOURCE_NAME --permissions='iam.serviceAccounts.actAs' --gcs-output-path='gs://YOUR_BUCKET_NAME/YOUR_OBJECT_NAME'

      To find out which resources a user can access, and write analysis
      results to Google Cloud Storage, run:

        $ {command} --organization=YOUR_ORG_ID --identity='user:u1@foo.com' --gcs-output-path='gs://YOUR_BUCKET_NAME/YOUR_OBJECT_NAME'

      To find out which roles or permissions a user has been granted on a
      project, and write analysis results to BigQuery, run:

        $ {command} --organization=YOUR_ORG_ID --full-resource-name=YOUR_PROJECT_FULL_RESOURCE_NAME --identity='user:u1@foo.com' --bigquery-dataset='projects/YOUR_PROJECT_ID/datasets/YOUR_DATASET_ID' --bigquery-table-prefix='YOUR_BIGQUERY_TABLE_PREFIX'

      To find out which users have been granted the
      iam.serviceAccounts.actAs permission on any applicable resources, and
      write analysis results to BigQuery, run:

        $ {command} --organization=YOUR_ORG_ID --permissions='iam.serviceAccounts.actAs' --bigquery-dataset='projects/YOUR_PROJECT_ID/datasets/YOUR_DATASET_ID' --bigquery-table-prefix='YOUR_BIGQUERY_TABLE_PREFIX'

      )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)AnalyzeIamPolicyLongrunning>   Analyzes IAM policies that match a request asynchronously and writes the results to Google Cloud Storage or BigQuery destination.c                     [         R                  " U 5        [         R                  " U 5        [         R                  " U S5        [         R                  " U 5        [         R
                  " U 5        g )NF)r   AddAnalyzerParentArgsAddAnalyzerSelectorsGroupAddAnalyzerOptionsGroup AddAnalyzerConditionContextGroupAddDestinationGroupparsers    3lib/surface/asset/analyze_iam_policy_longrunning.pyArgs AnalyzeIamPolicyLongrunning.ArgsD   sJ    	'	##F+	!!&%0	**62	f%    c                 t   [         R                  " UR                  UR                  UR                  5      n[
        R                  " 5       nUR                  X!5      n[        R                  R                  S5        [        R                  R                  SR                  [        UR                  5      5        g )NzAnalyze IAM Policy in progress.z1Use [{} {}] to check the status of the operation.)asset_utils GetParentNameForAnalyzeIamPolicyorganizationprojectfolderr   "IamPolicyAnalysisLongrunningClientAnalyzer
   statusPrintformatOPERATION_DESCRIBE_COMMANDname)selfargsparentclient	operations        r   RunAnalyzeIamPolicyLongrunning.RunL   s    994<<6F;;=Fv,IJJ67JJHOO"INN4 5r    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr   r/   __static_attributes__r1   r   r   r   r   >   s$     J-& &5r   r   c                   (    \ rS rSrSr\S 5       rSrg)AnalyzeIamPolicyLongrunningBETAW   r   c                 .    [         R                  U 5        g N)r   r   r   s    r   r   $AnalyzeIamPolicyLongrunningBETA.Args[   s    $$V,r   r1   Nr2   r3   r4   r5   r6   r9   r   r:   r1   r   r   r<   r<   W   s     J- -r   r<   c                   (    \ rS rSrSr\S 5       rSrg) AnalyzeIamPolicyLongrunningALPHA`   r   c                     [         R                  U 5        [        R                  " U 5      n[        R                  " U5        g r?   )r<   r   r   GetOrAddOptionGroup(AddAnalyzerIncludeDenyPolicyAnalysisArgs)r   options_groups     r   r   %AnalyzeIamPolicyLongrunningALPHA.Argsd   s0    #((0 --f5M	22=Ar   r1   NrA   r1   r   r   rC   rC   `   s     JB Br   rC   N)r6   
__future__r   r   r   googlecloudsdk.api_lib.assetr   googlecloudsdk.callioper    googlecloudsdk.command_lib.assetr   r	   r   googlecloudsdk.corer
   r(   r7   ReleaseTracksReleaseTrackGACommandr   BETAr<   ALPHArC   r1   r   r   <module>rU      s    P &  ' 4 ( 2 A #? 

@ D%%(()5$,, 5 *50 D%%**+-&A - ,- D%%++,	B'F 	B -	Br   