
    #                        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	S
.r\R"                  \R$                  " \R&                  R(                  5       " S S\R*                  5      5       5       r\R"                  \R$                  " \R&                  R.                  5       " S S\5      5       5       r\R"                  \R$                  " \R&                  R2                  5       " S S\5      5       5       rg)z!Command for updating wire groups.    )base_classes)client)base)scope)flags)
propertiesz{        *{command}* is used to update wire groups.

        For an example, refer to the *EXAMPLES* section below.
        a          To disable a wire group, run:

        $ {command} example-wg --cross-site-network=example-csn --no-admin-enabled

        To change a wire group's unmetered bandwidth, run:

        $ {command} example-wg --cross-site-network=example-csn --bandwidth-unmetered=5

        To enable automatic failure detection for a wire group, run:

        $ {command} example-wg --cross-site-network=example-csn --fault-response=DISABLE_PORT

        To enable bandwidth sharing for a wire group, run:

        $ {command} example-wg --cross-site-network=example-csn --bandwidth-allocation=SHARED_WITH_WIRE_GROUP

        To update a wire group's description, run:

        $ {command} example-wg --cross-site-network=example-csn --description="new description"
        )DESCRIPTIONEXAMPLESc                   @    \ rS rSrSr\rSrSr\	S 5       r
S rS rSrg)Update9   Update a Compute Engine wire group.

*{command}* is used to update wire groups. A wire group represents a group of
redundant wires.
Nc                    [         R                  " SS9U l        U R                  R                  USS9  [        R
                  " 5       U l        U R                  R                  U5        [         R                  " U5        [         R                  " USS9  [         R                  " USS9  [         R                  " U5        [         R                  " USS9  [         R                  " U5        g )NF)pluralupdate)operation_type)requiredT)r   )r   WireGroupArgumentWIRE_GROUP_ARGAddArgumentcross_site_network_flags(CrossSiteNetworkArgumentForOtherResourceCROSS_SITE_NETWORK_ARGAddDescriptionAddBandwidthUnmeteredAddBandwidthAllocationAddFaultResponseAddAdminEnabledAddValidateOnly)clsparsers     7lib/surface/compute/interconnects/wire_groups/update.pyArgsUpdate.ArgsH   s    00>C""6("C IIK  **62	 	7	  %8	6"	&.	&!    c                     g)Nzcompute.wireGroups )selfs    r"   
CollectionUpdate.CollectionW   s    r%   c                    [         R                  " U R                  5       5      nU R                  R	                  UUR
                  [        R                  R                  SUR                  0S9n[        R                  R                  R                  R                  5       n[        R                   " UUUR                  UR                  S9nUR#                  UR$                  ['        USS 5      UR(                  ['        USS 5      UR*                  UR,                  ['        USS 5      ['        USS 5      UR.                  S9	$ )	NcrossSiteNetwork)default_scopeadditional_params)compute_clienttypebandwidth_meterednetwork_service_classbandwidth_allocation)	descriptionwire_group_typebandwidth_unmeteredr1   fault_responseadmin_enabledr2   r3   validate_only)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALcross_site_networkr   VALUEScoreproject	GetOrFailr   	WireGroupPatchr4   getattrr6   r7   r8   r9   )r(   argsholderrefrD   
wire_groups         r"   Run
Update.RunZ   s!   **4+<+<+>?F



/
/#--44-t/F/FG	 0 C $$,,668G!!}}	J $$fd3 44!$(;TB**((%d,CTJ$T+A4H((  
 
r%   r'   )__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpr   r   classmethodr#   r)   rM   __static_attributes__r'   r%   r"   r   r   9   s5     !-." " r%   r   c                   6   ^  \ rS rSrSr\U 4S j5       rSrU =r$ )
UpdateBetax   r   c                 P   > [         TU ]  U5        [        R                  " U5        g N)superr#   r   AddTyper    r!   	__class__s     r"   r#   UpdateBeta.Args   s    	GL	MM&r%   r'   	rO   rP   rQ   rR   rS   rV   r#   rW   __classcell__r`   s   @r"   rY   rY   x   s      r%   rY   c                   6   ^  \ rS rSrSr\U 4S j5       rSrU =r$ )UpdateAlpha   r   c                 |   > [         TU ]  U5        [        R                  " U5        [        R                  " U5        g r\   )r]   r#   r   AddBandwidthMeteredAddNetworkServiceClassr_   s     r"   r#   UpdateAlpha.Args   s+    	GL	f%	  (r%   r'   rb   rd   s   @r"   rf   rf      s     ) )r%   rf   N)rS   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.interconnects.wire_groupsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r>   Dgooglecloudsdk.command_lib.compute.interconnects.cross_site_networksr   r   <googlecloudsdk.command_lib.compute.interconnects.wire_groupsgooglecloudsdk.corer   rT   UniverseCompatibleReleaseTracksr;   GAUpdateCommandr   BETArY   ALPHArf   r'   r%   r"   <module>ry      s    ( 8 K ( E r N *
< D%%(():T : * :z D%%**+
 
 , 
 D%%++,)* ) - )r%   