
    P	                        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  \R                  \R                  \R                  " \R                   R"                  5       " S S	\R$                  5      5       5       5       rg
)z)Command to update a reCAPTCHA key policy.    )encoding)apis)arg_parsers)base)policies_util)recaptchaenterprise_v1_messagesc                   .    \ rS rSrSr\S 5       rS rSrg)Update   zUpdate a reCAPTCHA key's policy.

## EXAMPLES

To update a policy for a reCAPTCHA key:

    $ {command} --key=test-key  --policy=policy.yaml

See [https://cloud.google.com/sdk/gcloud/reference/recaptcha/keys] for more
details for recaptcha keys.
c                 |    [         R                  " U S5        U R                  SSS[        R                  " 5       S9  g )Nz	to updatez--policyzDPath to a YAML file or a JSON file containing the policy definition.T)helprequiredtype)r   AddKeyResourceArgadd_argumentr   YAMLFileContents)parsers    (lib/surface/recaptcha/policies/update.pyArgsUpdate.Args)   s>    ##FK8
 ))+      c                 ~   [         R                  " SS5      nUR                  R                  R	                  5       nUR                  5       S-   nUR                  b  UR                  O0 n[        R                  " U[        R                  5      n[        R                  " UUS9nUR                  R                  U5      $ )Nrecaptchaenterprisev1z/policy)name&googleCloudRecaptchaenterpriseV1Policy)r   GetClientInstanceCONCEPTSkeyParseRelativeNamepolicyr   DictToMessagemessages&GoogleCloudRecaptchaenterpriseV1Policy2RecaptchaenterpriseProjectsKeysUpdatePolicyRequestprojects_keysUpdatePolicy)selfargsclientkey_refpolicy_namepolicy_dictpolicy_messagerequests           r   Run
Update.Run6   s    ##$94@Fmm%%'G&&(94K!%!8$++bK++XDDN
 II/=G ,,W55r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r1   __static_attributes__r3   r   r   r
   r
      s     
 
 
6r   r
   N)r8   apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r   $googlecloudsdk.command_lib.recaptchar   <googlecloudsdk.generated_clients.apis.recaptchaenterprise.v1r   r$   HiddenDefaultUniverseOnlyReleaseTracksReleaseTrackALPHAUpdateCommandr
   r3   r   r   <module>rF      sn    0 % , / ( > t D%%++,)6T )6 -  )6r   