
    _
                     v    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 r	S r
S	 rS
 rS rS rS rS rS rg)z+Flag utilities for `gcloud redis clusters`.    N)encoding)apis)arg_parsers)basec                 8    [         R                  " 5       " U 5      $ N)r   ArgDict)values    4lib/googlecloudsdk/command_lib/redis/cluster_util.pyClusterRedisConfigArgTyper      s    				u	%%    c                  V    [         R                  " SS[        [        R                  SS9$ )Nz--update-redis-configz	KEY=VALUEz            A list of Redis Cluster config KEY=VALUE pairs to update. If a
            config parameter is already set, its value is modified; otherwise a
            new Redis config parameter is added.
            metavartypeactionhelp)r   Argumentr   r   UpdateAction r   r   ClusterUpdateRedisConfigFlagr      s*    	$%%

 
r   c                  t    [         R                  " SS[        R                  " 5       [        R                  SS9$ )Nz--remove-redis-configKEYz~      A list of Redis Cluster config parameters to remove. Removing a non-existent
      config parameter is silently ignored.r   )r   r   r   ArgListr   r   r   r   ClusterRemoveRedisConfigFlagr   ,   s3    	 %%/
 r   c                  *    [        5       [        5       /$ r   )r   r   r   r   r    AdditionalClusterUpdateArgumentsr   8   s    
&
(*F*H	IIr   c                 T    [         R                  " XR                  R                  SS9$ )NT)
sort_items)r   DictToAdditionalPropertyMessageClusterRedisConfigsValue)configmessagess     r   PackageClusterRedisConfigr%   <   s&    		1	100T
 r   c                     [        U S5      $ )Nv1alpha1ParseTimeOfDay
start_times    r   ParseTimeOfDayAlphar,   B   s    	
J	//r   c                     [        U S5      $ )Nv1beta1r(   r*   s    r   ParseTimeOfDayBetar/   F   s    	
I	..r   c                     [        U S5      $ )Nv1r(   r*   s    r   ParseTimeOfDayGar2   J   s    	
D	))r   c                     [         R                  " SU 5      nU(       aL  [        R                  " SU5      n[	        UR                  S5      5      nUS::  a  US:  a  UR                  US9$ [        R                  " SR                  U 5      5      e)Nz^(\d?\d):00$redis      r   )hoursz9Failed to parse time of day: {0}, expected format: HH:00.)
rematchr   GetMessagesModuleintgroup	TimeOfDayr   ArgumentTypeErrorformat)r+   api_versionmmessagehours        r   r)   r)   N   s}    hh
+!$$Wk:Gqwwqz?DrzdaiT**%%AHH
	 r   )__doc__r8   apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r   r   r   r   r   r%   r,   r/   r2   r)   r   r   r   <module>rH      sI    2 
 % , / (&	J0/*r   