
                            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
 r\R                  \R                   " \R"                  R$                  5       " S S\R&                  5      5       5       r\R                   " \R"                  R*                  5       " S S\5      5       r\R                   " \R"                  R.                  5       " S S\5      5       rg)z5Command for modifying the properties of a subnetwork.    )absolute_import)division)unicode_literals)base_classes)subnets_utils)utils)base)flagsc                      SSSS.$ )N<Updates properties of an existing Compute Engine subnetwork.zm          *{command}* is used to update properties of an existing Compute Engine
          subnetwork.
      z        To enable external IPv6 addresses on the subnetwork example-subnet-1 in
        network-1, run

        $ {command} example-subnet-1 --stack-type=IPV4_IPV6 --ipv6-access-type=EXTERNAL --region=REGION
      )briefDESCRIPTIONEXAMPLES r       .lib/surface/compute/networks/subnets/update.py_DetailedHelpr      s     I



 r   c                   `    \ rS rSrSrSrSr\R                  r	Sr
\" 5       r\S 5       rS rSrg)	Update1   r   FTc                 6   [         R                  " 5       U l        U R                  R                  USS9  [         R                  " 5       R                  USS9  [         R
                  " UU R                  U R                  U R                  U R                  5        g)zUThe command arguments handler.

Args:
  parser: An argparse.ArgumentParser instance.
update)operation_typeN)
r
   SubnetworkArgumentSUBNETWORK_ARGAddArgumentIpCollectionArgumentAddUpdateArgs_include_alpha_logging"_include_allow_cidr_routes_overlap_api_version_update_purpose_to_private)clsparsers     r   ArgsUpdate.Args<   s     113C""6("C	 ,,VH,M	""..&&r   c                    [         R                  " U R                  5       5      nUR                  nU R                  R                  XR                  5      nUR                  nUR                  nUR                  nUR                  nUR                  n	U R                  (       aK  UR                  b  UR                  nUR                  b  UR                  nUR                  b  UR                  nSn
UR                   nUR"                  b  [%        USS5      S:H  n
SnUR&                  b  [%        USS5      nUR(                  nSnU R*                  (       a  UR,                  n[%        USS5      n[%        USS5      n[%        USS5      n[%        USS5      n[%        US	S5      nSnUR.                  (       a<  [0        R2                  " 5       R                  XR                  5      R5                  5       n[6        R8                  " UU40 S
UR:                  _SUR<                  _SU_SUR>                  _SUR@                  _SU_SU_SU_SU_SU	_SU
_SU_SU_SU_SU_SU_SU_SU_S	U_SU_6$ )z0Issues requests necessary to update Subnetworks.NroleACTIVEpurpose
stack_typeipv6_access_type1add_secondary_ranges_with_reserved_internal_rangeexternal_ipv6_prefixinternal_ipv6_prefixenable_private_ip_google_accessadd_secondary_rangesremove_secondary_rangesenable_flow_logsaggregation_intervalflow_samplingmetadatafilter_exprmetadata_fieldsset_role_activeset_new_purposedrain_timeout_secondsprivate_ipv6_google_access_typeallow_cidr_routes_overlapip_collection)!r   ComputeApiHolderReleaseTrackclientr   ResolveAsResource	resourceslogging_aggregation_intervallogging_flow_samplinglogging_metadatalogging_filter_exprlogging_metadata_fieldsr   r4   r5   r6   drain_timeoutr(   getattrr*   r<   r    r=   r>   r
   r   SelfLinkr   MakeSubnetworkUpdateRequestr0   r1   r2   r3   )selfargsholderrA   
subnet_refr4   r5   r6   r7   r8   r9   r;   r:   r<   r=   r+   r,   reserved_internal_rangesr.   r/   r>   s                        r   Run
Update.RunP   s   **4+<+<+>?F]]F$$66t=M=MNJ<<..M$$H**K22O""		"	"	.#88				'**		"==O ..yyfd3x?oO||i6o&*&J&J# $.."&"@"@|T2Jt%7>&A4 I #4)?F"4)?FM002DD
  
  44 )-(L(L "66	
 ;S !% < < .. 2 $    ( ( ( 4  )H!" #<#$ %& *'( 2)* 2+, $- r   r   N)__name__
__module____qualname____firstlineno____doc__r   r    compute_apiCOMPUTE_GA_API_VERSIONr!   r"   r   detailed_helpclassmethodr%   rR   __static_attributes__r   r   r   r   r   1   sD     E ',$33,#/- &Ir   r   c                   4    \ rS rSrSrSr\R                  rSr	g)
UpdateBeta   r   Tr   N)
rT   rU   rV   rW   rX   r    rY   COMPUTE_BETA_API_VERSIONr!   r]   r   r   r   r_   r_      s    D'+$55,r   r_   c                   <    \ rS rSrSrSrSr\R                  r	Sr
Srg)UpdateAlpha   r   Tr   N)rT   rU   rV   rW   rX   r   r    rY   COMPUTE_ALPHA_API_VERSIONr!   r"   r]   r   r   r   rc   rc      s"    D'+$66,#r   rc   N)rX   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r   rY   googlecloudsdk.callioper	   3googlecloudsdk.command_lib.compute.networks.subnetsr
   r   UniverseCompatibleReleaseTracksr@   GAUpdateCommandr   BETAr_   ALPHArc   r   r   r   <module>rp      s    < &  ' 7 8 ? ( E* D%%(()fT f * fR D%%**+6 6 ,6 D%%++,$* $ -$r   