
                             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 ej                   ej                  ej                   j"                         G d dej$                                      Zy	)
z<Command for updating L2 forwarding interconnect attachments.    )base_classes)client)base)flags)labels_utilc                   8    e Zd ZdZdZdZdZd Zed        Z	d Z
y)Updatea  Update a Compute Engine L2 forwarding interconnect attachment.

  *{command}* is used to update interconnect attachments. An interconnect
  attachment is what binds the underlying connectivity of an interconnect to a
  path into and out of the customer's cloud network.
  Nc                    t        j                  | j                               }| j                  j	                  ||j
                  t        j                  |j                              }t        j                  ||j                        S )N)scope_lister)compute_client)
r   ComputeApiHolderReleaseTrackINTERCONNECT_ATTACHMENT_ARGResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   InterconnectAttachment)selfargsholderattachment_refs       Elib/surface/compute/interconnects/attachments/l2_forwarding/update.py_get_attachmentzUpdate._get_attachment&   st    **4+<+<+>?F55GG"88G H IN ((v}}6 6    c                    t        j                         | _        | j                  j                  |d       t        j                  |       t        j
                  |       t        j                  |d       t        j                  |       t        j                  |d       t        j                  |       t        j                  |       y )Npatch)operation_typeF)required)attachment_flagsInterconnectAttachmentArgumentr   AddArgumentAddDescriptionAddEnableAdminAddBandwidthAddMtuAddGeneveVniAddDefaultApplianceIpAddressr   AddUpdateLabelsFlags)clsparsers     r   ArgszUpdate.Args/   s     	779 ###//w/O##F+##F+!!&59F#!!&5911&9$$V,r   c                 h   t        j                  | j                               }| j                  |      }d }d }t        j
                  j                  |      }|j                         rs|j                         }|j                  j                  j                  j                  }|j                  ||j                        j                         }||j                   }|j#                  |j$                  |j&                  ||t)        |dd       t)        |dd       t)        |dd       t)        |dd             S )N)labels	bandwidthmtu
geneve_vnidefault_appliance_ip_address)descriptionadmin_enabledr.   label_fingerprintr/   r0   r1   r2   )r   r   r   r   r   DiffFromUpdateArgsMayHaveUpdatesDescriber   messagesr   LabelsValueApplyr.   	GetOrNonelabelFingerprintPatchr3   enable_admingetattr)	r   r   r   interconnect_attachmentr.   r5   labels_diffold_attachment
labels_clss	            r   Runz
Update.Run=   s"   **4+<+<+>?F"2248F""11$7K!!#.779n==))@@LLj  
^22 ! 44=IK 		*;;"(($$''+$T2D%&4t4%,0$&
 )  r   )__name__
__module____qualname____doc__r   INTERCONNECT_ARG
ROUTER_ARGr   classmethodr,   rF    r   r   r	   r	      s8     !%*6 - -r   r	   N)rJ   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.interconnects.attachmentsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   <googlecloudsdk.command_lib.compute.interconnects.attachmentsr    $googlecloudsdk.command_lib.util.argsr   DefaultUniverseOnlyReleaseTracksr   ALPHAUpdateCommandr	   rN   r   r   <module>rY      se    C 7 K ( E b < D%%++,<T < - <r   