
                             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Z G d	 d
e	j                        Zd Zd Zd Zd ZddZy)z?Flags and helpers for the compute network-attachments commands.    )absolute_import)division)unicode_literals)arg_parsers)
completers)flagszQ    table(
      name,
      region.basename(),
      connection_preference
    )c                        e Zd Z fdZ xZS )NetworkAttachmentsCompleterc                 2    t        t        | 
  dddd| y )Ncompute.networkAttachmentsz&compute network-attachments list --uri)
collectionlist_command )superr
   __init__)selfkwargs	__class__s     Clib/googlecloudsdk/command_lib/compute/network_attachments/flags.pyr   z$NetworkAttachmentsCompleter.__init__#   s(    	
%t5 /=     )__name__
__module____qualname__r   __classcell__)r   s   @r   r
   r
   !   s     r   r
   c                 ,    | j                  ddd       y)z#Add support for --description flag.z--descriptionNz<An optional, textual description for the network attachment.)defaulthelpadd_argumentparsers    r   AddDescriptionr"   *   s    I  Kr   c                 6    | j                  dddgd dd       y)z-Add support for --connection-preference flag.z--connection-preferenceACCEPT_AUTOMATICACCEPT_MANUALc                 B    | j                  dd      j                         S )N-_)replaceupper)xs    r   <lambda>z)AddConnectionPreference.<locals>.<lambda>7   s    QYYsC(..0r   a        The connection preference of network attachment.
      The value can be set to ACCEPT_AUTOMATIC or ACCEPT_MANUAL.
      An ACCEPT_AUTOMATIC network attachment is one that
      always accepts the connection from producer NIC.
      An ACCEPT_MANUAL network attachment is one that
      requires an explicit addition of the producer project id
      or project number to the producer accept list.
      )choicestyper   r   Nr   r    s    r   AddConnectionPreferencer/   2   s+    !?30 
  r   c                 T    | j                  dt        j                         ddd       y)z,Add support for --producer-reject-list flag.z--producer-reject-listREJECT_LISTNzQ      Projects that are not allowed to connect to this network attachment.
      r.   metavarr   r   r   r   ArgListr    s    r   AddProducerRejectListr6   D   /     
  r   c                 T    | j                  dt        j                         ddd       y)z,Add support for --producer-accept-list flag.z--producer-accept-listACCEPT_LISTNzM      Projects that are allowed to connect to this network attachment.
      r2   r4   r    s    r   AddProducerAcceptListr:   P   r7   r   c                 \    t        j                  dt        || dt         j                        S )Nznetwork attachmentr   )resource_name	completerpluralrequiredregional_collectionregion_explanation)compute_flagsResourceArgumentr
   REGION_PROPERTY_EXPLANATION)r?   r>   s     r   NetworkAttachmentArgumentrE   \   s/    		'	'(+6&BB
D Dr   N)TF)__doc__
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   compute_completersr   rB   DEFAULT_LIST_FORMATListCommandCompleterr
   r"   r/   r6   r:   rE   r   r   r   <module>rM      sS    F &  ' / O E	 "4"I"I K$		Dr   