
    )                         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   " S S\
R"                  5      rg)zCommand to update SSL policies.    )absolute_import)division)unicode_literals)base_classes)ssl_policies_utils)base)
exceptions)scope)flagsc                   B    \ rS rSrSrSr\S 5       rS r\	S 5       r
Srg)Update   a  Update a Compute Engine SSL policy.

*{command}* is used to update SSL policies.

An SSL policy specifies the server-side support for SSL features. An SSL
policy can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects
connections between clients and the load balancer. SSL
policies do not affect the connection between the load balancers and the
backends. SSL policies are used by Application Load Balancers and proxy
Network Load Balancers.
Nc                    UR                   R                  [        R                  5        [        R                  " 5       U l        U R
                  R                  USS9  [        R                  " 5       R                  U5        [        R                  " 5       R                  U5        [        R                  " 5       R                  U5        g )Npatch)operation_type)display_info	AddFormatr   DEFAULT_LIST_FORMATGetSslPolicyMultiScopeArgumentSSL_POLICY_ARGAddArgumentGetProfileFlagAddToParserGetMinTlsVersionFlagGetCustomFeaturesFlag)clsparsers     *lib/surface/compute/ssl_policies/update.pyArgsUpdate.Args,   s    
!!%";";<==?C""6'"B	&&v.	 ,,V4	!--f5    c                 *   [         R                  " U R                  5       5      n[        R                  " U5      nU R
                  R                  XR                  [        R                  R                  S9n[        R                  U5      u  pVUR                  U5      nUR                  UR                  UR                   ["        R$                  " UR&                  5      US9nUR)                  XHU=(       a    U(       + 5      n	UR+                  XIS5      $ )z*Issues the request to update a SSL policy.)default_scope)fingerprintprofilemin_tls_versioncustom_featureszUpdating SSL policy)r   ComputeApiHolderReleaseTrackr   SslPolicyHelperr   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALr   _GetCustomFeaturesDescribeGetSslPolicyForPatchr$   r%   r   ParseTlsVersionr&   PatchWaitForOperation)
selfargsholderhelperssl_policy_refinclude_custom_featuresr'   existing_ssl_policypatch_ssl_policyoperation_refs
             r   Run
Update.Run5   s    **4+<+<+>?F//7F((::m.E.E.L.L ; NN 06/H/H/N, //.922'33--d.B.BC'	 3 )
 LL*A +M "">#8: :r!   c                 2   U R                  S5      (       aZ  U R                  S:w  aJ  U R                  S5      (       a0  [        U R                  5      S:  a  [        R
                  " SS5      eS/ 4$ U R                  S5      (       a  SU R                  4$ S/ 4$ )	aO  Returns the custom features specified on the command line.

Args:
  args: The arguments passed to this command from the command line.

Returns:
  A tuple. The first element in the tuple indicates whether custom
  features must be included in the request or not. The second element in
  the tuple specifies the list of custom features.
r%   CUSTOMr'   r   z--custom-featureszCCustom features cannot be specified when using non-CUSTOM profiles.TF)IsSpecifiedr%   lenr'   r	   InvalidArgumentException)r7   s    r   r0   Update._GetCustomFeaturesJ   s     	""t||x'?			+	,	,T5I5I1JQ1N 11 "./ 	/
 BZ			+	,	,D(()) R[r!    )__name__
__module____qualname____firstlineno____doc__r   classmethodr   r?   staticmethodr0   __static_attributes__rG   r!   r   r   r      s9    
 .6 6:*  r!   r   N)rL   
__future__r   r   r   googlecloudsdk.api_lib.computer   +googlecloudsdk.api_lib.compute.ssl_policiesr   googlecloudsdk.callioper   r	   "googlecloudsdk.command_lib.computer
   r-   /googlecloudsdk.command_lib.compute.ssl_policiesr   UpdateCommandr   rG   r!   r   <module>rW      s9    & &  ' 7 J ( . E AJT Jr!   