
    _                        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                  R"                  5       " S	 S
\R$                  5      5       rg)zDCommand for updating the reservations in Compute Engine commitments.    )absolute_import)division)unicode_literals)base_classes)base)flags)reservation_helperc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	UpdateReservationsAlpha   z@Update the resource shape of reservations within the commitment.EXAMPLESa  
        To update reservations of the commitment called ``commitment-1'' in
        the ``us-central1'' region with values from ``reservations.yaml'', run:

          $ {command} commitment-1 --reservations-from-file=reservations.yaml

        For detailed examples, please refer to [](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources#modifying_reservations_that_are_attached_to_commitments)
      c                 x    [         R                  " S5      R                  U SS9  [         R                  " U 5        g )NFzupdate reservation)operation_type)r   MakeCommitmentArgAddArgumentAddUpdateReservationGroup)parsers    6lib/surface/compute/commitments/update_reservations.pyArgsUpdateReservationsAlpha.Args*   s4    	E"..3 / 5	##F+    c                 
   [         R                  " U R                  5       5      nUR                  nUR                  n[
        R                  " S5      R                  UU[        R                  " U5      S9nUR                  R                  nUR                  nUR                  [        R                  " XU5      S9nUR!                  UR#                  5       UR$                  UR&                  US9n	UR)                  USU	4/5      $ )NF)scope_lister)reservations)
commitmentprojectregion*regionCommitmentsUpdateReservationsRequestUpdateReservations)r   ComputeApiHolderReleaseTrackclient	resourcesr   r   ResolveAsResourcecompute_flagsGetDefaultScopeListerapitools_clientregionCommitmentsmessages*RegionCommitmentsUpdateReservationsRequestr	   MakeUpdateReservations1ComputeRegionCommitmentsUpdateReservationsRequestNamer   r   MakeRequests)
selfargsholderr"   r#   commitment_refservicer)   update_reservation_requestrequests
             r   RunUpdateReservationsAlpha.Run0   s   **4+<+<+>?F]]F  I,,U3EE"88@ F BN $$66GH!)!T!T'>>I' "U "( HH!&&(&&$$3M	 I OG
 *> HIJJr    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r6   __static_attributes__r8   r   r   r   r      s.    H 
	- , ,
Kr   r   N)r=   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r%   .googlecloudsdk.command_lib.compute.commitmentsr	   ReleaseTracksr!   ALPHABETAUpdateCommandr   r8   r   r   <module>rJ      sm    K &  ' 7 ( E @ M D%%++T->->-C-CD%Kd00 %K E%Kr   