
                         |   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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r\R:                  \R<                  " \R>                  R@                  5      \RB                   " S S\RD                  5      5       5       5       r#g)z=Command to set attestation rules on a workload identity pool.    )absolute_import)division)unicode_literals)encoding)util)waiter)base)
exceptions)concepts)identity_pool_waiter)	yaml_data)concept_parsers)log)	resources)yamlNc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
SetAttestationRules$   z2Set attestation rules on a workload identity pool.z{description}z          The following command sets attestation rules on a workload identity
          pool `my-pool` using a policy file.

            $ {command} my-pool             --location="global"             --policy-file="policy.json"
          )DESCRIPTIONEXAMPLESc                 T   [         R                  R                  S5      n[        R                  R                  S[        R                  R                  UR                  5       SS9SSS9R                  U 5        U R                  SSSS	9  [        R                  R                  U 5        g )
Nziam.workload_identity_poolworkload_identity_poolT)is_positionalz7The workload identity pool to set attestation rules on.)requiredz--policy-filea?            Path to a local JSON-formatted or YAML-formatted file containing an
          attestation policy, structured as a [list of attestation rules](https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools.namespaces.managedIdentities/setAttestationRules#request-body).
          )helpr   )r   ResourceYAMLDataFromPathr   ConceptParserForResourcer   ResourceSpecFromYamlGetDataAddToParseradd_argumentr	   
ASYNC_FLAG)parserworkload_pool_datas     @lib/surface/iam/workload_identity_pools/set_attestation_rules.pyArgsSetAttestationRules.Args6   s    "33<<$ !!-- &&&&( 	' 	
 	B .  k&
    	OO'    c           	         [         R                  " 5       u  p#UR                  R                  R	                  5       n[
        R                  " UR                  5      n [        R                  " UR                  U5      nUR"                  R%                  UR'                  UR)                  5       US95      n[*        R,                  R/                  SR                  UR0                  5      5        UR2                  (       a  U$ [4        R6                  " [8        R:                  " UR"                  UR<                  5      [>        R@                  RC                  URD                  SS9SR                  URD                  5      SS9n	[*        R,                  R/                  S	R                  UR0                  5      5        U	$ ! [         aI  n[        R                  " SR                  UR                  [        R                   " U5      5      5      eS nAff = f)
NzKPolicy file [{0}] is not a properly formatted YAML or JSON policy file. {1})resourcesetAttestationRulesRequestz.Set attestation rules request issued for: [{}]z7iam.projects.locations.workloadIdentityPools.operations)
collectionz&Waiting for operation [{}] to completei )polleroperation_refmessagemax_wait_mszSet attestation rules for [{}].)#r   GetClientAndMessagesCONCEPTSr   Parser   	load_pathpolicy_filer   PyValueToMessageSetAttestationRulesRequestAttributeErrorgcloud_exceptionsBadFileExceptionformatsix	text_type(projects_locations_workloadIdentityPoolsr   CIamProjectsLocationsWorkloadIdentityPoolsSetAttestationRulesRequestRelativeNamer   statusPrintworkloadIdentityPoolsIdasync_r   WaitForr   &IdentityPoolOperationPollerNoResources3projects_locations_workloadIdentityPools_operationssdkresourcesREGISTRYParseRelativeNamename)
selfargsclientmessagesworkload_pool_refpolicy_to_parseset_attestation_rules_requestelro_refresults
             r(   RunSetAttestationRules.RunM   s   002F<<BBDnnT%5%56O	&.&?&?

-
-'# ==QQTT&335'D 	U 	
G JJ8??55	
 {{n^^#JJ;;FF
 #++==LLI > 
 9??M F" JJ)0055	
 M]  ..#VD$4$4cmmA6FG s   !F9 9
HAHH N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr)   rY   __static_attributes__r[   r+   r(   r   r   $   s1     ; %
- ( (,8r+   r   )$r`   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.iamr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   r
   r<    googlecloudsdk.calliope.conceptsr   googlecloudsdk.command_lib.iamr   $googlecloudsdk.command_lib.util.apisr   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   rK   r   r?   DefaultUniverseOnlyReleaseTracksReleaseTrackGAHiddenCommandr   r[   r+   r(   <module>rt      s    D &  ' % + . ( C 5 ? : D # 9 $ 
 D%%(()^$,, ^  * ^r+   