
    '                        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r\	R$                  " \	R&                  R(                  5      \	R*                   " S S\	R,                  5      5       5       r\	R$                  " \	R&                  R0                  5       " S S\5      5       r\	R$                  " \	R&                  R4                  5       " S S\5      5       rg
)z)Command for creating target VPN Gateways.    )absolute_import)division)unicode_literals)base_classes)arg_parsers)base)flags)resource_manager_tags_utilsNc                   F    \ rS rSrSrSrSrSr\S 5       r	S r
S rS rS	rg)
Create   p  Create a Cloud VPN Classic Target VPN Gateway.

  *{command}* is used to create a Cloud VPN Classic Target VPN Gateway. A
Target VPN Gateway can reference one or more VPN tunnels that connect it to
the remote tunnel endpoint. A Target VPN Gateway may also be referenced by
one or more forwarding rules that define which packets the
gateway is responsible for routing.
NFc                    UR                   R                  [        R                  5        [        R
                  " S5      U l        U R                  R                  U5        [        R                  " 5       U l	        U R                  R                  USS9  UR                  SSS9  U R                  (       a%  UR                  S[        R                  " 5       SS	S
9  UR                   R                  [        R                  5        g)z&Adds arguments to the supplied parser.z]        A reference to a network in this project to
        contain the VPN Gateway.
        create)operation_typez--descriptionz<An optional, textual description for the target VPN Gateway.)helpz--resource-manager-tagsz	KEY=VALUEzh            A comma-separated list of Resource Manager tags to apply to the target VPN gateway.
        )typemetavarr   N)display_info	AddFormatr	   DEFAULT_LIST_FORMATnetwork_flagsNetworkArgumentForOtherResourceNETWORK_ARGAddArgumentTargetVpnGatewayArgumentTARGET_VPN_GATEWAY_ARGadd_argument_support_tagging_at_creationr   ArgDictAddCacheUpdaterTargetVpnGatewaysCompleter)clsparsers     1lib/surface/compute/target_vpn_gateways/create.pyArgsCreate.Args/   s     !!%";";<#CC	CO
 OO'!&!?!?!AC**6(*K
K  M ''
#""$	   ''(H(HI    c                    [         R                  " U R                  5       5      nUR                  nUR                  nU R
                  R                  UUR                  [        R                  " U5      S9nU R                  R                  XR                  5      nSnU R                  (       a(  UR                  b  U R                  XAR                  5      nU R                  (       as  Ubp  UR                  R                  UR                  UR                   UR                  R#                  UR$                  UR'                  5       UR)                  5       US9S9nOnUR                  R                  UR                  UR                   UR                  R#                  UR$                  UR'                  5       UR)                  5       S9S9nUR+                  UR,                  R.                  SU4/5      $ )zIssues API requests to construct Target VPN Gateways.

Args:
  args: argparse.Namespace, The arguments received by this command.

Returns:
  [protorpc.messages.Message], A list of responses returned
  by the compute API.
)scope_listerN)descriptionnamenetworkparams)projectregiontargetVpnGateway)r+   r,   r-   Insert)r   ComputeApiHolderReleaseTrackclientmessagesr   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   r   resource_manager_tags_CreateTargetVpnGatewayParams%ComputeTargetVpnGatewaysInsertRequestr/   r0   TargetVpnGatewayr+   NameSelfLinkMakeRequestsapitools_clienttargetVpnGateways)	selfargsholderr5   r6   target_vpn_gateway_refnetwork_refr.   requests	            r%   _RunCreate._RunK   s    **4+<+<+>?F]]FH "88JJ"88@ K B ""44T;K;KLKF((		#	#	/3300
 ((V-?EE(00'..!??;;**)..0!**,	 <  F 	g EE(00'..!??;;**)..0!**, <  F g 

 
 
2
2Hg	FG r(   c           	         [         R                  " U5      nUR                  n[        [        R
                  " U5      5       VVs/ s H  u  pVUR                  R                  XVS9PM      nnnU" UR                  US9S9$ s  snnf )N)keyvalue)additionalProperties)resourceManagerTags)r
   GetResourceManagerTagsTargetVpnGatewayParamssortedsix	iteritemsResourceManagerTagsValueAdditionalProperty)rD   r6   r;   resource_manager_tags_mapr.   rM   rN   additional_propertiess           r%   r<   $Create._CreateTargetVpnGatewayParams   s    #::!	
 
 ,,F !/H!IJJJC 	''::s:PJ   ";;!6 < 
 	s   %B c                 $    U R                  U5      $ )z5Issues API requests to construct Target VPN gateways.rJ   rD   rE   s     r%   Run
Create.Run       99T?r(    )__name__
__module____qualname____firstlineno____doc__r   r   r   classmethodr&   rJ   r<   r^   __static_attributes__ra   r(   r%   r   r      s>     +!&J J63j"r(   r   c                   @   ^  \ rS rSrSrSr\U 4S j5       rS rSr	U =r
$ )
CreateBeta   r   Fc                 ,   > [         [        U ]  U5        gz"Set up arguments for this command.N)superrj   r&   r#   r$   	__class__s     r%   r&   CreateBeta.Args   s     
*c'r(   c                 $    U R                  U5      $ zSee base.CreateCommand.r\   r]   s     r%   r^   CreateBeta.Run   r`   r(   ra   rb   rc   rd   re   rf   r   rg   r&   r^   rh   __classcell__rp   s   @r%   rj   rj      s,     "'( ( r(   rj   c                   @   ^  \ rS rSrSrSr\U 4S j5       rS rSr	U =r
$ )CreateAlpha   r   Tc                 ,   > [         [        U ]  U5        grm   )rn   ry   r&   ro   s     r%   r&   CreateAlpha.Args   s     
+s (r(   c                 $    U R                  U5      $ rs   r\   r]   s     r%   r^   CreateAlpha.Run   r`   r(   ra   ru   rw   s   @r%   ry   ry      s,     "&) ) r(   ry   )rf   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer	   r9   r
   +googlecloudsdk.command_lib.compute.networksr   6googlecloudsdk.command_lib.compute.target_vpn_gatewaysrT   ReleaseTracksr4   GAUniverseCompatibleCreateCommandr   BETArj   ALPHAry   ra   r(   r%   <module>r      s    0 &  ' 7 / ( E J N H 
 D%%(()rT r  *rj D%%**+  ,, D%%++,&  -r(   