
    t                     Z    S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      rS r	S	 r
g
)z=Utilities for creating/parsing arguments for update commands.    )absolute_import)division)unicode_literals)basec                   >    \ rS rSrSrS r\S 5       r\S 5       rSr	g)UpdateResult   zResult type for applying updates.

Attributes:
  needs_update: bool, whether the args require any changes to the existing
    resource.
  value: the value to put
c                     Xl         X l        g )Nneeds_updatevalue)selfr   r   s      7lib/googlecloudsdk/command_lib/util/args/update_util.py__init__UpdateResult.__init__"   s    $J    c                     U " SU5      $ )NT )clsr   s     r   MakeWithUpdateUpdateResult.MakeWithUpdate&   s    tUr   c                     U " SS 5      $ )NFr   )r   s    r   MakeNoUpdateUpdateResult.MakeNoUpdate*   s    udr   r   N)
__name__
__module____qualname____firstlineno____doc__r   classmethodr   r   __static_attributes__r   r   r   r   r      s4        r   r   c                 $   [         R                  " SR                  U5      SR                  X#5      S9[         R                  " SR                  U5      SR                  X#5      SS9/nU R                  US9nU H  nUR	                  U5        M     g)	z;Add arguments corresponding to a field that can be cleared.z--{}zSet the {} for the {}.)helpz
--clear-{}zClear the {} from the {}.
store_true)r#   actionN)r   Argumentformatadd_mutually_exclusive_groupAddToParser)parserarg_nameproperty_nameresource	full_helpargsgroupargs           r   AddClearableFieldr2   /   s     mm
--
!'..}GI mm


h
'*11-J	
$ 
-
-9
-
=%cOOE r   c                     [        U SU-   5      n[        XS 5      nU(       a  [        R                  S 5      $ U(       a  [        R                  U5      $ [        R                  5       $ )Nclear_)getattrr   r   r   )r/   r+   clearset_s       r   ParseClearableFieldr8   ?   sV    
$8+
,%		&$
&&t,,&&t,,$$&&r   N)r   
__future__r   r   r   googlecloudsdk.callioper   objectr   r2   r8   r   r   r   <module>r<      s/    D &  ' )6 , 'r   