
                            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rSS jr\R(                  " S\S9\R*                  " \R,                  R.                  5      \R0                   " S S\R2                  5      5       5       5       r\R(                  " S\S9\R*                  " \R,                  R6                  5       " S S\5      5       5       rSSS.\l        g)zCreate resource policy command.    )absolute_import)division)unicode_literals)base_classes)utils)apis)base)flags)utilzm
`create-snapshot-schedule` is deprecated.
Use `compute resource-policies create snapshot-schedule` instead.
Fc           	      <   [         R                  " SU5      n[        R                  " 5       R	                  U 5        [        R
                  " U 5        [        R                  " U SSSSSS9  [        R                  " XU5        U R                  R                  S5        g)z?A helper function to build args based on different API version.computescheduleziStart time for the disk snapshot schedule. See $ gcloud topic datetimes for information on time formats.
zSnapshot scheduleT)flag_suffixstart_time_helpcadence_helpsupports_weeklysupports_hourlyN)
r   GetMessagesModuler
   MakeResourcePolicyArgAddArgumentAddCommonArgsAddCycleFrequencyArgsAddSnapshotScheduleArgsdisplay_infoAddCacheUpdater)parserapi_versionsupport_snapshot_regionmessagess       Alib/surface/compute/resource_policies/create_snapshot_schedule.py_CommonArgsr!   #   s    ##I{;(++F3f ' 2IJ%%d+    )
is_removedwarningc                   8    \ rS rSrSr\S 5       rS rSS jrSr	g)	CreateSnapshotScheduleBeta5   Create a Compute Engine Snapshot Schedule Resource Policy.

*{command} creates a Resource Policy which can be attached to disks and
specifies a schedule for taking disk snapshots and how long these snapshots
should be retained.
c                 6    [        U [        R                  SS9  g NT)r   r   )r!   compute_apiCOMPUTE_BETA_API_VERSIONr   s    r    ArgsCreateSnapshotScheduleBeta.Args@   s    88 $r"   c                 "    U R                  USS9$ )NT)r   )_Run)selfargss     r    RunCreateSnapshotScheduleBeta.RunH   s    99T4988r"   c                    [         R                  " U R                  5       5      nUR                  n[        R
                  " 5       R                  UUR                  [        R                  " UR                  5      S9nUR                  R                  n[        R                  " XQXb5      nUR                  UUR                  UR                  S9nUR                  R                   R"                  n	UR%                  U	SU4/5      S   $ )N)scope_lister)resourcePolicyprojectregionInsertr   )r   ComputeApiHolderReleaseTrackclientr
   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   r   MakeDiskSnapshotSchedulePolicy$ComputeResourcePoliciesInsertRequestr9   r:   apitools_clientresourcePoliciesMakeRequests)
r2   r3   r   holderr>   
policy_refr   resource_policycreate_requestservices
             r    r1   CreateSnapshotScheduleBeta._RunK   s    **4+<+<+>?F]]F,,.@@"88G A IJ
 }}%%H99(=OBB&""   C "N
 mm++<<G(N CDEaHHr"    NF)
__name__
__module____qualname____firstlineno____doc__staticmethodr.   r4   r1   __static_attributes__rN   r"   r    r&   r&   5   s&      9Ir"   r&   c                   (    \ rS rSrSr\S 5       rSrg)CreateSnapshotScheduleAlpha`   r(   c                 6    [        U [        R                  SS9  g r*   )r!   r+   COMPUTE_ALPHA_API_VERSIONr-   s    r    r.    CreateSnapshotScheduleAlpha.Argsj   s    99 $&r"   rN   N)rP   rQ   rR   rS   rT   rU   r.   rV   rN   r"   r    rX   rX   `   s     & &r"   rX   z;Create a Compute Engine Snapshot Schedule Resource Policy.
zThe following command creates a Compute Engine Snapshot Schedule Resource Policy with a daily snapshot and a one day snapshot retention policy.

  $ {command} my-resource-policy --region=REGION --start-time=04:00Z --daily-schedule --max-retention-days=1
)DESCRIPTIONEXAMPLESNrO   )rT   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r+   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   rA   4googlecloudsdk.command_lib.compute.resource_policiesr   _DEPRECATION_WARNINGr!   	DeprecateReleaseTracksr=   BETAUniverseCompatibleCreateCommandr&   ALPHArX   detailed_helprN   r"   r    <module>rm      s    & &  ' 7 ? , ( E F E ,$ 5*>?D%%**+%I!3!3 %I  , @%IP 5*>?D%%++,&"< & - @&$		,  (r"   