
                         z   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ dd	lmZ dd
lmZ dddZe
j"                   e
j$                  e
j&                  j(                  e
j&                  j*                  e
j&                  j,                         G d de
j.                                      Zee_        y)z)Command for updating interconnect groups.    )absolute_import)division)unicode_literals)base_classes)client)base)
exceptions)flags)
propertiesz        *{command}* is used to update interconnect groups.

        For an example, refer to the *EXAMPLES* section below.
        a          To update an interconnect group example-interconnect-group's intended
        topology capability to PRODUCTION_CRITICAL, run:

          $ {command} example-interconnect-group
          --intended-topology-capability=PRODUCTION_CRITICAL

        To update an interconnect group example-interconnect-group's description
        to "example interconnect group description", run:

          $ {command} example-interconnect-group
          --description="example interconnect group description"

        To update an interconnect group example-interconnect-group's member
        interconnects to interconnect-1 and interconnect-2, run:

          $ {command} example-interconnect-group
          --interconnects=interconnect-1,interconnect-2
          --update-mask=interconnects

        Although you can add or remove member interconnects using this command,
        it is recommended to add or remove member interconnects using the
        *add-members* and *remove-members* commands.
        )DESCRIPTIONEXAMPLESc                   0    e Zd ZdZdZed        Zd Zd Zy)UpdatezUpdate a Compute Engine interconnect group.

  *{command}* is used to update interconnect groups. An interconnect group
  represents a set of redundant interconnects between Google and the customer.
  Nc                    t        j                  d      | _        | j                  j                  |d       t        j                  |       t        j
                  |       t        j                  |       t        j                  |       y )NF)pluralupdate)operation_type)r
   InterconnectGroupArgumentINTERCONNECT_GROUP_ARGAddArgumentAddDescription&AddIntendedTopologyCapabilityForUpdateGetMemberInterconnectsForUpdateAddUpdateMask)clsparsers     2lib/surface/compute/interconnects/groups/update.pyArgszUpdate.ArgsJ   sf    !&!@!@!NC**6(*K	 	008	))&1	    c                      y)Nzcompute.interconnectGroups )selfs    r   
CollectionzUpdate.CollectionS   s    'r   c                    |j                   /|j                  #|j                  st        j                  g d      t        j                  | j                               }| j                  j                  ||j                        }t        j                  j                  j                  j                         }t!        j"                  |||j                   |j                        }d }|j                  4t%        j&                  |j                   j(                  |j                        }|j+                  |j                   ||j                  |j,                        S )N)z--descriptionz--intended-topology-capabilityz--interconnects)compute_client	resources)descriptiontopology_capabilityinterconnectsupdate_mask)r'   intended_topology_capabilityr)   r	   MinimumArgumentExceptionr   ComputeApiHolderReleaseTrackr   ResolveAsResourcer&   r   VALUEScoreproject	GetOrFailr   InterconnectGroupr
   GetTopologyCapabilitymessagesPatchr*   )r"   argsholderrefr2   interconnect_groupr(   s          r   Runz
Update.RunV   s(    --5""//
P  **4+<+<+>?F

%
%
7
7f>N>N
OC$$,,668G11WV]]f>N>N ((4!77
--
 
 $"C"C ##$$/(($$	 $  r   )	__name__
__module____qualname____doc__r   classmethodr   r#   r<   r!   r   r   r   r   =   s+    
     (r   r   N)r@   
__future__r   r   r   googlecloudsdk.api_lib.computer   3googlecloudsdk.api_lib.compute.interconnects.groupsr   googlecloudsdk.callioper   r	   7googlecloudsdk.command_lib.compute.interconnects.groupsr
   googlecloudsdk.corer   DETAILED_HELPUniverseCompatibleReleaseTracksr.   ALPHABETAGAUpdateCommandr   detailed_helpr!   r   r   <module>rP      s    0 &  ' 7 F ( . I *
B T..33T5F5F5I5I/T / /b % r   