
    
                        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dZ ej                   ej"                  j$                        ej&                   G d dej(                                      Zy)zCommand to create a channel.    )absolute_import)division)unicode_literals)channels)base)flags)labels_util)logz{description}a           To create a new channel `my-channel` in location `us-central1`, run:

          $ {command} my-channel --location=us-central1

        To create a new channel `my-channel` in location `us-central1` with a Cloud KMS CryptoKey, run:

          $ {command} my-channel --location=us-central1 --crypto-key=projects/PROJECT_ID/locations/KMS_LOCATION/keyRings/KEYRING/cryptoKeys/KEY
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)CreatezCreate an Eventarc channel.c                     t        j                  |       t        j                  |dd       t        j                  |       t
        j                  j                  |       y )NF)
with_clearhidden)r   AddCreateChannelArgAddCryptoKeyArgr	   AddCreateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     'lib/surface/eventarc/channels/create.pyArgszCreate.Args3   sB    	f%	&U5A$$V,OO'    c                    t        j                         }|j                  j                  j	                         }|j                         j                         j                         }|j                         j                         }t        j                  dj                  |j                         ||             |j                  j                  j	                         }|j                  ||j                  |||j                  t        j                  ||j!                                           }|j"                  r|S |j%                  |d|      S )zRun the create command.z1Creating channel {} for project {} in location {}Creating)r   ChannelClientV1CONCEPTSchannelParseParentNamer
   debugformatproviderr   BuildChannel
crypto_keyr	   ParseCreateArgsLabelsValueClsasync_WaitFor)selfargsclientchannel_refproject_namelocation_nameprovider_ref	operations           r   Runz
Create.Run:   s   %%'F--''--/K%%'..0557L&&(--/MIIAHHL-9 :==))//1LOO''f.C.C.EF		
I {{>>)Z==r   N)	__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpclassmethodr   r5    r   r   r   r   ,   s#     $ -( (>r   r   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   r:   ReleaseTracksReleaseTrackGADefaultUniverseOnlyCreateCommandr   r=   r   r   <module>rI      s{    # &  ' 4 ( 5 < #
 			  D%%(()">T ">  *">r   