
                            S r SSK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&                  4S jrS\R*                  4S jr\R.                  " \R0                  R2                  5      \R4                   " S S\R6                  5      5       5       r\R.                  " \R0                  R:                  5       " S S\5      5       rg)z%Creates a Backup and DR Backup Vault.    N)
exceptions)util)BackupVaultsClient)base)flags)labels_util)logparserc                    [         R                  " U S5        [         R                  " U 5        [         R                  " U S5        [         R                  " U 5        [         R
                  " U 5        [         R                  " U 5        [         R                  " U S5        [         R                  " U 5        [         R                  " U 5        g)mSpecifies additional command flags.

Args:
  parser: argparse.Parser: Parser object for command line inputs.
zName of the backup vault to create.  A vault name cannot be changed after creation. It must be between 3-63 characters long and must be unique within the project and location.TcreateN)
r   AddBackupVaultResourceArgAddNoAsyncFlagAddEnforcedRetentionAddDescriptionAddEffectiveTime	AddLabels'AddBackupVaultAccessRestrictionEnumFlagAddBackupRetentionInheritance	AddKmsKeyr
   s    -lib/surface/backup_dr/backup_vaults/create.py_add_common_argsr      s     !!1 vVT*v //&//A%%f-//&    argsc                 
   [        5       nU R                  R                  R                  5       n[        R
                  " U R                  5      nU R                  n[        R                  " U R                  S5      n[        R                  " XR                  R                  R                  5      nU R                  nU R                   nU R"                  n	UR                  R%                  U R&                  S9n
 UR)                  UUUUUUU	U
S9nU(       aa  UR7                  UR9                  U5      SR;                  UR=                  5       5      S9n[>        R@                  " UR=                  5       SS9  U$ [>        R@                  " UR=                  5       SS	[2        RB                  R;                  URD                  5      S
9  U$ ! [*        R,                   a*  n[.        R0                  " U[2        R4                  5      eSnAff = f)Constructs and sends request.

Args:
  args: argparse.Namespace, An object that contains the values for the
    arguments specified in the .Args() method.

Returns:
  ProcessHttpResponse of the request made.
zeffective-time)
kmsKeyName)backup_retention_inheritanceencryption_configNzHCreating backup vault [{}]. (This operation could take up to 2 minutes.))operation_refmessagezbackup vault)kindT)r#   is_asyncdetails)#r   CONCEPTSbackup_vaultParsecommand_utilConvertIntToStrbackup_min_enforced_retentiondescriptionVerifyDateInFutureeffective_timer   ParseCreateArgsmessagesBackupVaultLabelsValueno_asyncaccess_restrictionr   EncryptionConfigkms_keyCreateapitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATWaitForOperationGetOperationRefformatRelativeNamer	   CreatedResourceASYNC_OPERATION_MESSAGEname)r   clientr'   r+   r,   r.   labelsr3   r4   r   r    	operationeresources                 r   _runrH   4   s    &++113,".">">
((#   +22
+. &&
OO''33& ]](..!%!B!B oo&&$,,&? >%%A+  	I &&,,Y7&&,f\-F-F-H&I	 ' H 113.IO!**11)..A	 
) 
	&	& >

"
"1d&<&<
==>s   8G H%G==Hc                   t    \ rS rSrSrSSSSS.r\S\R                  4S	 j5       r	S
\R                  4S jrSrg)r7   v   $Create a Backup and DR backup vault.z%Creates a Backup and DR backup vault.z{description}zThis command uses the backupdr/v1 API. The full documentation for this API can be found at: https://cloud.google.com/backup-disaster-recoverya          To create a new backup vault ``BACKUP_VAULT'' in location ``MY_LOCATION'' with
        minimum enforced-retention for backups of 1 month and 1 day, run:

        $ {command} BACKUP_VAULT --location=MY_LOCATION             --backup-min-enforced-retention="p1m1d"

        To create a new backup vault ``BACKUP_VAULT'' in location ``MY_LOCATION'' with
        minimum enforced-retention for backups of 1 day and description ``DESCRIPTION'',
        run:

        $ {command} BACKUP_VAULT --location=MY_LOCATION             --backup-min-enforced-retention="1d" --description=DESCRIPTION

        To create a new backup vault ``BACKUP_VAULT'' in location ``MY_LOCATION'' with
        minimum enforced-retention for backups of 1 day and label key1 with value value1,
        run:

        $ {command} BACKUP_VAULT --location=MY_LOCATION             --backup-min-enforced-retention="1d" --labels=key1=value1

        To create a new backup vault ``BACKUP_VAULT'' in location ``MY_LOCATION'' with
        minimum enforced-retention for backups of 1 day and effective-time "2024-03-22",
        run:

        $ {command} BACKUP_VAULT --location=MY_LOCATION             --backup-min-enforced-retention="1d" --effective-time="2024-03-22"
        )BRIEFDESCRIPTIONzAPI REFERENCEEXAMPLESr
   c                     [        U 5        gr   Nr   r   s    r   ArgsCreate.Args        Vr   r   c                     [        U5      $ r   rH   selfr   s     r   Run
Create.Run         r    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodargparseArgumentParserrR   	NamespacerZ   __static_attributes__r]   r   r   r7   r7   v   sT     - 7$?$-L 8**  h(( r   r7   c                   J    \ rS rSrSr\S 5       rS\R                  4S jr	Sr
g)CreateAlpha   rK   c                     [        U 5        grP   rQ   r   s    r   rR   CreateAlpha.Args   rT   r   r   c                     [        U5      $ rV   rW   rX   s     r   rZ   CreateAlpha.Run   r\   r   r]   N)r^   r_   r`   ra   rb   rd   rR   re   rg   rZ   rh   r]   r   r   rj   rj      s)    , h(( r   rj   )rb   re   apitools.base.pyr   r8   googlecloudsdk.api_lib.backupdrr   -googlecloudsdk.api_lib.backupdr.backup_vaultsr   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper   #googlecloudsdk.command_lib.backupdrr   r)   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer	   rf   r   rg   rH   ReleaseTracksReleaseTrackGADefaultUniverseOnlyCreateCommandr7   ALPHArj   r]   r   r   <module>r~      s    ,  > 0 L 2 ( 5 D < #X44 ,?


?D D%%(()>T >  *>B D%%++,&  -r   