
                         .   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 ej                   ej                  ej                  j                          G d	 d
e
j"                                      ZddZd Zd Zd Zd Zd Zd Zd Zd Zy)z@Flags and helpers for the compute interconnects groups commands.    )absolute_import)division)unicode_literals)arg_parsers)base)
completers)flagsc                        e Zd Z fdZ xZS )%InterconnectAttachmentGroupsCompleterc                 2    t        t        | 
  dddd| y )N$compute.interconnectAttachmentGroupsz3compute interconnects attachments groups list --uri)
collectionlist_command )superr   __init__)selfkwargs	__class__s     Plib/googlecloudsdk/command_lib/compute/interconnects/attachments/groups/flags.pyr   z.InterconnectAttachmentGroupsCompleter.__init__!   s(    	
/? 9J     )__name__
__module____qualname__r   __classcell__)r   s   @r   r   r      s     r   r   c                 >    t        j                  dt        || d      S )Nzinterconnect attachment groupr   )resource_name	completerpluralrequiredglobal_collection)compute_flagsResourceArgumentr   )r    r   s     r   #InterconnectAttachmentGroupArgumentr$   )   s$    		'	'35>
 r   c                 *    | j                  dd       y)z5Adds description flag to the argparse.ArgumentParser.z--descriptionzT      An optional, textual description for the interconnect attachment group.
      helpNadd_argumentparsers    r   AddDescriptionr,   3   s    
  r   c                 ,    | j                  ddd       y)AAdds IntendedAvailabilitySla flag to the argparse.ArgumentParser.--intended-availability-slaTN      The availability SLA that the user intends this group to support.
      r    r'   Nr(   r*   s    r   #AddIntendedAvailabilitySlaForCreater2   =   s     #
  r   c                 ,    | j                  ddd       y)r.   r/   Fr0   r1   Nr(   r*   s    r   #AddIntendedAvailabilitySlaForUpdater4   H   s     #
  r   c                 *    | j                  dd       y)z4Adds UpdateMask flag to the argparse.ArgumentParser.z--update-maskz      Optional update mask to specify which fields to update. Use commas to
      separate masks. If not specified, all fields present in the command will
      be updated.
      r&   Nr(   r*   s    r   AddUpdateMaskr6   S   s    
  r   c                 >    |y| j                   j                  |      S )a  Converts the intended-availability-sla flag to a message enum.

  Args:
    messages: The API messages holder.
    intended_availability_sla: The intended availability sla flag value.

  Returns:
    An TopologyCapabilityValueValuesEnum of the flag value, or None if absent.
  N)!InterconnectAttachmentGroupIntentAvailabilitySlaValueValuesEnum)messagesintended_availability_slas     r   GetIntendedAvailabilitySlar<   _   s)     &55TT! r   c                 Z    | j                  dt        j                  d      dg dd       y)	5Adds attachments flag to the argparse.ArgumentParser.--attachments   
max_lengthTINTERCONNECT_ATTACHMENTzn      Member interconnect attachments to add to or remove from the interconnect
      attachment group.
      typer    defaultmetavarr'   Nr)   r   ArgListr*   s    r    GetMemberInterconnectAttachmentsrJ   q   s4    "-'
  
r   c                 Z    | j                  dt        j                  d      dg dd       y)	r>   r?   r@   rA   FrC   zi      Member interconnect attachments to add to the interconnect attachment
      group initially.
      rD   NrH   r*   s    r   )GetMemberInterconnectAttachmentsForCreaterL      s4    "-'
  
r   c                     g }| D ]*  }	 |j                  d      \  }}|j                  ||f       , |S # t        $ r t        d| d      w xY w)z7Converts [region/attachment] to [(region, attachment)]./zInvalid attachment: z&. Must be in the format of region/name)split
ValueErrorappend)attachmentsresultsattregion
attachments        r   ParseAttachmentsrW      sm    'c99S>fj
 NNFJ'(  
.   %K
L s	   4AN)TF)__doc__
__future__r   r   r   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   compute_completersr	   r"   UniverseCompatibleReleaseTracksReleaseTrackALPHAListCommandCompleterr   r$   r,   r2   r4   r6   r<   rJ   rL   rW   r   r   r   <module>rb      s    G &  ' / ( O E D%%++,	++	 - 		$r   