
                             d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	l
mZ d
 Zd Zd Z	 	 	 	 ddZ	 	 	 	 	 	 ddZddZy)z4Shared resource flags for Network Security commands.    )absolute_import)division)unicode_literals)base)concepts)deps)concept_parsers)presentation_specsc                  0    t        j                  dd      S )Nserver_tls_policyz+ID of the server TLS policy for {resource}.)name	help_text)r    ResourceParameterAttributeConfig     @lib/googlecloudsdk/command_lib/network_security/resource_args.py_ServerTlsPolicyAttributeConfigr      s    		2	2=
 r   c                     g }| r$|j                  t        j                  d             |j                  t        j                  d d             t	        j
                  dd|      S )Nz--regionc                       y)Nglobalr   r   r   r   <lambda>z*_LocationAttributeConfig.<locals>.<lambda>)   s    (r   z%default value of location is [global]locationz&The Cloud location for the {resource}.)r   r   fallthroughs)appendr   ArgFallthroughFallthroughr   r   )region_fallthroughr   s     r   _LocationAttributeConfigr   #   sc    ,++J78

C
 
	2	28
 r   c                 v    t        j                  ddt               t        |       t         j                  d      S )Nz4networksecurity.projects.locations.serverTlsPoliciesr   F)resource_nameserverTlsPoliciesIdlocationsId
projectsIddisable_auto_completers)r   ResourceSpecr   r    DEFAULT_PROJECT_ATTRIBUTE_CONFIG)r   s    r   _GetServerTlsPolicyResourceSpecr'   3   s6    			<'9;*+=>::#
 r   Nc           	      t    ddi}t        j                  | t        |      dj                  ||      ||||      S )a  Returns ResourcePresentationSpec for server TLS policy resource.

  Args:
    flag: str, the flag name.
    noun: str, the resource.
    verb: str, the verb to describe the resource, such as 'to update'.
    required: bool, if False, means that map ID is optional.
    plural: bool.
    group: args group.
    region_fallthrough: bool, True if the command has a region flag that should
      be used as a fallthrough for the server TLS policy location.

  Returns:
    presentation_specs.ResourcePresentationSpec.
  r    z{} {}.)requiredpluralgroupflag_name_overrides)r
   ResourcePresentationSpecr'   format)flagnounverbr*   r+   r,   r   flag_overridess           r   +_GetServerTlsPolicyResourcePresentationSpecr4   >   sG    2 #.		4	4
%&89oodD!(
 r   c                 R    t        j                  t        d|z   || ||||      g      S )a[  Creates a resource argument for a Server TLS policy.

  Args:
    verb: str, the verb to describe the resource, such as 'to update'.
    noun: str, the resource; default: 'The server TLS policy'.
    name: str, the name of the flag.
    required: bool, if True the flag is required.
    plural: bool, if True the flag is a list.
    group: args group.
    region_fallthrough: bool, True if the command has a region flag that should
      be used as a fallthrough for the server TLS policy location.

  Returns:
    ServerTlsPolicyResourceArg: ConceptParser, holder for Server TLS policy
    argument.
  --)r	   ConceptParserr4   )r2   r1   r   r*   r+   r,   r   s          r   GetServerTlsPolicyResourceArgr8   c   s8    2 
	&	&1
+tT8VU<N( 
 r   c                 <    t        j                  d| z   dddd      S )zReturns the flag for clearing the Server TLS policy.

  Args:
    name: str, the name of the flag; default: 'clear-server-tls-policy'.
  r6   
store_trueFz4      Removes any attached Server TLS policy.
      )actiondefaultr*   help)r   Argument)r   s    r   $GetClearServerTLSPolicyForHttpsProxyr?      s*     

Tk

 r   )FFNF)zThe server TLS policyzserver-tls-policyFFNF)zclear-server-tls-policy)__doc__
__future__r   r   r   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr	   r
   r   r   r'   r4   r8   r?   r   r   r   <module>rE      sd    ; &  ' ( 5 1 D G  
"N 
!	
@r   