
                             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\R                  5      rg))VMware Engine VPC network peering client.    )absolute_import)division)unicode_literals)
list_pager)util)networks)	arg_utils)	resourcesc                   `   ^  \ rS rSrSrU 4S jrS r         S
S jrS rS r	S r
S	rU =r$ )NetworkPeeringClient   r   c                    > [         [        U ]  5         U R                  R                  U l        [        R                  " 5       U l        g )N)	superr   __init__client"projects_locations_networkPeeringsservicer	   NetworksClientnetworks_client)self	__class__s    3lib/googlecloudsdk/api_lib/vmware/networkpeering.pyr   NetworkPeeringClient.__init__   s3    	
.0;;AADL#224D    c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      nU$ N)name)messages6VmwareengineProjectsLocationsNetworkPeeringsGetRequestRelativeNamer   Get)r   resourcerequestresponses       r   r"   NetworkPeeringClient.Get$   sF    LL&&( 	M 	
 
 ||(HOr   c                    UR                  5       R                  5       R                  5       nUc  UnUR                  5       R                  5       nUR                  5       nU R                  R	                  US9n[
        R                  " SU R                  R                  R                  S S9R                  [
        R                  " U5      5      nUUl
        [        R                  R                  S SU(       a  UOUSUS.S9R                  5       Ul        UU R                  R                  R                  R                  :X  a  S	R!                  XcS
9Ul        OSR!                  XcS
9Ul        U(       a  UUl        UUl        U	Ul        U
Ul        UUl        UUl        U R                  R1                  UUUS9nU R2                  R5                  U5      $ )N)descriptionzpeer-network-typec                     SU ;  $ )NUNSPECIFIED )xs    r   <lambda>-NetworkPeeringClient.Create.<locals>.<lambda>H   s	    a!7r   )arg_namemessage_enuminclude_filterz4vmwareengine.projects.locations.vmwareEngineNetworksglobal)
projectsIdlocationsIdvmwareEngineNetworksId)line
collectionparamszEprojects/{project}/locations/global/vmwareEngineNetworks/{network_id})project
network_idz/projects/{project}/global/networks/{network_id})parentnetworkPeeringnetworkPeeringId)ParentNamer!   r   NetworkPeeringr
   ChoiceEnumMapperPeerNetworkTypeValueValuesEnumGetEnumForChoiceEnumNameToChoicepeerNetworkTyper   REGISTRYParsevmwareEngineNetworkVMWARE_ENGINE_NETWORKformatpeerNetworkpeer_mtuexportCustomRoutesimportCustomRoutesexportCustomRoutesWithPublicIpimportCustomRoutesWithPublicIpexchangeSubnetRoutes9VmwareengineProjectsLocationsNetworkPeeringsCreateRequestr   Create)r   r#   vmware_engine_network_idpeer_network_idpeer_network_typer(   peer_projectrL   export_custom_routesimport_custom_routes#export_custom_routes_with_public_ip#import_custom_routes_with_public_ipexchange_subnet_routesvmware_engine_network_projectr9   r;   
peering_idpeeringpeer_network_type_enumr$   s                       r   rS   NetworkPeeringClient.Create-   s     oo&&(--/Gl__++-FJmm**{*CG&77$]]11	'	'7	9 :J9I&&'89:;	  5G"+"4"4":":I 1 .#&>
 #; # ln  	==''FF\\	] djj k g
 <
B
B" C  
 !g!5G!5G-PG*-PG*#9G OO'J 	P 	
  <<w''r   c                     U R                  U5      n/ nX#l        UR                  S5        U R                  R	                  UUR                  5       SR                  U5      S9nU R                  R                  U5      $ )Nr(   ,)r<   r   
updateMask)	r"   r(   appendr   8VmwareengineProjectsLocationsNetworkPeeringsPatchRequestr!   joinr   Patch)r   r#   r(   r_   update_maskr$   s         r   UpdateNetworkPeeringClient.Updatet   sx    hhx GK%}%NN"&&(xx, 	O 	
  <<g&&r   c                     U R                   R                  U R                  R                  UR	                  5       S95      $ r   )r   Deleter   9VmwareengineProjectsLocationsNetworkPeeringsDeleteRequestr!   )r   r#   s     r   rm   NetworkPeeringClient.Delete   s=    <<OO&&( 	P 	
 r   c                     UR                  5       nU R                  R                  US9n[        R                  " U R
                  USSS9$ )N)r;   pageSizenetworkPeerings)batch_size_attributefield)r!   r   7VmwareengineProjectsLocationsNetworkPeeringsListRequestr   YieldFromListr   )r   location_resourcelocationr$   s       r   ListNetworkPeeringClient.List   sU     --/HMM 	N 	
 
 ##'	! !r   )r   r   )	NNNTTTTTN)__name__
__module____qualname____firstlineno____doc__r   r"   rS   rj   rm   ry   __static_attributes____classcell__)r   s   @r   r   r      sH    15
 *.*.!$(E(N'! !r   r   N)r   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.vmwarer   r	   $googlecloudsdk.command_lib.util.apisr
   googlecloudsdk.corer   VmwareClientBaser   r+   r   r   <module>r      s6    0 &  ' ' . 2 : )x!400 x!r   