
    U
                     V   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SK
Jr  SS	K
Jr  \R                  " \R                  R                  \R                  R                   \R                  R"                  5      \R$                   " S
 S\R&                  5      5       5       rg)z'Command to update an Essential Contact.    )absolute_import)division)unicode_literals)contacts)base)
exceptions)flags)utilc                   .    \ rS rSrSr\S 5       rS rSrg)Update   ak  Update an essential contact.

## EXAMPLES

To update the notification category subscriptions for the contact with id
``123'' in the current project, run:

      $ {command} 123 --notification-categories=legal,suspension

To update the language preference for the contact with id ``123'' in the
folder with id ``456'', run:

      $ {command} 123 --language=es --folder=456

To update the notification category subscriptions and language preference for
the contact with id ``123'' in the organization with id ``456'', run:

      $ {command} 123 --notification-categories=legal --language=en-US
      --organization=456
c                     [         R                  " U 5        [         R                  " U [        R                  " 5       5        [         R
                  " U 5        [         R                  " U 5        g)zAdds command-specific args.N)r	   AddContactIdArgAddNotificationCategoriesArgr   "GetContactNotificationCategoryEnumAddLanugageArgAddParentArgs)parsers    (lib/surface/essential_contacts/update.pyArgsUpdate.Args5   sJ     
&!	&&;;=?	 	    c                 4   [         R                  " U5      n[         R                  " U[        R                  " 5       5      nUR
                  nU(       d  U(       d  [        R                  " SS/5      e[        R                  " 5       nUR                  X#U5      $ )zRuns the update command.znotification-categorieslanguage)
r
   GetContactNameGetNotificationCategoriesr   r   r   r   MinimumArgumentExceptionContactsClientr   )selfargscontact_name
categoriesr   clients         r   Run
Update.Run>   sz    &&t,L//h99;=J}}HJ//$j
13 3 $$&F==8<<r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r$   __static_attributes__r&   r   r   r   r      s     *    =r   r   N)r+   
__future__r   r   r   )googlecloudsdk.api_lib.essential_contactsr   googlecloudsdk.callioper   r   -googlecloudsdk.command_lib.essential_contactsr	   r
   ReleaseTracksReleaseTrackALPHABETAGAUniverseCompatibleUpdateCommandr   r&   r   r   <module>r9      s    . &  ' > ( . ? > D%%++T->->-C-C%%((*+=T += *+=r   