
                           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KJr  SSKJr  / SQrS/rSS jrSS jrSS jrS rS rSS jrS rSS jr  S     SS jjr   S        S!S jjrg)"z6Flags for Security Profile Threat Prevention commands.    )absolute_import)annotations)division)unicode_literals)sp_api)arg_parsers)parser_arguments)concepts)deps)concept_parsers)presentation_specs)DEFAULT_ACTIONALLOWALERTDENYTHREAT_PREVENTIONc                   U R                  SUS9nUR                  S[        R                  " 5       SSS9  UR                  S[        R                  " 5       SS	S9  UR                  S
[        R                  " 5       SSS9  g)z5Adds --antivirus, --severities, or --threat-ids flag.T)mutexrequiredz--severitiesSEVERITY_LEVELzeList of comma-separated severities where each value in the list indicates the severity of the threat.)typemetavarhelpz--threat-idsz	THREAT-IDzList of comma-separated threat identifiers where each identifier in the list is a vendor-specified Signature ID representing a threat type. z--antivirusPROTOCOLznList of comma-separated protocols where each value in the list indicates the protocol of the antivirus threat.N)	add_groupadd_argumentr   ArgList)parserr    severity_threatid_antivirus_argss      ;lib/googlecloudsdk/command_lib/network_security/sp_flags.py#AddSeverityorThreatIDorAntivirusArgr!   "   s    %+%5%58 &6 &" #// 3 0  #//  0 	 #// = 0     Nc                F    U=(       d    [         nU R                  SUUSS9  g )Nz--actionz8Action associated with antivirus, severity, or threat-id)r   choicesr   )DEFAULT_ACTIONSr   )r   actionsr   r$   s       r    AddActionArgr'   E   s+    &'E	  r"   c                &    U R                  SUSS9  g )Nz--descriptionz)Brief description of the security profile)r   r   )r   )r   r   s     r    AddProfileDescriptionr)   O   s    6  r"   c                R   Sn[         R                  " SS[        R                  " U5      [         R                  " SSSS9[         R                  " SSS	S9[         R                  " SS
SS9S9n[
        R                  " UUSSS9n[        R                  " U/5      R                  U 5      $ )z-Adds Security Profile Threat Prevention type.security_profilez8networksecurity.organizations.locations.securityProfilesorganizationz2Organization ID to which the changes should apply.organizationsId)parameter_namelocationz$location of the {resource} - Global.locationsIdzName of the {resource}.securityProfilesId)resource_collectionresource_nameapi_versionr-   r0   r1   TzSecurity Profile Name.)nameconcept_specr   
group_help)
r
   ResourceSpecr   GetApiVersion ResourceParameterAttributeConfigr   ResourcePresentationSpecr   ConceptParserAddToParser)r   release_trackr5   resource_specpresentation_specs        r    AddSecurityProfileResourcerA   W   s    	$''
D&&&}5??

>*
 ;;

0&
 "BB

#-!-, )AA )	 
	&	&(9':	;	G	G	OOr"   c                   ^  U 4S j$ )Nc                J   > [         R                  " T5      U R                  -   $ N)r   GetEffectiveApiEndpointr5   )xr>   s    r    <lambda> MakeGetUriFunc.<locals>.<lambda>z   s    611-@166Ir"    )r>   s   `r    MakeGetUriFuncrJ   y   s	    	IIr"   c                   ^  T nT S:X  a  Sn/ nT (       a9  UR                  [        R                  " U 4S jSR                  U5      5      5        [        R
                  " SSUS9$ )z.Gets Google Cloud location resource attribute.-z
a wildcardc                    > T $ rD   rI   defaults   r    rG   )LocationAttributeConfig.<locals>.<lambda>   s    Gr"   z(Location of the resource. Defaults to {}r/   zLocation of the {resource}.)r5   	help_textfallthroughs)appendr   Fallthroughformatr
   r:   )rO   default_keywordrR   s   `  r    LocationAttributeConfigrW   }   sg    /^"O,6==oN	
 
	2	2-
 r"   c                 ,    [         R                  " SSS9$ )z2Gets Google Cloud organization resource attribute.r,   z"Organization ID of the {resource}.)r5   rQ   )r
   r:   rI   r"   r    OrgAttributeConfigrY      s    		2	24
 r"   c                N    [         R                  " SS[        U S9[        5       S9$ )z?Constructs and returns the Resource specification for Location.z'networksecurity.organizations.locationsr/   rN   )r3   r0   r-   )r
   r8   rW   rY   rN   s    r    GetLocationResourceSpecr[      s)    			/)':(*	
 r"   c                p    [         R                  R                  S[        US9UUS9R	                  U 5        g)a  Adds a resource argument for Google Cloud location.

Args:
  parser: The argparse.parser to add the resource arg to.
  help_text: str, the text of the help message.
  required: bool, whether the argument is required.
  default: Optional default value for the arg.
z
--locationrN   )r5   r?   r7   r   N)r   r<   ForResourcer[   r=   r   rQ   r   rO   s       r    AddLocationResourceArgr_      s:     +++G<	 , 
 Kr"   c           	     R    U R                  S[        R                  " 5       SUUUS9  g)zJAdds the `mirroringDeploymentGroups` arg for CustomMirroring SPs (Broker).z--mirroring-deployment-groupsMIRRORING_DEPLOYMENT_GROUPS)r   r   r   r   rO   N)r   r   r   r^   s       r    %AddCustomMirroringDeploymentGroupsArgrb      s2     	% +  r"   )T)NT)FrD   )FN)r   $parser_arguments.ArgumentInterceptorrQ   strr   bool)zKList of comma-separated full names of mirroring-deployment-group resources.FN)r   rc   rQ   rd   r   re   rO   zlist[str] | None)__doc__
__future__r   r   r   r   9googlecloudsdk.api_lib.network_security.security_profilesr   googlecloudsdk.callioper   r	    googlecloudsdk.calliope.conceptsr
   r   (googlecloudsdk.command_lib.util.conceptsr   r   r%   DEFAULT_PROFILE_TYPESr!   r'   r)   rA   rJ   rW   rY   r[   r_   rb   rI   r"   r    <module>rm      s    = & "  ' L / 4 5 1 D G>,-  FPDJ, 	0 0 c $	0  	r"   