
    
                         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  \	R                  " \	R                  R                   5       " S S	\	R"                  5      5       rg
)z6Implements command to update a specified guest policy.    )absolute_import)division)unicode_literals)utils)base)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)Update   zUpdate the specified guest policy for a project.

## EXAMPLES

  To update the guest policy `policy1` in the project `project1`, run:

        $ {command} policy1 \
        --file=path_to_config_file --project=project1

c                 P    U R                  S[        SS9  U R                  SSSS9  g)	See base class.	POLICY_IDz#Name of the guest policy to update.)typehelpz--fileTa          The JSON or YAML file with the updated guest policy.

        If this file specifies an etag value, the update succeeds only if
        the policy that is already in place has a matching etag value. If no
        etag value is specified, the specifications in the updated policy file
        replaces the existing policy.

        For information about the guest policy format, see https://cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies.
        )requiredr   N)add_argumentstr)parsers    6lib/surface/compute/os_config/guest_policies/update.pyArgsUpdate.Args(   s>     #$I  K
	      c                    U R                  5       n[        R                  " U5      n[        R                  " U5      n[        R
                  " UR                  UR                  5      u  nn[        R                  R                  R                  R                  5       nUR                  U[        R                  " SXqR                  5      SS9nUR                   n	U	R#                  U5      $ )r   projectsN)guestPolicyname
updateMask)ReleaseTrackosconfig_api_utilsGetClientInstanceGetClientMessagesosconfig_command_utils"GetResourceAndUpdateFieldsFromFilefileGuestPolicyr   VALUEScoreproject	GetOrFail)OsconfigProjectsGuestPoliciesPatchRequestGetGuestPolicyUriPathr   projects_guestPoliciesPatch)
selfargsrelease_trackclientmessagesguest_policy_r(   requestservices
             r   Run
Update.Run;   s    %%'M11-@F!33MBH !
C
C	H((*\ $$,,668G@@ #991	 A G ++G==!!r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r7   __static_attributes__r9   r   r   r
   r
      s     	  $"r   r
   N)r>   
__future__r   r   r   (googlecloudsdk.api_lib.compute.os_configr   r   googlecloudsdk.callioper   ,googlecloudsdk.command_lib.compute.os_configr"   googlecloudsdk.corer   ReleaseTracksr   BETACommandr
   r9   r   r   <module>rI      sU    = &  ' P ( X * D%%**+2"T\\ 2" ,2"r   