
                            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  e	j                  e	j                  j                         e	j"                   G d
 de	j$                                      Zy)zPCommand for deleting a Cloud Security Command Center RemediationIntent resource.    )absolute_import)division)print_function)unicode_literals)sps_api)base)flags)logc                   0    e Zd ZdZdddZed        Zd Zy)Deletez&Deletes a remediation intent resource.zZ
        Deletes a Cloud Security Command Center (SCC)
        RemediationIntent resource.a  
          Sample usage:
          Delete a remediation intent resource of name organizations/123456789/locations/global/remediationIntents/123:
          $ {{command}} scc remediation-intents delete organizations/123456789/locations/global/remediationIntents/123
          )DESCRIPTIONEXAMPLESc                     t         j                  j                  |        t         j                  j                  | d       t        j
                  j                  |        t	        j                  |        y )NF)r   
ASYNC_FLAGAddToParser
SetDefaultr	   	ETAG_FLAGAddRemediationIntentResourceArg)parsers    -lib/surface/scc/remediation_intents/delete.pyArgszDelete.Args-   sH    OO'OOvu-	OO'	))&1    c                 Z   t        j                  t        j                  j                        }t        j
                  t        j                  j                        }|j                  j                  j                         }|j                         }|j                  ||j                        }|j                  j                  |      }|j                  }|j                  r"t         j"                  j%                  d|       |S t        j&                  t        j(                  |      dd      S )a  The main function which is called when the user runs this command.

    Args:
      args: An argparse namespace. All the arguments that were provided to this
        command invocation.
    Returns:
      Operation resource containing success or error.
    )nameetag)requestz9Check for operation completion status using operation ID:z,Waiting for remediation intent to be deletedF)operation_refmessage
has_result)r   GetClientInstancer   ReleaseTrackALPHAGetMessagesModuleCONCEPTSremediationintentParseRelativeNameDSecuritypostureOrganizationsLocationsRemediationIntentsDeleteRequestr   *organizations_locations_remediationIntentsr   r   async_r
   statusPrintWaitForOperationGetOperationsRef)	selfargsclientmessagesri_refri_namer   	operationoperation_ids	            r   Runz
Delete.Run4   s     &&t'8'8'>'>?F(():):)@)@AH ]],,224F!!#G[[YY \ G
 AAHH I I >>L{{	jj
E
 %%00>@ r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r7    r   r   r   r      s1     /'
- 2 2%r   r   N)r;   
__future__r   r   r   r   .googlecloudsdk.api_lib.scc.remediation_intentsr   googlecloudsdk.callioper   2googlecloudsdk.command_lib.scc.remediation_intentsr	   googlecloudsdk.corer
   ReleaseTracksr!   r"   UniverseCompatibleDeleteCommandr   r>   r   r   <module>rG      sk    W &  % ' B ( D # D%%++,;T ;  -;r   