
                            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  \	R                  " \	R                  R                   5      \	R"                   " S
 S\	R$                  5      5       5       rg)zPCommand for creating a Cloud Security Command Center RemediationIntent resource.    )absolute_import)division)print_function)unicode_literals)sps_api)base)flags)logc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Create   z&Creates a remediation intent resource.z
        Create a Cloud Security Command Center (SCC)
        RemediationIntent resource.
        Created resource is returned as the response of the command.a  
          Sample usage:
          Create a manual workflow remediation intent resource:
          $ {{command}} scc remediation-intents create --parent=organizations/123456789/locations/global --finding-name=projects/123456789/sources/123456789/locations/global/findings/123456789 --workflow-type=manual

          Create a semi-autonomous workflow remediation intent resource:
          $ {{command}} scc remediation-intents create --parent=organizations/123456789/locations/global --workflow-type=semi-autonomous
          )DESCRIPTIONEXAMPLESc                 r   [         R                  R                  U 5        [         R                  R                  U S5        [        R
                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        U R                  R                  S5        g )NFyaml)
r   
ASYNC_FLAGAddToParser
SetDefaultr	   PARENT_NAME_FLAGFINDING_NAME_FLAGWORKFLOW_TYPE_FLAGdisplay_info	AddFormat)parsers    -lib/surface/scc/remediation_intents/create.pyArgsCreate.Args1   sx    OO'OOvu-	&&v.	''/	((0
!!&)    c                 &   [         R                  " [        R                  R                  5      n[         R
                  " [        R                  R                  5      nUR                  S:X  a!  UR                  R                  R                  nOQUR                  S:X  a!  UR                  R                  R                  nO UR                  R                  R                  nUR                  UR                  UR                  UR                  US9S9nUR                  R!                  US9nUR"                  nUR$                  (       a"  [&        R(                  R+                  SU5        U$ [         R,                  " [         R.                  " U5      SSS	9$ )
zThe 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 either resource or error.
zsemi-autonomousmanual)findingNameworkflowType)parentcreateRemediationIntentRequest)requestz9Check for operation completion status using operation ID:z,Waiting for remediation intent to be createdT)operation_refmessage
has_result)r   GetClientInstancer   ReleaseTrackALPHAGetMessagesModuleworkflow_typeCreateRemediationIntentRequestWorkflowTypeValueValuesEnumWORKFLOW_TYPE_SEMI_AUTONOMOUSWORKFLOW_TYPE_MANUALWORKFLOW_TYPE_UNSPECIFIEDDSecuritypostureOrganizationsLocationsRemediationIntentsCreateRequestr#   finding_name*organizations_locations_remediationIntentsr   nameasync_r
   statusPrintWaitForOperationGetOperationsRef)selfargsclientmessagesr-   r%   	operationoperation_ids           r   Run
Create.Run:   sf    &&t'8'8'>'>?F(():):)@)@AH ..

1
1
M
M
k
k  
		x	'

1
1
M
M
b
b 
 
1
1
M
M
g
g 
 [[{{'/'N'N))& (O (
 \ G AAHH I I >>L{{	jj
E
 %%00>@ r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   rB   __static_attributes__rD   r   r   r   r      s2     /H
-  * *3r   r   N)rI   
__future__r   r   r   r   .googlecloudsdk.api_lib.scc.remediation_intentsr   googlecloudsdk.callioper   2googlecloudsdk.command_lib.scc.remediation_intentsr	   googlecloudsdk.corer
   ReleaseTracksr*   r+   UniverseCompatibleCreateCommandr   rD   r   r   <module>rU      sl    W &  % ' B ( D # D%%++,OT O  -Or   