
                         n    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 rS	 rS
 rS rS rg)zOUtils for cluster maintenance window and maintenance exclusion window commands.    )absolute_import)division)unicode_literals)util)
exceptions)flagsc                    A [         R                  " US5      (       d  U$ UR                  R                  5       nUR                  c)  [
        R                  " U5      R                  5       Ul        UR                  R                  c5  [
        R                  " U5      nUR                  5       UR                  l        UR                  UR                  R                  l        [        SU5        U$ )zUpdates the cluster.control_plane_encryption if --control-plane-kms-key flag is specified.

Args:
  ref: reference to the cluster object.
  args: command line arguments.
  request: API request to be issued

Returns:
  modified request
control_plane_kms_keycontrolPlaneEncryption)r   FlagIsExplicitlySetcalliope_commandReleaseTrackclusterr   GetMessagesModuleClusterr   ControlPlaneEncryptionr
   kmsKey_AddFieldToUpdateMaskrefargsrequestrelease_trackmessagess        :lib/googlecloudsdk/command_lib/edge_cloud/container/kms.pyUpdateKmsKeyr      s     
		"	"4)@	A	AN''446-__,,];CCEGO__++3%%m4H-5-L-L-NGOO*262L2L'//((/0':	.    c                 n   A [         R                  " US5      (       d  U$ UR                  (       d  [        R                  " SS5      eUR
                  cC  UR                  R                  5       n[        R                  " U5      R                  5       Ul        SUR
                  l        [        SU5        U$ )zClears cluster.control_plane_encryption in the request if --use-google-managed-key flag is specified.

Args:
  ref: reference to the cluster object.
  args: command line arguments.
  request: API request to be issued

Returns:
  modified request
use_google_managed_keyz--no-use-google-managed-keyThe flag is not supportedNr   )r   r   r   r   BadArgumentExceptionr   r   r   r   r   r   r   r   r   r   r   r   s       r   UseGoogleManagedKeyr#   9   s     
		"	"4)A	B	BN		$	$

)
)%'B  __))668M,,];CCEGO+/'//(0':	.r   c                    A [         R                  " US5      (       d  U$ UR                  R                  5       nUR                  c)  [
        R                  " U5      R                  5       Ul        UR                  R                  c5  [
        R                  " U5      nUR                  5       UR                  l        UR                  UR                  R                  l        [        SU5        U$ )zUpdates the cluster.zone_storage_encryption if --zone-storage-kms-key flag is specified.

Args:
  ref: reference to the cluster object.
  args: command line arguments.
  request: API request to be issued

Returns:
  modified request
zone_storage_kms_keyzoneStorageEncryption)r   r   r   r   r   r   r   r   r&   ZoneStorageEncryptionr%   r   r   r   s        r   UpdateZoneKmsKeyr(   Y   s     
		"	"4)?	@	@N''446-__,,];CCEGO__**2%%m4H,4,J,J,LGOO)151J1J'//''./9	.r   c                 n   A [         R                  " US5      (       d  U$ UR                  (       d  [        R                  " SS5      eUR
                  cC  UR                  R                  5       n[        R                  " U5      R                  5       Ul        SUR
                  l        [        SU5        U$ )zClears cluster.zone_storage_encryption in the request if --use-google-managed-zone-key flag is specified.

Args:
  ref: reference to the cluster object.
  args: command line arguments.
  request: API request to be issued

Returns:
  modified request
use_google_managed_zone_keyz --no-use-google-managed-zone-keyr    Nr&   )r   r   r*   r   r!   r   r   r   r   r   r   r&   r   r"   s       r   UseGoogleManagedZoneKeyr+   y   s     
		"	"4)F	G	GN		)	)

)
)*,G  __))668M,,];CCEGO*.'//'/9	.r   c                     UR                   (       d  Xl         U$ XR                   ;  a  UR                   S-   U -   Ul         U$ )N,)
updateMask)fieldr   s     r   r   r      s?    			N
$$$ ++c1E9G	.r   N)__doc__
__future__r   r   r   +googlecloudsdk.api_lib.edge_cloud.containerr   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r   r#   r(   r+   r    r   r   <module>r6      s:    V &  ' < . 0@@@@r   