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

  Shows metadata for the newly created investigation after creation.

  This command can fail for the following reasons:
  * The chosen investigation ID, if specified, already exists.
  * The active account does not have permission to create investigations in the
  project.

  ## EXAMPLES

  The following command creates a new investigation with the ID and some basic
  information
  `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	dt
        j                  d
       | j	                  ddt
        j                  d       | j	                  ddd       | j	                  dddt        j                         d       y )Nz	to createFT)verbrequiredallow_no_idz(value(investigation_markdown_detailed())z--issuezBA description of the issue you are investigating, or an error log.)r   helpz--start-timez<The estimated start time of the issue you are investigating.)r   typer   z
--end-timez:The estimated end time of the issue you are investigating.z--titlez1The desired title of the resulting investigation.z--resourcesRESOURCEz1A list of resources relevant to the investigation)r   metavarr   r   )	gca_argsAddInvestigationResourceArgdisplay_info	AddFormatadd_argumentr
   ParseDateTimer   ArgList)parsers    8lib/surface/gemini/cloud_assist/investigations/create.pyArgszCreate.Args2   s    (([5d !!"LM
P	     K	     I	   @  
   "@      c                     |j                   j                  j                         }t        j                  ||j
                  |j                  |j                  |j                  |j                        }t        j                  |j                        S )N)CONCEPTSinvestigationParsegca_utilCreateInvestigationtitleissue
start_timeend_time	resources RunInvestigationRevisionBlockingrevision)selfr   investigation_refcreated_investigations       r   Runz
Create.RunX   sp    3399;$88



 44&& r   N)__name__
__module____qualname____doc__staticmethodr   r0    r   r   r   r      s!    & # #Jr   r   N)r4   
__future__r   r   r   *googlecloudsdk.api_lib.gemini_cloud_assistr   r   r   r$   googlecloudsdk.callioper   r	   googlecloudsdk.core.utilr
   DefaultUniverseOnlyCommandr   r6   r   r   <module>r=      sJ     - &  ' G G / ( * FT\\ F Fr   