
    d                        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ej                   ej                  ej                   j(                         G d d	e                    Zej                   ej                  ej                   j,                         G d
 de                    Zy)z?Command for creating partner provider interconnect attachments.    )base_classes)client)base)flagsc                   6    e Zd ZdZdZdZdZdZed        Z	d Z
y)Createm  Create a Compute Engine partner provider interconnect attachment.

  *{command}* is used to create partner provider interconnect attachments. An
  interconnect attachment binds the underlying connectivity of an Interconnect
  to a path into and out of the customer's cloud network. Partner provider
  attachments can only be created by approved network partners.
  NFc                 2   t        j                  d      | _        | j                  j                  |       t	        j
                         | _        | j                  j                  |d       t	        j                  |d       t	        j                  |       t	        j                  |       t	        j                  |d       t	        j                  |       t	        j                  |       t	        j                  |       t	        j                  |       y )Nz0The interconnect for the interconnect attachmentcreate)operation_typeT)required)interconnect_flags$InterconnectArgumentForOtherResourceINTERCONNECT_ARGAddArgumentattachment_flagsInterconnectAttachmentArgumentINTERCONNECT_ATTACHMENT_ARGAddBandwidthAddVlanAddPartnerAsnAddPartnerMetadataAddPairingKeyAddDescriptionAddCandidateSubnetsAddSubnetLength)clsparsers     @lib/surface/compute/interconnects/attachments/provider/create.pyArgszCreate.Args(   s     	??>	@  $$V, 	779 ###//x/P!!&48V$""6*''>""6*##F+((0$$V,    c                 n   t        j                  | j                               }| j                  j	                  ||j
                  t        j                  |j                              }t        j                  ||j                        }d }|j                  &| j                  j	                  ||j
                        }d }d }d }| j                  r&|j                  }t        |dd       }t        |dd       }|j                  |j                   ||j"                  d|j$                  |j&                  |j(                  |j*                  |j,                  |j.                  |j0                  t        |dd       t        |dd       |||t        |dd       t        |d	d       t        |d
d       t        |dd             S )N)scope_lister)compute_clientcloud_router_ipv6_interface_id!customer_router_ipv6_interface_idPARTNER_PROVIDERsubnet_lengthdry_run!candidate_cloud_router_ip_address$candidate_customer_router_ip_address#candidate_cloud_router_ipv6_address&candidate_customer_router_ipv6_address)descriptioninterconnectvlan_tag_802_1qattachment_type	bandwidthpairing_keycandidate_subnetspartner_asnpartner_namepartner_interconnectpartner_portal_urlr(   validate_onlycandidate_ipv6_subnetsr%   r&   r*   r+   r,   r-   )r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   InterconnectAttachmentr/   r   _support_partner_ipv6_byoipr:   getattrr   r.   vlanr2   r3   r4   r5   r6   partner_interconnect_namer8   )	selfargsholderattachment_refinterconnect_attachmentinterconnect_refr:   r%   r&   s	            r   Runz
Create.Run=   s   **4+<+<+>?F55GG"88G H IN
 %;;v}}6 $..@@
  " "%)"(,%''#::'.
0$($ +2
3T+' #))$$%		*..$$00$$&&!;;22dOT:dIt45'E*K*15t+
 .58$.
 -47-
 07:D0
5 *  r!   )__name__
__module____qualname____doc__r   r   
ROUTER_ARGrB   classmethodr    rL    r!   r   r   r      s7     !%* %- -(8r!   r   c                   ,     e Zd ZdZe fd       Z xZS )
CreateBetar	   c                     t         t        |   |       t        j                  |       t        j
                  |       t        j                  |       t        j                  |       y N)superrU   r    r    AddCandidateCloudRouterIpAddress#AddCandidateCustomerRouterIpAddress"AddCandidateCloudRouterIpv6Address%AddCandidateCustomerRouterIpv6Addressr   r   	__class__s     r   r    zCreateBeta.Args   sJ    	*c'55f=88@77?::6Br!   )rM   rN   rO   rP   rR   r    __classcell__r^   s   @r   rU   rU   x   s     C Cr!   rU   c                   0     e Zd ZdZdZe fd       Z xZS )CreateAlphar	   Tc                     t         t        |   |       t        j                  |       t        j
                  |       t        j                  |       t        j                  |       y rW   )rX   rb   r    r   	AddDryRunAddCandidateIpv6SubnetsAddCloudRouterIpv6InterfaceId AddCustomerRouterIpv6InterfaceIdr]   s     r   r    zCreateAlpha.Args   sJ    	+s (v&,,V4226:55f=r!   )rM   rN   rO   rP   rB   rR   r    r_   r`   s   @r   rb   rb      s"     !%> >r!   rb   N)rP   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.interconnects.attachmentsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r?   0googlecloudsdk.command_lib.compute.interconnectsr   <googlecloudsdk.command_lib.compute.interconnects.attachmentsr   UniverseCompatibleReleaseTracksr<   GACreateCommandr   BETArU   ALPHArb   rS   r!   r   <module>rt      s    F 7 K ( E X b D%%(()ZT Z * Zz D%%**+C C , C$ D%%++,>* > - >r!   