
    
                     8   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  SS
KJr  \R                   \R"                  " \R$                  R&                  \R$                  R(                  5       " S S\R*                  5      5       5       rg)zUpdate policy command.    )absolute_import)division)unicode_literals)apis)platform_policy)messages)base)flags)parsingc                   .    \ rS rSrSr\S 5       rS rSrg)Update   aH  Update a Binary Authorization platform policy.

## EXAMPLES

To update an existing policy using its resource name:

  $ {command} projects/my_proj/platforms/gke/policies/policy1 --policy-file=policy1.json

To update the same policy using flags:

  $ {command} policy1 --platform=gke --project=my_proj --policy-file=policy1.json
c                     [         R                  " U S5        U R                  SSSS9  U R                  R	                  S5        g )Nz	to updatez--policy-fileTz0The JSON or YAML file containing the new policy.)requiredhelpyaml)r
   AddPlatformPolicyResourceArgadd_argumentdisplay_info	AddFormat)parsers    /lib/surface/container/binauthz/policy/update.pyArgsUpdate.Args/   sE    	&&v{;
?  A !!&)    c                 ^   [         R                  " S5      nUR                  R                  R	                  5       R                  5       n[        R                  " UR                  5      n[        R                  " UUR                  5      n[        R                  " S5      R                  X55      $ )Nv1)r   GetMessagesModuleCONCEPTSpolicy_resource_nameParseRelativeNamer   LoadResourceFilepolicy_filemessages_utilDictToMessageWithErrorCheckPlatformPolicyr   Clientr   )selfargsr   
policy_ref
policy_objpolicys         r   Run
Update.Run8   s    %%d+H3399;HHJJ))$*:*:;J 66z7?7N7NPF!!$'..zBBr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r.   __static_attributes__r0   r   r   r   r      s!     * *
Cr   r   N)r5   
__future__r   r   r   )googlecloudsdk.api_lib.container.binauthzr   r   googlecloudsdk.api_lib.utilr   r%   googlecloudsdk.callioper	   -googlecloudsdk.command_lib.container.binauthzr
   r   DefaultUniverseOnlyReleaseTracksReleaseTrackBETAALPHAUpdateCommandr   r0   r   r   <module>rC      s}     &  ' : E A ( ? A D%%**D,=,=,C,CD#CT #C E #Cr   