
    8                     :    S r SSKJr  SSKrS rS rS rS rS rg)	z9Code that's shared between multiple networks subcommands.    )resource_manager_tags_utilsNc           	         [         R                  " U5      nU R                  n[        [        R
                  " U5      5       VVs/ s H  u  pEUR                  R                  XES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NetworkParamssortedsix	iteritemsResourceManagerTagsValueAdditionalProperty)messagesresource_manager_tagsresource_manager_tags_mapparamsr   r   additional_propertiess          4lib/googlecloudsdk/api_lib/compute/networks_utils.py_CreateParamsr      s    !88
 
 !!& s}}-FGHH*# %%88S8NH   
 994 : 
 	s   %B c                 X    U R                  S5      b  gU R                  S5      (       a  gg)z-Returns the subnet mode of the input network.	IPv4RangeLEGACYautoCreateSubnetworksAUTOCUSTOMgetnetworks    r   GetSubnetModer!   '   s*    [[){{*++    c                 D    U R                  S0 5      R                  S5      $ )z2Returns the BGP routing mode of the input network.routingConfigroutingModer   r   s    r   GetBgpRoutingModer&   1   s    	_b	)	-	-m	<<r"   c                 <    [        U [        U 5      [        U 5      S9$ )N)x_gcloud_subnet_modex_gcloud_bgp_routing_mode)dictr!   r&   )resources    r   AddModesForListFormatr,   6   s"    	(2 1( ;
= =r"   c                    U R                  UR                  5       UR                  S9nUR                  S:X  a  UR                  Ul        OUR                  S:X  a  SUl        OSUl        U R                  5       Ul        U R                  R                  UR                  R                  5       5      UR                  l        [        USS5      b4  U R                  R                  UR                  5      UR                  l        [        USS5      b  UR"                  UR                  l        [        US	S5      b4  U R                  R'                  UR(                  5      UR                  l        [-        US
5      (       a  UR.                  b  UR.                  Ul        U(       aL  [-        US5      (       a;  UR0                  (       a*  U R                   R3                  UR0                  5      Ul        [-        US5      (       a  UR6                  Ul        [-        US5      (       a  UR:                  Ul        U(       a  UR?                  5       Ul         [        USS5      b  [C        XRD                  5      Ul#        U$ )z3Creates a new network resource from flag arguments.)namedescriptionlegacycustomFTbgp_best_path_selection_modeNbgp_bps_always_compare_medbgp_bps_inter_region_costmtu)network_firewall_policy_enforcement_orderenable_ula_internal_ipv6internal_ipv6_ranger   )$NetworkNamer/   subnet_moderanger   r   NetworkRoutingConfigr$   RoutingModeValueValuesEnumbgp_routing_modeupperr%   getattr'BgpBestPathSelectionModeValueValuesEnumr2   bgpBestPathSelectionModer3   bgpAlwaysCompareMed!BgpInterRegionCostValueValuesEnumr4   bgpInterRegionCosthasattrr5   r6   4NetworkFirewallPolicyEnforcementOrderValueValuesEnum%networkFirewallPolicyEnforcementOrderr7   enableUlaInternalIpv6r8   internalIpv6RangeSelfLinknetworkProfiler   r   r   )r   network_refnetwork_argsnetwork_profile_refsupport_firewall_orderr    s         r   CreateNetworkResourceFromArgsrR   =   s4    <+C+C  E' )$**G8+$)G! %)G!"779'##>>

'
'
-
-
/ 
# \94@L%%MM55	
 2 \7>J// - \6=I%%GG22	
 , \5!!l&6&6&B""GK?! !>>MMBB	D 1 \566$0$I$IG!\011 , @ @G099;G\2D9E"8-O-OPGN	.r"   )	__doc__"googlecloudsdk.command_lib.computer   r   r   r!   r&   r,   rR    r"   r   <module>rV      s+    @ J 
$=
=Dr"   