
    }                        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S.r\R                  \R                   " \R"                  R$                  5       " S S\R&                  5      5       5       r\\l        g)z?'Bare Metal Solution snapshot schedule policies update command.    )absolute_import)division)unicode_literals)	BmsClient)base)
exceptions)flags)labels_utilzJ
          Update a Bare Metal Solution snapshot schedule policy.
        a  
          To update an existing policy called ``my-policy'' with new description
          ``my-description'' and replace any existing schedules with one
          that runs every 12 hours, run:

          $ {command} my-policy --description=my-description --schedule="crontab_spec=0 */12 * * *,retention_count=10,prefix=example"

          To add the label 'key1=value1' to a policy, run:

          $ {command} my-policy --update-labels=key1=value1

          To clear all labels, run:

          $ {command} my-policy --clear-labels
    )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)Update4   z6Create a Bare Metal Solution snapshot schedule policy.c                     [         R                  " U SS9  [         R                  " U SS9  [        R                  " U 5        U R                  SSS9  g)	z Register flags for this command.T)
positionalF)requiredz--descriptionz"Textual description of the policy.)helpN)r	   $AddSnapshotSchedulePolicyArgToParser"AddSnapshotScheduleArgListToParserr
   AddUpdateLabelsFlagsadd_argument)parsers    4lib/surface/bms/snapshot_schedule_policies/update.pyArgsUpdate.Args9   sK     
..v$G	,,VeD$$V,
A  C    c                 B   [        5       nUR                  R                  R                  5       nUR                  nUR
                  nS n[        R                  R                  U5      nUR                  5       (       aY  UR                  U5      nUR                  UR                  R                  R                  UR                  5      R!                  5       nU(       d2  U(       d+  UR                  5       (       d  ["        R$                  " S5      eUR'                  UUUUS9$ )NzNo configuration change was requested. Did you mean to include the flags `--description` `--schedule` `--update-labels``--remove-labels` or `--clear-labels`?)policy_resourcelabelsdescription	schedules)r   CONCEPTSsnapshot_schedule_policyParser    scheduler
   DiffFromUpdateArgsMayHaveUpdatesGetSnapshotSchedulePolicyApplymessagesSnapshotSchedulePolicyLabelsValuer   	GetOrNoner   NoConfigurationChangeErrorUpdateSnapshotSchedulePolicy)	selfargsclientpolicyr    r!   labels_updatelabels_difforig_resources	            r   Run
Update.RunB   s    [F]]3399;F""KIM""11$7K!!##66v>m!''
//
0
0
<
<


  )	  y1K1K1M1M1134 4
 ..v6C;F9B / D Dr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r8   __static_attributes__r:   r   r   r   r   4   s!     ?C CDr   r   N)r?   
__future__r   r   r   %googlecloudsdk.api_lib.bms.bms_clientr   googlecloudsdk.callioper   googlecloudsdk.command_lib.bmsr   r	   $googlecloudsdk.command_lib.util.argsr
   DETAILED_HELPHiddenReleaseTracksReleaseTrackALPHAUpdateCommandr   detailed_helpr:   r   r   <module>rN      s    F &  ' ; ( 5 0 <
		0 D%%++,"DT "D - "DH % r   