
                         b   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
S.r\	R                  \	R                  " \	R                  R                   \	R                  R"                  \	R                  R$                  5       " S S\	R&                  5      5       5       r\\l        g)z 'logging scopes update' command.    )absolute_import)division)unicode_literals)util)arg_parsers)base)
exceptionsz3
        Update the properties of a log scope.
    aH  
     To update the description of a log scope in a project, run:

        $ {command} my-scope --description=my-new-description --project=my-project

     To update the resource name of a log scope in a project. Ensure that you
     provide all the resource names including the existing ones. For example,
     if the log scope has the resource name my-project, and you want to update
     the log scope to have the resource name another-project, run the following:

        $ {command} my-scope --resource-names=projects/my-project,projects/another-project --project=my-project
    )DESCRIPTIONEXAMPLESc                   H   ^  \ rS rSrSrU 4S jr\S 5       rS rS r	Sr
U =r$ )Update-   zQUpdate a log scope.

Changes one or more properties associated with a log scope.
c                 <   > [         [        U ]
  " U0 UD6  S U l        g )N)superr   __init___current_scope)selfargskwargs	__class__s      $lib/surface/logging/scopes/update.pyr   Update.__init__7   s    	&$ $1&1D    c                     U R                  SSS9  U R                  SSS9  U R                  SS[        R                  " 5       SS	9  g
)z Register flags for this command.LOG_SCOPE_IDz"The ID of the log scope to update.)help--descriptionz$A new description for the log scope.--resource-namesz.A new set of resource names for the log scope.RESOURCE_NAMES)r   typemetavarN)add_argumentr   ArgList)parsers    r   ArgsUpdate.Args;   sb     A   D   =  " 	  r   c                    0 n/ nSS/nUR                  S5      (       a   UR                  US'   UR                  S5        UR                  S5      (       a   UR                  US'   UR                  S5        U(       d  [        R
                  " US5      e[        R                  " 5       R                  R                  [        R                  " 5       R                  [        R                  " [        R                  " [        R                  " UR                  5      R                  5       SS5      S	UR                   5      [        R                  " 5       R"                  " S0 UD6S
R%                  U5      S95      $ )Nr   r   descriptionresource_namesresourceNamesz.Please specify at least one property to update	locationsglobal	logScopes,)namelogScope
updateMask )IsSpecifiedr(   appendr)   calliope_exceptionsMinimumArgumentExceptionr   	GetClientprojects_locations_logScopesPatchGetMessages-LoggingProjectsLocationsLogScopesPatchRequestCreateResourceNameGetProjectResourceprojectRelativeNamer   LogScopejoin)r   r   
scope_dataupdate_maskparameter_namess        r   _RunUpdate._RunK   sE   JK&(:;O&&"&"2"2j'())$($7$7j!)*88
K  >>88>>HH((''++DLL9FFH
 !! %%'00>:>xx, 	I 	
 r   c                 $    U R                  U5      $ )zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  The updated log scope.
)rE   )r   r   s     r   Run
Update.Runk   s     99T?r   )r   )__name__
__module____qualname____firstlineno____doc__r   staticmethodr%   rE   rH   __static_attributes____classcell__)r   s   @r   r   r   -   s1    

  @
 
r   r   N)rN   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   r   r	   r5   DETAILED_HELPUniverseCompatibleReleaseTracksReleaseTrackALPHABETAGAUpdateCommandr   detailed_helpr2   r   r   <module>r^      s    ' &  ' / / ( E	& T..33T5F5F5I5IDT D DN % r   