
    A                     r   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	KJr  SS
KJr  \R(                  " 5       r\
R,                  " \
R.                  R0                  \
R.                  R2                  \
R.                  R4                  5       " S S\
R6                  5      5       rg)z2Command to update labels for external VPN gateway.    )absolute_import)division)unicode_literals)base_classes)external_vpn_gateways_utils)base)
exceptions)flags)labels_utilc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	Update"   a  Update a Compute Engine external VPN gateway.

*{command}* updates labels for a Compute Engine external VPN gateway.
For example:

  $ {command} example-gateway \
    --update-labels=k0=value1,k1=value2 --remove-labels=k3

will add/update labels ``k0'' and ``k1'' and remove labels with key ``k3''.

Labels can be used to identify the External VPN gateway and to filter them
as in

  $ {parent_command} list --filter='labels.k1:value2'

To list existing labels

  $ {parent_command} describe example-gateway --format="default(labels)"

EXAMPLESz          To update labels for an external VPN gateway, run:

              $ {command} my-external-gateway                 --update-labels=k0=value1,k1=value2c                 X    [         R                  USS9  [        R                  " U5        g)zaAdds arguments to the supplied parser.

Args:
  parser: The argparse parser to add arguments to.
update)operation_typeN)_EXTERNAL_VPN_GATEWAY_ARGAddArgumentr   AddUpdateLabelsFlags)clsparsers     3lib/surface/compute/external_vpn_gateways/update.pyArgsUpdate.ArgsC   s%     ))&)J$$V,    c                    [         R                  " U R                  5       5      nUR                  R                  n[
        R                  " U5      n[        R                  UUR                  [        R                  " UR                  5      S9n[        R                  R                  U5      nUR                  5       (       d  [         R"                  " SS5      eUR%                  U5      nUR'                  UR(                  R*                  UR,                  5      nUR.                  (       d  U$ UR1                  UUR2                  UR,                  5      n	UR5                  XYSR7                  UR9                  5       5      5      $ )zIssues API requests to update a External VPN gateway.

Args:
  args: argparse.Namespace, The arguments received by this command.
Returns:
  [protorpc.messages.Message], A list of responses returned
  by the compute API.
)scope_listerLABELSzEAt least one of --update-labels or --remove-labels must be specified.z-Updating labels of external VPN gateway [{0}])r   ComputeApiHolderReleaseTrackclientmessagesr   ExternalVpnGatewayHelperr   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   DiffFromUpdateArgsMayHaveUpdatescalliope_exceptionsRequiredArgumentExceptionDescribeApplyGlobalSetLabelsRequestLabelsValuelabelsneeds_update	SetLabelslabelFingerprintWaitForOperationformatName)
selfargsholderr"   helperexternal_gateway_reflabels_diffexternal_vpn_gatewaylabels_updateoperation_refs
             r   Run
Update.RunM   sV    **4+<+<+>?F}}%%H(AA&IF4FF"88G G I
 ""11$7K%%''99
 9: : "??+?@%%''33##%M %%!!$$%9%9%J%J%2%9%9;M ""7>> %%'	)* *r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr   rA   __static_attributes__rC   r   r   r   r   "   s1    , 7- - -%*r   r   N)rH   
__future__r   r   r   googlecloudsdk.api_lib.computer   4googlecloudsdk.api_lib.compute.external_vpn_gatewaysr   googlecloudsdk.callioper   r	   r+   "googlecloudsdk.command_lib.computer
   r&   8googlecloudsdk.command_lib.compute.external_vpn_gatewaysexternal_vpn_gateway_flag$googlecloudsdk.command_lib.util.argsr   ExternalVpnGatewayArgumentr   ReleaseTracksr    ALPHABETAGAUpdateCommandr   rC   r   r   <module>rZ      s    9 &  ' 7 \ ( E E g < 88:  D%%++T->->-C-C%%((*N*T N**N*r   