
    U
                     V   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	l
mZ  ej                  ej                  j                  ej                  j                   ej                  j"                        ej$                   G d
 dej&                                      Zy)z'Command to update an Essential Contact.    )absolute_import)division)unicode_literals)contacts)base)
exceptions)flags)utilc                   &    e Zd ZdZed        Zd Zy)Updatea  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                     t        j                  |        t        j                  | t        j                                t        j
                  |        t        j                  |        y)zAdds command-specific args.N)r	   AddContactIdArgAddNotificationCategoriesArgr   "GetContactNotificationCategoryEnumAddLanugageArgAddParentArgs)parsers    (lib/surface/essential_contacts/update.pyArgszUpdate.Args5   sJ     
&!	&&;;=?	 	    c                    t        j                  |      }t        j                  |t        j                               }|j
                  }|s|st        j                  ddg      t        j                         }|j                  |||      S )zRuns the update command.znotification-categorieslanguage)
r
   GetContactNameGetNotificationCategoriesr   r   r   r   MinimumArgumentExceptionContactsClientr   )selfargscontact_name
categoriesr   clients         r   Runz
Update.Run>   s|    &&t,L//h99;=J}}HJ//$j
13 3 $$&F==z8<<r   N)__name__
__module____qualname____doc__staticmethodr   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>r4      s    . &  ' > ( . ? > D%%++T->->-C-C%%((*+=T += *+=r   