
    )                        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                   R"                  5      \R                   " S	 S
\R$                  5      5       5       5       r\R                  " \R                   R(                  5       " S S\5      5       r\R                  " \R                   R,                  5       " S S\5      5       rg)z/Command for compute future reservations update.    )base_classes)request_helper)utils)base)
exceptions)flags)utilc                   @    \ rS rSrSrSrSS0r\S 5       rS r	S r
S	rg)
UpdateV1   *Update Compute Engine future reservations.NEXAMPLES   
        To update total count, start and end time of a Compute Engine future reservation in ``us-central1-a'', run:

            $ {command} my-future-reservation --total-count=1000 --start-time=2021-11-10T07:00:00Z
          --end-time=2021-12-10T07:00:00Z --zone=us-central1-a
        c                     [         R                  " SSSS[         R                  S9U l        U R                  R	                  USS9  [
        R                  " USSSSSSSSSS	9
  g 
Nzfuture reservationFFUTURE_RESERVATIONzcompute.futureReservations)resource_namepluralnamezonal_collectionzone_explanationupdate)operation_typeT)	support_fleetsupport_planning_statussupport_local_ssd_countsupport_share_settingsupport_auto_delete$support_require_specific_reservationsupport_gscsupport_cudssupport_emergent_maintenancecompute_flagsResourceArgumentZONE_PROPERTY_EXPLANATIONfr_argAddArgumentfr_flagsAddUpdateFlagsclsparsers     1lib/surface/compute/future_reservations/update.pyArgsUpdateV1.Args.   n    //*!5&@@CJ JJ6(; $ $" -1%)    c                 H    U(       d  / SQn[         R                  " US5      eg)zmValidates that at least one field to update is specified.

