
                             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Zd Z	 ddZ	 ddZd ZddZddZddZd Zde	j2                  fdZd Zy)z.Flags for Mirroring Deployment Group commands.    )absolute_import)division)unicode_literals)api)arg_parsers)parser_arguments)concepts)deps)concept_parsers)presentation_specsMIRRORING_DEPLOYMENT_GROUPc                 V   t        j                  ddt        j                  |       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 Group resource.z<networksecurity.projects.locations.mirroringDeploymentGroupszmirroring deployment grouplocationLocation of the {resource}.locationsIdparameter_namezdeployment-group-idzId of the {resource}mirroringDeploymentGroupsId)api_version
projectsIdr   r   TMirroring Deployment Group.nameconcept_specrequired
group_help)r	   ResourceSpecr   GetApiVersion DEFAULT_PROJECT_ATTRIBUTE_CONFIG ResourceParameterAttributeConfigr   ResourcePresentationSpecDEPLOYMENT_GROUP_RESOURCE_NAMEr   ConceptParserAddToParser)release_trackparserresource_specpresentation_specs       Ilib/googlecloudsdk/command_lib/network_security/deployment_group_flags.pyAddDeploymentGroupResourcer*       s    ''D"##M2::;;

'&
 #+"K"K

 6#-  )AA) .	 
	&	&(9':	;	G	G	OO    c           	      V    | j                  ddd||t        j                                y)zAdds --max-wait flag.z
--max-waitmax_waitF)destr   defaulthelptypeN)add_argumentr   Duration)r&   default_max_wait	help_texts      r)   
AddMaxWaitr6   ;   s2     	!  r+   c                 ,    | j                  dd|       y)z6Adds a resource argument for Google Cloud description.z--descriptionFr   r0   Nr2   r&   r5   s     r)   AddDescriptionArgr;   K   s     	oIFr+   c                       fdS )Nc                 H    t        j                        | j                  z   S N)r   GetEffectiveApiEndpointr   )xr%   s    r)   <lambda>z MakeGetUriFunc.<locals>.<lambda>S   s    3..}=Fr+    )r%   s   `r)   MakeGetUriFuncrC   R   s	    	FFr+   c                 ,    | j                  dd|       y )Nz	--projectTr8   r9   r:   s     r)   AddProjectArgrE   V   s    kDyAr+   c                 ,    | j                  dd|       y )N
--locationTr8   r9   r:   s     r)   AddLocationArgrH   Z   s    lT	Br+   c                      g } r7|j                  t        j                   fddj                                      t	        j
                  dd|      S )z.Gets Google Cloud location resource attribute.c                       S r>   rB   )r/   s   r)   rA   z)LocationAttributeConfig.<locals>.<lambda>d   s    Gr+   z:Location of the Mirroring Deployment Group. Defaults to {}r   r   )r   r5   fallthroughs)appendr
   Fallthroughformatr	   r    )r/   rK   s   ` r)   LocationAttributeConfigrO   ^   sY    ,HOO	
 
	2	2-
 r+   c                  `    t        j                  ddt               t         j                        S )z?Constructs and returns the Resource specification for Location.z"networksecurity.projects.locationsr   )resource_namer   r   )r	   r   rO   r   rB   r+   r)   GetLocationResourceSpecrR   q   s*    			*)+::	
 r+   r&   c                 x    t         j                  j                  dt               |d      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.
  rG   T)r   N)r   r#   ForResourcerR   r$   r:   s     r)   AddLocationResourceArgrU   {   s8     ++	 , 
 Kr+   c                     t        j                  dddt         j                  t        j                  ddd            }t	        j
                  d|d	d
      }t        j                  |g      j                  |       S )zAdds network resource.zcompute.networksnetworkv1znetwork-namezName of the {resource}r   )r   projectrW   z	--networkTr   r   )	r	   r   r   r    r   r!   r   r#   r$   )r&   r'   r(   s      r)   AddNetworkResourcerZ      s|    ''7777

""
- )AA .	 
	&	&(9':	;	G	G	OOr+   N)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.)z-Description of the mirroring deployment group)z"Project ID of the deployment group)z Location of the deployment group)global)__doc__
__future__r   r   r   Cgooglecloudsdk.api_lib.network_security.mirroring_deployment_groupsr   googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr	   r
   (googlecloudsdk.command_lib.util.conceptsr   r   r"   r*   r6   r;   rC   rE   rH   rO   rR   ArgumentInterceptorrU   rZ   rB   r+   r)   <module>rc      s    5 &  ' S / 4 5 1 D G!= P< c" FGGBC&00"Pr+   