
    _*                        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  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(                  R0                  5       " S S\5      5       r\
R&                  " \
R(                  R4                  5       " S S\5      5       rg)z/Command for compute future reservations update.    )absolute_import)division)unicode_literals)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.Args1   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      r1   _ValidateArgsUpdateV1._ValidateArgsI   s0      oB //
K E r5   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)r9   ,)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getattrr;   r   $MakeFutureReservationMessageFromArgsrE   rB   rD   &ComputeFutureReservationsUpdateRequestNamerj   joinrl   listr   MakeRequestsro   rp   r   RaiseToolException)r8   argsholderrt   ru   fr_refrx   servicer9   rc   fr_resourcefr_update_requestrq   results                 r1   RunUpdateV1.Runv   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&Mr5    )__name__
__module____qualname____firstlineno____doc__r*   detailed_helpclassmethodr2   r;   r   __static_attributes__r   r5   r1   r   r      s=     3& -  .+Znr5   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     r1   r2   UpdateBeta.Args   r4   r5   r   
r   r   r   r   r   r*   r   r   r2   r   r   r5   r1   r   r      -    2&   -  r5   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     r1   r2   UpdateAlpha.Args  sn    //*!5&@@CJ JJ6(; $ $" -1%)r5   r   r   r   r5   r1   r   r     r   r5   r   N)r   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r   googlecloudsdk.callioper	   r
   "googlecloudsdk.command_lib.computer   r'   6googlecloudsdk.command_lib.compute.future_reservationsr,   r   DefaultUniverseOnlyReleaseTracksrs   GAUpdateCommandr   BETAr   ALPHAr   r   r5   r1   <module>r      s    6 &  ' 7 9 0 ( . E T G D%%(()Bt!! B  * BJ D%%**+" " ,"J D%%++,"* " -"r5   