
    l                         d Z ddlmZ ddlmZ ddlmZ ddl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                    G d dej"                               Zy)z&Command to create a new investigation.    )absolute_import)division)unicode_literalsN)args)util)arg_parsers)base)timesc                   &    e Zd ZdZed        Zd Zy)CreateaV  Update an existing investigation.

  Shows metadata for the investigation after updating.

  This command can fail for the following reasons:
  * The investigation ID doesn't exist.
  * The active account does not have permission to update the investigation.
  * The investigation is currently running.

  ## EXAMPLES

  The following command updates title, text description, resources, and start
  time of the existing investigation with the name`example-foo-bar-1`:

    $ {command} example-foo-bar-1 --title="Example Investigation" \
        --issue="I have a problem" --start-time=2025-07-10
  c                    t        j                  | ddd       | j                  j                  d       | j	                  ddd       | j                  d	      }|j	                  d
dt        j                  d       |j	                  dddd       | j                  d	      }|j	                  ddt        j                  d       |j	                  dddd       | j                  d	      }|j	                  ddd       |j	                  dddd       | j                  d	      }|j	                  dddt        j                         d       |j	                  dddd       y )Nz	to updateTF)verbrequiredallow_no_idz(value(investigation_markdown_detailed())z--issuezBA description of the issue you are investigating, or an error log.)r   help)	sort_argsz--start-timez<The estimated start time of the issue you are investigating.)r   typer   z--clear-start-time
store_truez*Clear the start time of the investigation.)r   actionr   z
--end-timez:The estimated end time of the issue you are investigating.z--clear-end-timez(Clear the end time of the investigation.z--titlez1The desired title of the resulting investigation.z--clear-titlez%Clear the title of the investigation.z--resourcesRESOURCEz1A list of resources relevant to the investigation)r   metavarr   r   z--clear-resourcesz)Clear the resources of the investigation.)
gca_argsAddInvestigationResourceArgdisplay_info	AddFormatadd_argumentadd_mutually_exclusive_groupr
   ParseDateTimer   ArgList)parserstart_time_groupend_time_grouptitle_groupresources_groups        8lib/surface/gemini/cloud_assist/investigations/update.pyArgszCreate.Args3   s   (([4U !!"LM
P	   ::U:K!!  K	 "  !!9	 "  8858IN  I	    7	    555FK@  
 4	   99E9JO    "@ !    8	 !     c                    |j                   j                  j                         }t        j                  ||j
                  rdn|j                  |j                  |j                  rt        j                  j                  n|j                  |j                  rt        j                  j                  n|j                  |j                  rg n|j                         }t        j"                  |j$                        S )N )CONCEPTSinvestigationParsegca_utilUpdateInvestigationclear_titletitleissueclear_start_timedatetimemin
start_timeclear_end_timemaxend_timeclear_resources	resources RunInvestigationRevisionBlockingrevision)selfr   investigation_refupdated_investigations       r%   Runz
Create.Runy   s    3399;$88DJJ

!%!6!6DOO!%!4!4$--"" 44&& r'   N)__name__
__module____qualname____doc__staticmethodr&   r@    r'   r%   r   r      s#    $ C CJr'   r   )rD   
__future__r   r   r   r3   *googlecloudsdk.api_lib.gemini_cloud_assistr   r   r   r-   googlecloudsdk.callioper   r	   googlecloudsdk.core.utilr
   DefaultUniverseOnlyCommandr   rF   r'   r%   <module>rM      sM     - &  '  G G / ( * eT\\ e er'   