
                         X   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
dZ ej                  dddd      Z ej                  dddd      Z ej"                  ej$                  j&                        ej(                   G d dej*                                      Zy)z'Command to create a channel connection.    )absolute_import)division)unicode_literals)channel_connections)base)flags)logz{description}a          To create a new channel connection ``my-channel-connection'' for channel ``my-channel'' with activation token ``channel-activation-token'', run:

          $ {command} my-channel-connection --channel=my-channel --activation-token=channel-activation-token
        )DESCRIPTIONEXAMPLESz--activation-tokenactivation_tokenz+Activation token for the specified channel.T)desthelprequiredz	--channelchannelzSubscriber channel for which to create the channel connection. This argument should be the full channel name, including project, location and the channel id. c                   *    e Zd ZdZeZed        Zd Zy)Createz&Create an Eventarc channel connection.c                     t        j                  |d       t        j                  |       t        j                  |       t        j
                  |d       t        j                  j                  |       y )NzChannel connection to create.z*Labels to apply to the channel connection.)	help_text)r   AddChannelConnectionResourceArgCHANNEL_FLAGAddToParserACTIVATION_TOKEN_FLAGAddLabelsArgr   
ASYNC_FLAG)clsparsers     2lib/surface/eventarc/channel_connections/create.pyArgszCreate.Args9   sZ    	))&*IKV$%%f-	F 	OO'    c           	      6   t        j                         }|j                  j                  j	                         }|j                         j                         j                         }|j                         j                         }t        j                  dj                  |j                         ||             |j                  ||j                  ||j                  |j                  |j                              }|j                  r|S |j!                  |d|      S )zRun the create command.z1Creating channel {} for project {} in location {})r   r   labelsCreating)r   ChannelConnectionClientV1CONCEPTSchannel_connectionParseParentNamer	   debugformatr   BuildChannelConnectionr   r   r!   async_WaitFor)selfargsclientchannel_connection_refproject_namelocation_name	operations          r   Runz
Create.RunD   s     ::<F!]]==CCE)00299;@@BL*11388:MIIAHH##%|]D E%%"LL!22;;	 	& 	
I {{>>)Z1GHHr   N)	__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpclassmethodr   r5    r   r   r   r   2   s$     / -( (Ir   r   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   googlecloudsdk.corer	   r:   Argumentr   r   ReleaseTracksReleaseTrackGADefaultUniverseOnlyCreateCommandr   r=   r   r   <module>rI      s    . &  ' ? ( 5 # 				 &		:	  t}}	 
n	 D%%(()%IT %I  *%Ir   