
                            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dZdZdZdZdZdZdZdZdZdZdZdZe
j<                   e
j>                  e
j@                  jB                  e
j@                  jD                  e
j@                  jF                         G d de
jH                                      Z%ee%_&        y)zGCommand for creating new member interconnects in an interconnect group.    )absolute_import)division)unicode_literals)base_classes)client)base)flags)
propertiesz        *{command}* is used to create new member interconnects in an
        interconnect group.

        For an example, refer to the *EXAMPLES* section below.
        a          To create interconnects interconnect1 and interconnect2 in interconnect
        group example-interconnect-group, run:

          $ {command} example-interconnect-group --interconnect-type=DEDICATED
          --link-type=LINK_TYPE_ETHERNET_10G_LR --requested-link-count=1
          --facility=iad-1 --interconnect="name=interconnect1"
          --interconnect="name=interconnect2"
        )DESCRIPTIONEXAMPLESfacilitydescriptionnamez	link-typezrequested-link-countzinterconnect-typezadmin-enabledzno-admin-enabledznoc-contact-emailzcustomer-namezremote-locationzrequested-featuresc                   4    e Zd ZdZdZdZed        Zd Zd Z	y)CreateMemberszCreate new member interconnects in a Compute Engine interconnect group.

  *{command}* creates new member interconnects in a Compute Engine interconnect
  group.
  Nc                 J   t        j                  d      | _        | j                  j                  |d       t        j                  |       t        j
                  |       t        j                  |       t        j                  |       t        j                  |d       y )NF)pluralzcreate members)operation_type)required)
r	   InterconnectGroupArgumentINTERCONNECT_GROUP_ARGAddArgument&AddMemberInterconnectsForCreateMembersAddFacilityAddRemoteLocationAddIntentMismatchBehaviorinterconnect_flags/AddCreateArgsForInterconnectGroupsCreateMembers)clsparsers     :lib/surface/compute/interconnects/groups/create_members.pyArgszCreateMembers.ArgsL   s    !&!@!@!NC**/ +  
008	f	F#	##F+FF    c                      y)Nzcompute.interconnectGroups )selfs    r!   
CollectionzCreateMembers.CollectionZ   s    'r#   c                    t        j                  | j                               }| j                  j	                  ||j
                        }t        j                  j                  j                  j                         }t        j                  |||j                  |j
                        }|j                  j                  }|j                  |j                  |j                   d t#        j$                  ||j&                        |j(                  t#        j*                  ||j,                        |j.                  |j0                  |j2                  |j4                  t#        j6                  ||j8                              }g }|j:                  D ]@  }	t<        |	v rd}
nt>        |	v rd}
nd }
|jA                  |j                  |	jC                  tD              |	jC                  tF              |	jC                  tH              t#        j$                  ||	jC                  tJ                    |	jC                  tL              t#        j*                  ||	jC                  tN                    |
|	jC                  tP              |	jC                  tR              |	jC                  tT              t#        j6                  ||	jC                  tV                                 C |jY                  t#        jZ                  ||j\                        ||      S )N)compute_client	resources)r   r   r   	link_typerequested_link_countinterconnect_typeadmin_enablednoc_contact_emailcustomer_nameremote_locationrequested_featuresTF)intent_mismatch_behaviortemplate_interconnectmember_interconnects)/r   ComputeApiHolderReleaseTrackr   ResolveAsResourcer*   r
   VALUEScoreproject	GetOrFailr   InterconnectGroupmessages4MakeInterconnectGroupsCreateMembersInterconnectInputr   r   r	   GetLinkTyper+   r,   GetInterconnectTyper-   r.   r/   r0   r1   GetRequestedFeaturesr2   interconnect_ADMIN_ENABLED_NO_ADMIN_ENABLEDappendget	_FACILITY_DESCRIPTION_NAME
_LINK_TYPE_REQUESTED_LINK_COUNT_INTERCONNECT_TYPE_NOC_CONTACT_EMAIL_CUSTOMER_NAME_REMOTE_LOCATION_REQUESTED_FEATURESr   GetIntentMismatchBehaviorr3   )r&   argsholderrefr;   interconnect_groupr>   r4   r5   ic_argsr.   s              r!   RunzCreateMembers.Run]   sr   **4+<+<+>?F

%
%
7
7f>N>N
OC$$,,668G11WV]]f>N>N }}%%HOO]]((''$..A!%!:!:#77$00 ,,"44,, 00$99$11  	P 	
 & $$	7	"'!!

Q
Q{{9-!++l3;;u%))(GKK
4KL#*;;/D#E % 9 9GKK(:;! * ',> ?#KK7%kk*:;!&!;!;GKK(;<" R  %6 ++!&!@!@d33"
 41 ,  r#   )
__name__
__module____qualname____doc__r   REMOTE_LOCATION_ARGclassmethodr"   r'   rX   r%   r#   r!   r   r   >   s1    
   (?r#   r   N)'r\   
__future__r   r   r   googlecloudsdk.api_lib.computer   3googlecloudsdk.api_lib.compute.interconnects.groupsr   googlecloudsdk.callioper   0googlecloudsdk.command_lib.compute.interconnectsr	   r   7googlecloudsdk.command_lib.compute.interconnects.groupsgooglecloudsdk.corer
   DETAILED_HELPrH   rI   rJ   rK   rL   rM   rD   rE   rN   rO   rP   rQ   UniverseCompatibleReleaseTracksr7   ALPHABETAGAUpdateCommandr   detailed_helpr%   r#   r!   <module>rn      s     N &  ' 7 F ( X I *& 	
. (  & (  $ *  T..33T5F5F5I5IZD&& Z Zz , r#   