
    d                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SS	K
Jr  SSKJr  S
rSrSr\	R$                  \	R&                  " \	R(                  R*                  5       " S S\	R,                  5      5       5       r\	R0                  " SSS9\	R&                  " \	R(                  R2                  5       " S S\5      5       5       rg)z7Command to create connection profiles for a datastream.    )absolute_import)division)unicode_literals)streams)util)base)flags)resource_argsz    Create a Datastream stream. If successful, the response body contains a newly created instance of Operation.
    To get the operation result, call: describe OPERATION
    a      To create a stream with an Oracle source and a Google Cloud Storage destination:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source=source --oracle-source-config=source_config.json --destination=destination --gcs-destination-config=destination_config.json --backfill-none

    To create a stream with a MySQL source and a Cloud Storage destination and that excludes some objects from being backfilled:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source=source --mysql-source-config=source_config.json --destination=destination --gcs-destination-config=destination_config.json --backfill-all --mysql-excluded-objects=excluded_objects.json

    To create a stream with an Oracle source and a BigQuery destination:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source=source --oracle-source-config=source_config.json --destination=destination --bigquery-destination-config=destination_config.json --backfill-none

    To create a stream with a PostgreSQL source and a BigQuery destination:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source=source --postgresql-source-config=source_config.json --destination=destination --bigquery-destination-config=destination_config.json --backfill-none

    To create a stream with a MongoDB source and a Cloud Storage destination and that excludes some objects from being backfilled:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source=source --mongodb-source-config=source_config.json --destination=destination --gcs-destination-config=destination_config.json --backfill-all --mongodb-excluded-objects=excluded_objects.json

   a      To create a stream with an Oracle source and a Google Cloud Storage destination:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source-name=source --oracle-source-config=source_config.json --destination-name=destination --gcs-destination-config=destination_config.json --backfill-none

    To create a stream with a MySQL source and a Cloud Storage destination and that excludes some objects from being backfilled:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source-name=source --mysql-source-config=source_config.json --destination-name=destination --gcs-destination-config=destination_config.json --backfill-all --mysql-excluded-objects=excluded_objects.json

   c                   H    \ rS rSrSr\\S.r\S 5       r	\S 5       r
S rSrg)	CreateC   zCreate a Datastream stream.DESCRIPTIONEXAMPLESc                     [         R                  " U SU5        [        R                  " U 5        [        R                  " U 5        [        R
                  " U S5        [        R                  " U 5        g)a  Common arguments for all release tracks.

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.
  release_track: Some arguments are added based on the command release
    track.
creater   N)r
   AddStreamResourceArgstreams_flagsAddDisplayNameFlagAddBackfillStrategyGroupAddValidationGroupr	   AddLabelsCreateFlags)parserrelease_tracks     (lib/surface/datastream/streams/create.py
CommonArgsCreate.CommonArgsI   sP     &&vxG$$V,**62$$VX6	v&    c                 `    [         R                  U [        R                  R                  5        gz@Args is called by calliope to gather arguments for this command.N)r   r   r   ReleaseTrackGAr   s    r   ArgsCreate.Args[   s      fd//223r   c                 H   UR                   R                  R                  5       nUR                  5       R	                  5       n[
        R                  " 5       nUR                  X2R                  U R                  5       U5      n[        R                  " 5       n[        R                  " 5       n[        R                  " 5       nUR                  SUR                  UR                  UR                   S9n	UR"                  R%                  UR'                  U	R(                  S95      $ )zCreate a Datastream stream.

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streamParseParentRelativeNamer   StreamsClientr   	streamsIdr!   r   GetClientInstanceGetMessagesModuleGetResourceParserr*   r(   r)   projects_locations_operationsGet/DatastreamProjectsLocationsOperationsGetRequestr'   )
selfargs
stream_ref
parent_refstream_clientresult_operationclientmessagesresource_parseroperation_refs
             r   Run
Create.Run`   s     %%++-J""$113J))+M$++J8L8L,0,=,=,?G ##%F%%'H,,.O#**2%**((**	 + ,M //33@@++ 	A 	-. .r    N)__name__
__module____qualname____firstlineno____doc__r   r   detailed_helpstaticmethodr   r$   rB   __static_attributes__rD   r   r   r   r   C   s<     $"-8D-' '" 4 4.r   r   FzdDatastream beta version is deprecated. Please use`gcloud datastream streams create` command instead.)
is_removedwarningc                   2    \ rS rSrSr\\S.r\S 5       r	Sr
g)
CreateBeta   zCreates a Datastream stream.r   c                 `    [         R                  U [        R                  R                  5        gr    )r   r   r   r!   BETAr#   s    r   r$   CreateBeta.Args   s      fd//445r   rD   N)rE   rF   rG   rH   rI   r   EXAMPLES_BETArJ   rK   r$   rL   rD   r   r   rP   rP      s#     %"-=I-6 6r   rP   N)rI   
__future__r   r   r   !googlecloudsdk.api_lib.datastreamr   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.datastreamr	   r
   -googlecloudsdk.command_lib.datastream.streamsr   r   r   rU   DefaultUniverseOnlyReleaseTracksr!   r"   Commandr   	DeprecaterS   rP   rD   r   r   <module>r_      s    > &  ' 5 2 ( 7 ? P
,	 D%%(()9.T\\ 9. * 9.x ;= D%%**+6 6 ,	=
6r   