
                         D    S r SSKJr  SSKJr  SrSrSrS rS rS	 r	S
 r
g)z9Module for deletion protection related utility functions.    )arg_parsers)parser_errorsziDeletion protection control options. When deletion protection is enabled,
the instance cannot be deleted.z-Enables deletion protection for the instance.z=The reason for enabling deletion protection for the instance.c                     U R                  [        SS9nUR                  SSSS[        S9  UR                  SS[        S	9  g)
z<Adds deletion protection related create flags to the parser.F)helprequired--deletion-protection
store_trueNT)actiondefaultr   r   --deletion-protection-reason)r   r   )	add_group_DELETION_PROTECTION_GROUP_HELPadd_argument_DELETION_PROTECTION_HELP _DELETION_PROTECTION_REASON_HELPparsergroups     =lib/googlecloudsdk/command_lib/filestore/instances/dp_util.pyAddDeletionProtectionCreateArgsr      sa     

*  % $  & $+  -    c                     U R                  [        S9nUR                  S[        R                  [
        S9  UR                  S[        S9  g)z<Adds deletion protection related update flags to the parser.)r   r   )r
   r   r   N)r   r   r   r   StoreTrueFalseActionr   r   r   s     r   AddDeletionProtectionUpdateArgsr   2   sY    


*  ,% --$  &
 $+  -r   c                     / nU R                  S5      (       a  UR                  S5        U R                  S5      (       a  UR                  S5        U$ )z[Returns the update mask for deletion protection.

Args:
  args: The args from the command.
deletion_protectiondeletionProtectionEnableddeletion_protection_reasondeletionProtectionReason)IsSpecifiedappend)argsmasks     r   GetDeletionProtectionUpdateMaskr$   A   sL     
$
,--KK+,	233KK*+	+r   c                 ~    U R                   nU R                  nUb"  U(       d  Ub  [        R                  " S5      eggg)zRValidates the deletion protection args.

Args:
  args: The args from the command.
NzI--deletion-protection-reason cannot be used with --no-deletion-protection)r   r   r   ArgumentException)r"   deletion_protection_enabledr   s      r   $ValidateDeletionProtectionUpdateArgsr(   R   sR     !% 8 8#>>!-)
$
0

)
)	#$ $ 1 * .r   N)__doc__googlecloudsdk.callioper   r   r   r   r   r   r   r$   r(    r   r   <module>r,      s?    @ / 1##  L $A  -(-"$r   