Args:
  update_mask: The arguments being updated.
)z--planning-statusz--descriptionz--name-prefixz--total-countz--min-cpu-platformz--local-ssdz--clear-local-ssdz--acceleratorz--clear-acceleratorz--maintenance-intervalz--start-timez
--end-timez
--durationz--machine-typez--share-settingz--share-withz--clear-share-settingsz'--auto-delete-auto-created-reservationsz*--no-auto-delete-auto-created-reservationsz'--auto-created-reservations-delete-timez$--auto-created-reservations-durationz--require-specific-reservationz!--no-require-specific-reservationz--reservation-namez--deployment-typez--commitment-namez--commitment-planz--previous-commitment-termsz--scheduling-typez--enable-emergent-maintenancez --no-enable-emergent-maintenancez.Please specify at least one property to updateN)r   MinimumArgumentException)selfupdate_maskparameter_namess      r.   _ValidateArgsUpdateV1._ValidateArgsF   s0      oB //
K E r2   c           	         [         R                  " U R                  5       5      nUR                  nUR                  nU R
                  R                  UU[        R                  " U5      S9nUR                  R                  nUR                  R                  R                  n/ nUR                  S5      (       a  UR                  S5        UR                  S5      (       a  UR                  S5        UR                  S5      (       d  UR                  S5      (       a  UR                  S5        UR                  S	5      (       a  UR                  S	5        UR                  S
5      (       a  UR                  S5        UR                  S5      (       a  UR                  S5        UR                  S5      (       d  UR                  S5      (       a  UR                  S5        UR                  S5      (       d  UR                  S5      (       a  UR                  S5        [        US5      (       a'  UR                  S5      (       a  UR                  S5        UR                  S5      (       a  UR                  S5        UR                  S5      (       a  UR                  S5        UR                  S5      (       a  UR                  S5        UR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a  UR                  S5        UR                  S 5      (       a  UR                  S!5        UR                  S"5      (       a  UR                  S#5        UR                  S$5      (       a  UR                  S%5        UR                  S&5      (       a  UR                  S'5        UR                  S(5      (       a  UR                  S)5        UR                  S*5      (       a  UR                  S+5        UR                  S,5      (       a  UR                  S-5        UR                  S.5      (       a  UR                  S/5        UR                  S05      (       a  UR                  S15        [!        US2S 5      n	U	b  UR                  S35        UR                  S45      (       a  UR                  S55        U R#                  US69  [$        R&                  " XdX5      n
UR(                  U
l        UR*                  U
l        UR/                  UR1                  5       U
UR2                  S7R5                  U5      UR6                  S89n/ n[9        [:        R<                  " US9U4/UR                  R                  R>                  UR                  R@                  US:95      nU(       a  [B        RD                  " U5        U$ );N)scope_listerplanning_statusplanningStatustotal_countz specificSkuProperties.totalCountname_prefixclear_name_prefix
namePrefixdescriptionmin_cpu_platformz7specificSkuProperties.instanceProperties.minCpuPlatformmachine_typez4specificSkuProperties.instanceProperties.machineTypeacceleratorclear_acceleratorz9specificSkuProperties.instanceProperties.guestAccelerator	local_ssdclear_local_ssdz1specificSkuProperties.instanceProperties.localSsdmaintenance_intervalz;specificSkuProperties.intanceProperties.maintenanceInterval
start_timeztimeWindow.startTimeend_timeztimeWindow.endTimedurationztimeWindow.durationclear_share_settingsshare_setting
share_withshareSettings%auto_delete_auto_created_reservations!autoDeleteAutoCreatedReservations%auto_created_reservations_delete_time!autoCreatedReservationsDeleteTime"auto_created_reservations_durationautoCreatedReservationsDurationreservation_namereservationNamedeployment_typedeploymentTypecommitment_namezcommitmentInfo.commitmentNamecommitment_planzcommitmentInfo.commitmentPlanprevious_commitment_termsz&commitmentInfo.previousCommitmentTermsscheduling_typeschedulingTyperequire_specific_reservationspecificReservationRequiredenable_emergent_maintenanceenableEmergentMaintenance)r6   ,)futureReservationfutureReservationResourceproject
updateMaskzoneUpdate)requestshttp	batch_urlerrors)#r   ComputeApiHolderReleaseTrackclient	resourcesr'   ResolveAsResourcer$   GetDefaultScopeListermessagesapitools_clientfutureReservationsIsSpecifiedappendhasattrIsKnownAndSpecifiedgetattrr8   r	   $MakeFutureReservationMessageFromArgsrB   r?   rA   &ComputeFutureReservationsUpdateRequestNamerg   joinri   listr   MakeRequestsrl   rm   r   RaiseToolException)r5   argsholderrq   rr   fr_refru   servicer6   r`   fr_resourcefr_update_requestrn   results                 r.   RunUpdateV1.Runs   s    **4+<+<+>?F]]F  I[[**"88@ + BF
 }}%%Hmm++>>G K)**)*&&;<&&$*:*:;N*O*O&&&'*++
C ''OP&&$*:*:;N*O*O
E $$(8(89J(K(KLMt+,,1A1A2 2 
G %%/0
##-.
##./ 	/00O,,L)))?@@<=?@@<=<==:; 233*+ 122)* 12289 12289 ;<<AB 122)*#*,d$  $/67 =>>45;/;;TK #..K!--K !GG ++-"-88K([[ H  F##*;<=..33mm--		F v&Mr2    )__name__
__module____qualname____firstlineno____doc__r'   detailed_helpclassmethodr/   r8   r   __static_attributes__r   r2   r.   r   r      s=     3& -  .+Znr2   r   c                   4    \ rS rSrSrSrSS0r\S 5       rSr	g)
UpdateBeta   r   Nr   r   c                     [         R                  " SSSS[         R                  S9U l        U R                  R	                  USS9  [
        R                  " USSSSSSSSSS	9
  g r   r#   r+   s     r.   r/   UpdateBeta.Args   r1   r2   r   
r   r   r   r   r   r'   r   r   r/   r   r   r2   r.   r   r      -    2&   -  r2   r   c                   4    \ rS rSrSrSrSS0r\S 5       rSr	g)UpdateAlphai
  r   Nr   r   c                     [         R                  " SSSS[         R                  S9U l        U R                  R	                  USS9  [
        R                  " USSSSSSSSSS	9
  g r   r#   r+   s     r.   r/   UpdateAlpha.Args  sn    //*!5&@@CJ JJ6(; $ $" -1%)r2   r   r   r   r2   r.   r   r   
  r   r2   r   N)r   googlecloudsdk.api_lib.computer   r   r   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   r$   6googlecloudsdk.command_lib.compute.future_reservationsr)   r	   DefaultUniverseOnlyReleaseTracksrp   GAUpdateCommandr   BETAr   ALPHAr   r   r2   r.   <module>r      s    6 8 9 0 ( . E T G D%%(()Bt!! B  * BJ D%%**+" " ,"J D%%++,"* " -"r2   