
                            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rSrS	r\R                  \R                  " \R                   R"                  5       " S
 S\R$                  5      5       5       r\R(                  " SSS9\R                  " \R                   R*                  5       " S S\5      5       5       rg)z&Command to update a Datastream Stream.    )streams)util)base)flags)resource_argsz    Update 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 update a stream with a new source and new display name:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source=source --update-mask=display_name,source

    To update a stream's state to RUNNING:

        $ {command} STREAM --location=us-central1 --state=RUNNING --update-mask=state

    To update a stream's oracle source config:

        $ {command} STREAM --location=us-central1 --oracle-source-config=good_oracle_cp.json --update-mask=oracle_source_config.include_objects

   a	      To update a stream with a new source and new display name:

        $ {command} STREAM --location=us-central1 --display-name=my-stream --source-name=source --update-mask=display_name,source_name

    To update a stream's state to RUNNING:

        $ {command} STREAM --location=us-central1 --state=RUNNING --update-mask=state

    To update a stream's oracle source config:

        $ {command} STREAM --location=us-central1 --oracle-source-config=good_oracle_cp.json --update-mask=oracle_source_config.allowlist

   c                   H    \ rS rSrSr\\S.r\S 5       r	\S 5       r
S rSrg)	Update<   Updates a Datastream stream.DESCRIPTIONEXAMPLESc                 d   [         R                  " U SUSS9  [        R                  " U 5        [        R                  " U SS9  [        R
                  " U SS9  [        R                  " U S5        [        R                  " U 5        [        R                  " U 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.
updateF)requiredr	   N)r   AddStreamResourceArgstreams_flagsAddUpdateMaskFlagAddDisplayNameFlagAddBackfillStrategyGroupAddValidationGroupAddStateFlagAddRuleSetsFlagr   AddLabelsUpdateFlags)parserrelease_tracks     (lib/surface/datastream/streams/update.py
CommonArgsUpdate.CommonArgsB   s     &&-%9##F+$$Ve<**6EB$$VX6v&!!&)	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Update.ArgsV   s      fd//223r    c                    UR                   R                  R                  5       n[        R                  " 5       nUR                  UR                  5       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Parser   StreamsClientr	   RelativeNamer#   r   GetClientInstanceGetMessagesModuleGetResourceParserCreater,   r*   r+   projects_locations_operationsGet/DatastreamProjectsLocationsOperationsGetRequestr)   )	selfargs
stream_refstream_clientresult_operationclientmessagesresource_parseroperation_refs	            r   Run
Update.Run[   s     %%++-J))+M$++J,C,C,E,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	   <   s<     %"-8D-' '& 4 4.r    r	   FzdDatastream beta version is deprecated. Please use`gcloud datastream streams update` command instead.)
is_removedwarningc                   2    \ rS rSrSr\\S.r\S 5       r	Sr
g)
UpdateBeta{   r   r   c                 `    [         R                  U [        R                  R                  5        gr"   )r	   r   r   r#   BETAr%   s    r   r&   UpdateBeta.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   !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    - 6 2 ( 7 ? P
  D%%(():.T\\ :. * :.z ;
 D%%**+6 6 ,6r    