
                            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 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.    )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\R                  rSr	\
" 5       r\S 5       rS rSrg)	Update.   r	   FTc                     [         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                  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_api_version_update_purpose_to_private)clsparsers     r   ArgsUpdate.Args8   sv     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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<  [.        R0                  " 5       R                  XR                  5      R3                  5       n[4        R6                  " UU40 S
UR8                  _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   r0   r1   r2   drain_timeoutr$   getattrr&   r8   r9   r:   r   r   SelfLinkr   MakeSubnetworkUpdateRequestr,   r-   r.   r/   )selfargsholderr=   
subnet_refr0   r1   r2   r3   r4   r5   r7   r6   r8   r9   r'   r(   reserved_internal_rangesr*   r+   r:   s                        r   Run
Update.RunK   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   compute_apiCOMPUTE_GA_API_VERSIONr   r   r   detailed_helpclassmethodr!   rN   __static_attributes__r   r   r   r   r   .   s>     E 33,#/- $Fr   r   c                   0    \ rS rSrSr\R                  rSrg)
UpdateBeta   r	   r   N)	rP   rQ   rR   rS   rT   rU   COMPUTE_BETA_API_VERSIONr   rY   r   r   r   r[   r[      s    D55,r   r[   c                   8    \ rS rSrSrSr\R                  rSr	Sr
g)UpdateAlpha   r	   Tr   N)rP   rQ   rR   rS   rT   r   rU   COMPUTE_ALPHA_API_VERSIONr   r   rY   r   r   r   r_   r_      s    D66,#r   r_   N)rT   googlecloudsdk.api_lib.computer   r   r   rU   googlecloudsdk.callioper   3googlecloudsdk.command_lib.compute.networks.subnetsr   r   UniverseCompatibleReleaseTracksr<   GAUpdateCommandr   BETAr[   ALPHAr_   r   r   r   <module>rk      s    < 8 8 ? ( E* D%%(()aT a * aH D%%**+6 6 ,6 D%%++,$* $ -$r   