
                            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
ZdZ e	j"                  e	j$                  j&                         G d de	j(                               Z e	j,                  dd       e	j"                  e	j$                  j.                         G d de                    Zy)z%Command to create a datastream route.    )absolute_import)division)unicode_literals)routes)util)base)flags)resource_argsz,Create a Datastream private connection routez    To create a route called 'my-route', run:

        $ {command} my-route --location=us-central1 --private-connection=private-connection --display-name=my-display-name --destination-address=addr.path.to.somewhere --destination-port=33665


   c                   0    e Zd ZdZeedZed        Zd Z	y)Create-Create a Datastream private connection route.)DESCRIPTIONEXAMPLESc                     t        j                  | d       t        j                  |        t        j                  |        t        j
                  |        t        j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    z	to createN)r
   AddRouteResourceArgroutes_flagsAddDisplayNameFlagAddDestinationAddressFlagAddDestinationPortFlagr	   AddLabelsCreateFlags)parsers    'lib/surface/datastream/routes/create.pyArgszCreate.Args,   sL     %%fk:##F+**62''/	v&    c                 0   |j                   j                  j                         }|j                         j	                         }t        j                         }|j                  ||j                  |      }t        j                         }t        j                         }t        j                         }|j                  d|j                  |j                  |j                        }	|j                   j#                  |j%                  |	j&                              S )a  Create a Datastream route.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Returns:
      A dict object representing the operations resource describing the create
      operation if the create was successful.
    z(datastream.projects.locations.operations)operationsId
projectsIdlocationsId)name)CONCEPTSrouteParseParentRelativeNamer   RoutesClientr   routesIdr   GetClientInstanceGetMessagesModuleGetResourceParserr   r   r   projects_locations_operationsGet/DatastreamProjectsLocationsOperationsGetRequestr   )
selfargs	route_ref
parent_refroutes_clientresult_operationclientmessagesresource_parseroperation_refs
             r   Runz
Create.Run<   s     ##))+I!!#002J'')M$++I&&. ##%F%%'H,,.O#**2%**''))	 + +M //33@@++ 	A 	-. .r   N)
__name__
__module____qualname____doc__r   r   detailed_helpstaticmethodr   r7    r   r   r   r   '   s&    5"-8D-' '.r   r   FzcDatastream beta version is deprecated. Please use`gcloud datastream routes create` command instead.)
is_removedwarningc                       e Zd ZdZy)
CreateBetar   N)r8   r9   r:   r;   r>   r   r   rB   rB   ]   s     6r   rB   N)r;   
__future__r   r   r   !googlecloudsdk.api_lib.datastreamr   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.datastreamr	   r
   ,googlecloudsdk.command_lib.datastream.routesr   r   r   ReleaseTracksReleaseTrackGACommandr   	DeprecateBETArB   r>   r   r   <module>rN      s    , &  ' 4 2 ( 7 ? N > D%%(()2.T\\ 2. *2.j :
 D%%**+6 6 ,6r   