
                            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rSrSrS r SS jr SS jrS rS S jrS S jr S S\	R6                  S\4S jjr S!S jrS rS r S r!g)"z(Flags for Mirroring Deployment commands.    )absolute_import)division)unicode_literals)api)arg_parsers)parser_arguments)concepts)deps)concept_parsers)presentation_specs)	resourcesMIRRORING_DEPLOYMENT7networksecurity.projects.locations.mirroringDeployments<networksecurity.projects.locations.mirroringDeploymentGroupsc                 N   [         R                  " U 5      n[        R                  " SSU[        R                  [        R
                  " SSSS9[        R
                  " SSS	S9S
9n[        R                  " [        USSS9n[        R                  " U/5      R                  U5      $ )z#Adds Mirroring Deployment resource.r   zmirroring deploymentlocationLocation of the {resource}.locationsIdparameter_namezdeployment-idId of the {resource}mirroringDeploymentsId)api_version
projectsIdr   r   TzMirroring Deployment.nameconcept_specrequired
group_help)r   GetApiVersionr	   ResourceSpec DEFAULT_PROJECT_ATTRIBUTE_CONFIG ResourceParameterAttributeConfigr   ResourcePresentationSpecDEPLOYMENT_RESOURCE_NAMEr   ConceptParserAddToParser)release_trackparserr   resource_specpresentation_specs        Clib/googlecloudsdk/command_lib/network_security/deployment_flags.pyAddDeploymentResourcer-   '   s    !!-0+''?::;;

'&
 &FF

 1-  )AA# (	 
	&	&(9':	;	G	G	OO    c                 &    U R                  SSUS9  g)z6Adds a resource argument for Google Cloud description.z--descriptionFr   helpNadd_argument)r)   	help_texts     r,   AddDescriptionArgr5   C   s     	oIFr.   c           	      R    U R                  SSSUU[        R                  " 5       S9  g)zAdds --max-wait flag.z
--max-waitmax_waitF)destr   defaultr1   typeN)r3   r   Duration)r)   default_max_waitr4   s      r,   
AddMaxWaitr=   J   s2     	!  r.   c                    ^  U 4S j$ )Nc                 J   > [         R                  " T5      U R                  -   $ N)r   GetEffectiveApiEndpointr   )xr(   s    r,   <lambda> MakeGetUriFunc.<locals>.<lambda>[   s    3..}=Fr.    )r(   s   `r,   MakeGetUriFuncrF   Z   s	    	FFr.   Nc                    ^  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 $ r@   rE   r9   s   r,   rC   )LocationAttributeConfig.<locals>.<lambda>h   s    Gr.   z4Location of the Mirroring Deployment. Defaults to {}r   r   )r   r4   fallthroughs)appendr
   Fallthroughformatr	   r#   )r9   default_keywordrL   s   `  r,   LocationAttributeConfigrQ   ^   sj    /^"O,BII	
 
	2	2-
 r.   c                 Z    [         R                  " SS[        U S9[         R                  S9$ )z?Constructs and returns the Resource specification for Location.z"networksecurity.projects.locationsr   rJ   )resource_namer   r   )r	   r!   rQ   r"   rJ   s    r,   GetLocationResourceSpecrT   v   s,    			*)':::	
 r.   r)   r4   c                 r    [         R                  R                  S[        US9U5      R	                  U 5        g)zAdds 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.
  default: Optional default value for the arg.
z
--locationrJ   N)r   r&   ForResourcerT   r'   )r)   r4   r9   s      r,   AddLocationResourceArgrW      s/     +++G<iKr.   c                 $    U R                  SXS9  g )N--forwarding-ruler0   r2   )r)   r   r4   s      r,   AddForwardingRuleArgrZ      s     	)HMr.   c                  ,    [         R                  " SSS9$ )Nzforwarding-rule-locationz$The Cloud region for the {resource}.)r   r4   )r	   r#   rE   r.   r,   RegionAttributeConfigr\      s    		2	2%6
 r.   c                    [         R                  " SSS[         R                  [        5       [         R                  " SSSS9S9n[
        R                  " S	US
SS9n[        R                  " U/5      R                  U 5      $ )zAdds forwardingRule resource.zcompute.forwardingRulesforwardingRulev1zforwarding-rule-idr   forwardingRuleIdr   )resource_collectionrS   r   projectregionr^   rY   Tz%Mirroring Deployment Forwarding Rule.r   )
r	   r!   r"   r\   r#   r   r$   r   r&   r'   )r)   r*   r+   s      r,   AddForwardingRuleResourcerd      s    ''3$77"$>>

 +- )AA 8	 
	&	&(9':	;	G	G	OOr.   c                    [         R                  " U 5      n[        R                  R	                  [
        US9n[        R                  " SSU[        R                  [        R                  " SSS[        R                  " [        R                  " [        5      /US5      /S9[        R                  " SS	S
S9S9n[        R                  " SUSSSS9n[         R"                  " U/5      R%                  U5      $ )z)Adds mirroring deployment group resource.)r   r   zmirroring deployment groupr   r   r   )r   rL   idr   mirroringDeploymentGroupsIdr   )r   r   r   rg   z--mirroring-deployment-groupTzMirroring Deployment Group.)r   r   r   r   prefixes)r   r    r   REGISTRYGetCollectionInfo$DEPLOYMENT_GROUP_RESOURCE_COLLECTIONr	   r!   r"   r#   r
   FullySpecifiedAnchorFallthroughArgFallthroughDEPLOYMENT_RESOURCE_COLLECTIONr   r$   r   r&   r'   )r(   r)   r   collection_infor*   r+   s         r,   #AddMirroringDeploymentGroupResourcerp      s    !!-0+&&88* 9 / ''D"::;;

'&22&&'EFG!	 #+"K"K

 6##-. )AA) . 
	&	&(9':	;	G	G	OOr.   )z'Description of the mirroring deployment)zTime to synchronously wait for the operation to complete, after which the operation continues asynchronously. Ignored if --no-async isn't specified. See $ gcloud topic datetimes for information on time formats.r@   )Tz!Forwarding rule of the deployment)"__doc__
__future__r   r   r   =googlecloudsdk.api_lib.network_security.mirroring_deploymentsr   googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr	   r
   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   r%   rn   rk   r-   r5   r=   rF   rQ   rT   ArgumentInterceptorstrrW   rZ   r\   rd   rp   rE   r.   r,   <module>rz      s    / &  ' M / 4 5 1 D G )1 =  C %
P: @G c G0 KO00=@  &INP.%Pr.   