
                            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d
lmZ ddlmZ ddlmZ dZdZdZd Z	 ddZ	 ddZd Zd dZd dZ	 d de	j6                  defdZ	 d!dZd Zd Z d Z!y)"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                 Z   t        j                  |       }t        j                  dd|t        j                  t        j
                  ddd      t        j
                  ddd	      
      }t        j                  t        |dd      }t        j                  |g      j                  |      S )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                 ,    | j                  dd|       y)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           	      V    | j                  ddd||t        j                                y)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                       fdS )Nc                 H    t        j                        | j                  z   S N)r   GetEffectiveApiEndpointr   )xr(   s    r,   <lambda>z MakeGetUriFunc.<locals>.<lambda>[   s    3..}=Fr.    )r(   s   `r,   MakeGetUriFuncrE   Z   s	    	FFr.   Nc                       } dk(  rd}g } r7|j                  t        j                   fddj                  |                   t	        j
                  dd|      S )z.Gets Google Cloud location resource attribute.-z
a wildcardc                       S r@   rD   r9   s   r,   rC   z)LocationAttributeConfig.<locals>.<lambda>h   s    Gr.   z4Location of the Mirroring Deployment. Defaults to {}r   r   )r   r4   fallthroughs)appendr
   Fallthroughformatr	   r#   )r9   default_keywordrJ   s   `  r,   LocationAttributeConfigrO   ^   sj    /^"O,BII	
 
	2	2-
 r.   c                 d    t        j                  ddt        |       t         j                        S )z?Constructs and returns the Resource specification for Location.z"networksecurity.projects.locationsr   rI   )resource_namer   r   )r	   r!   rO   r"   rI   s    r,   GetLocationResourceSpecrR   v   s,    			*)':::	
 r.   r)   r4   c                 x    t         j                  j                  dt        |      |      j	                  |        y)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
--locationrI   N)r   r&   ForResourcerR   r'   )r)   r4   r9   s      r,   AddLocationResourceArgrU      s/     +++G<iKr.   c                 ,    | j                  d||       y )N--forwarding-ruler0   r2   )r)   r   r4   s      r,   AddForwardingRuleArgrX      s     	)H9Mr.   c                  0    t        j                  dd      S )Nzforwarding-rule-locationz$The Cloud region for the {resource}.)r   r4   )r	   r#   rD   r.   r,   RegionAttributeConfigrZ      s    		2	2%6
 r.   c                    t        j                  dddt         j                  t               t        j                  ddd            }t        j                  d	|d
d      }t        j                  |g      j                  |       S )zAdds forwardingRule resource.zcompute.forwardingRulesforwardingRulev1zforwarding-rule-idr   forwardingRuleIdr   )resource_collectionrQ   r   projectregionr\   rW   Tz%Mirroring Deployment Forwarding Rule.r   )
r	   r!   r"   rZ   r#   r   r$   r   r&   r'   )r)   r*   r+   s      r,   AddForwardingRuleResourcerb      s    ''3$77"$>>

 +- )AA 8	 
	&	&(9':	;	G	G	OOr.   c                    t        j                  |       }t        j                  j	                  t
        |      }t        j                  dd|t        j                  t        j                  dddt        j                  t        j                  t              g|d      g      t        j                  dd	d
            }t        j                  d|ddd      }t!        j"                  |g      j%                  |      S )z)Adds mirroring deployment group resource.)r   r   zmirroring deployment groupr   r   r   )r   rJ   idr   mirroringDeploymentGroupsIdr   )r   r   r   re   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,   #AddMirroringDeploymentGroupResourcern      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%   rl   ri   r-   r5   r=   rE   rO   rR   ArgumentInterceptorstrrU   rX   rZ   rb   rn   rD   r.   r,   <module>rx      s    / &  ' M / 4 5 1 D G )1 =  C %
P: @G c G0 KO00=@  &INP.%Pr.   