
    '                     ,   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	S
.r\R                  \R                   " \R"                  R$                  \R"                  R&                  5       " S S\R(                  5      5       5       r\\l        g)z.Create command for Colab Enterprise Schedules.    )util)	schedules)base)endpoint_util)flags)logzQ
        Create a schedule to run a Colab Enterprise notebook execution job.
    a  
      To create a schedule in region `us-central1` with the following schedule properties:
        - display name: `my-schedule`,
        - cron schedule: `TZ=America/Los_Angeles * * * * *`,
        - maximum concurrent runs allowed: 1,
        - start time: 2025-01-01T00:00:00-06:00,

      for a notebook execution job:
        - with display name `my-execution`,
        - running notebook file from Cloud Storage URI `gs://my-bucket/my-notebook.ipynb`,
        - compute configured from runtime template `my-runtime-template-id`,
        - running with service account `my-service-account@my-project.iam.gserviceaccount.com`,
        - with results uploaded to Cloud Storage bucket `gs://my-bucket/results`

      Run the following command:
        $ {command} --region=us-central1 --display-name=my-schedule --cron-schedule='TZ=America/Los_Angeles * * * * *' --max-concurrent-runs=1 --start-time=2025-01-01T00:00:00-06:00 --execution-display-name=my-execution --notebook-runtime-template=my-runtime-template-id --gcs-notebook-uri=gs://my-bucket/my-notebook.ipynb --service-account=my-service-account@my-project.iam.gserviceaccount.com --gcs-output-uri=gs://my-bucket/results
    )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)Create1   zCreate a schedule.c                 .    [         R                  " U SS9  g)zRRegister flags for this command.

Args:
  parser: argparse parser for the command
F)	is_updateN)r   AddCreateOrUpdateScheduleFlags)parsers    %lib/surface/colab/schedules/create.pyArgsCreate.Args6   s     
((5A    c                    U R                  5       n[        R                  " U R                  5       5      nUR                  R                  R                  5       nUR                  5       S   n[        R                  " SUS9   [        R                  " U5      nUR                  nUR                  [        R                  " X5      5      n[        R                  " UR                   SS9  UsSSS5        $ ! , (       d  f       g= f)zThis is what gets called when the user runs this command.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  The API response for creating the schedule.
locationsIdBETA)versionregionschedule)resourcekindN)ReleaseTrackr   GetMessagesCONCEPTSr   ParseAsDictr   AiplatformEndpointOverrides	GetClientprojects_locations_schedulesr   schedules_utilCreateScheduleCreateRequestr   CreatedResourcename)	selfargsrelease_trackmessages
region_refr   
api_clientschedules_servicer   s	            r   Run
Create.Run?   s     %%'M 1 1 34H%%++-J /F		2	2v
 >>-0j$AA"))

4
4T
Dh 
8==zB
 
 
s   A(C33
D N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r1   __static_attributes__r3   r   r   r   r   1   s      B Br   r   N)r8   'googlecloudsdk.api_lib.colab_enterpriser   (googlecloudsdk.api_lib.notebook_executorr   r&   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   ,googlecloudsdk.command_lib.notebook_executorr   googlecloudsdk.corer   _DETAILED_HELPDefaultUniverseOnlyReleaseTracksr   GAr   CreateCommandr   detailed_helpr3   r   r   <module>rG      s     5 8 P ( 7 > #	0 D%%(($*;*;*@*@A#T # B #L & r   