
                            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(                  5       " S S\	R*                  5      5       r\	R.                  " SSS9\	R$                  " \	R&                  R0                  5       " S S\5      5       5       rg)z&Command to update a Datastream Stream.    )absolute_import)division)unicode_literals)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                 8   [         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        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AddStateFlagr	   AddLabelsUpdateFlags)parserrelease_tracks     (lib/surface/datastream/streams/update.py
CommonArgsUpdate.CommonArgsD   su     &&-%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.ArgsW   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(   rD   __static_attributes__rF   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"   rF   N)rG   rH   rI   rJ   rK   r   EXAMPLES_BETArL   rM   r(   rN   rF   r"   r   rR   rR   |   s#     %"-=I-6 6r"   rR   N)rK   
__future__r   r   r   !googlecloudsdk.api_lib.datastreamr   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.datastreamr	   r
   -googlecloudsdk.command_lib.datastream.streamsr   r   r   rW   ReleaseTracksr%   r&   Commandr   	DeprecaterU   rR   rF   r"   r   <module>r`      s    - &  ' 5 2 ( 7 ? P
  D%%(()9.T\\ 9. *9.x ;
 D%%**+6 6 ,6r"   