
                         P   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	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ e
j.                   e
j0                  e
j2                  j4                        e
j6                   G d de
j8                                             Zy)zBCommand to remove an attestation rule on a workload identity pool.    )absolute_import)division)unicode_literals)util)waiter)base)concepts)identity_pool_waiter)	yaml_data)concept_parsers)log)	resourcesc                   0    e Zd ZdZdddZed        Zd Zy)RemoveAttestationRulez7Remove an attestation rule on a workload identity pool.z{description}a,            The following command removes an attestation rule with a Google Cloud
          resource on a workload identity pool `my-pool`.

            $ {command} my-pool             --location="global"             --google-cloud-resource="//run.googleapis.com/projects/123/type/Service/*"
          )DESCRIPTIONEXAMPLESc                 f   t         j                  j                  d      }t        j                  j                  dt        j                  j                  |j                         d      dd      j                  |        | j                  ddd	       t        j                  j                  |        y )
Nziam.workload_identity_poolworkload_identity_poolT)is_positionalz=The workload identity pool to remove the attestation rule on.)requiredz--google-cloud-resourcezrA single workload operating on Google Cloud. This will be set
                in the attestation rule to be added.)helpr   )r   ResourceYAMLDataFromPathr   ConceptParserForResourcer	   ResourceSpecFromYamlGetDataAddToParseradd_argumentr   
ASYNC_FLAG)parserworkload_pool_datas     Blib/surface/iam/workload_identity_pools/remove_attestation_rule.pyArgszRemoveAttestationRule.Args2   s    "33<<$ !!-- &&&&( 	' 	
 	H .  k&
!8	   	OO'    c                 J   t        j                         \  }}|j                  j                  j	                         }|j                  |j                  |j                              }|j                  j                  |j                  |j                         |            }t        j                  j                  dj                  |j                                |j"                  r|S t%        j&                  t)        j*                  |j                  |j,                        t.        j0                  j3                  |j4                  d      dj                  |j4                        d	      }t        j                  j                  d
j                  |j                                |S )N)googleCloudResource)attestationRule)resourceremoveAttestationRuleRequestz0Remove attestation rule request issued for: [{}]z7iam.projects.locations.workloadIdentityPools.operations)
collectionz&Waiting for operation [{}] to completei )polleroperation_refmessagemax_wait_msz"Removed attestation rule for [{}].)r   GetClientAndMessagesCONCEPTSr   ParseRemoveAttestationRuleRequestAttestationRulegoogle_cloud_resource(projects_locations_workloadIdentityPoolsr   EIamProjectsLocationsWorkloadIdentityPoolsRemoveAttestationRuleRequestRelativeNamer   statusPrintformatworkloadIdentityPoolsIdasync_r   WaitForr
   &IdentityPoolOperationPollerNoResources3projects_locations_workloadIdentityPools_operationssdkresourcesREGISTRYParseRelativeNamename)selfargsclientmessagesworkload_pool_refremove_attestation_rule_requestlro_refresults           r$   RunzRemoveAttestationRule.RunG   ss   002FH<<BBD&.&K&K 00 $ : : 1 
 'L '# ==SSVV&335)H 	W 	
G JJ:AA55	
 {{n^^#JJ;;FF
 #++==LLI > 
 9??M F" JJ,3355	
 Mr&   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr%   rN    r&   r$   r   r       s2     @ %
- ( ((1r&   r   N)rR   
__future__r   r   r   googlecloudsdk.api_lib.iamr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr	   googlecloudsdk.command_lib.iamr
   $googlecloudsdk.command_lib.util.apisr   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   rB   DefaultUniverseOnlyReleaseTracksReleaseTrackGAHiddenCommandr   rU   r&   r$   <module>re      s    I &  ' + . ( 5 ? : D # 9 D%%(()UDLL U  * Ur&   