
    >                        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SK	Jr  \R                   " \R"                  R$                  5      \R&                   " S S\R(                  5      5       5       r\R                   " \R"                  R,                  \R"                  R.                  5      \R&                   " S S\5      5       5       rg)z%Command to copy a model in Vertex AI.    )
operations)client)apis)base)	constants)endpoint_util)flags)models_util)operations_util)region_utilc                   B   ^  \ rS rSrSrU 4S jr\S 5       rS rSr	U =r
$ )CopyV1     Copy a model.

## EXAMPLES

To copy a model `123` of project `example` from region `us-central1` to region
`europe-west4`, run:

  $ {command} --source-model=projects/example/locations/us-central1/models/123
    --region=projects/example/locations/europe-west4
c                 <   > [         [        U ]
  " U0 UD6  S U l        g N)superr   __init__messagesselfargskwargs	__class__s      lib/surface/ai/models/copy.pyr   CopyV1.__init__,   s    	&$ $1&1DM    c                 N    [         R                  " U [        R                  5        g r   r	   AddCopyModelFlagsr   PromptForOpRegionparsers    r   ArgsCopyV1.Args0       	FK$A$ABr   c                    UR                   R                  R                  5       nUR                  5       S   n[        R
                  " [        R                  US9   [        R                  " [        R                  [        R                  [        R                     5      nUR                  U l        [        R                  " UUR                  S9R!                  X!R"                  UR$                  UR&                  UR(                  5      n[*        R,                  " [.        R0                  " XDR                  S9U[2        R4                  " UR6                  5      S9sS S S 5        $ ! , (       d  f       g = fNlocationsId)versionregion)r   r   )operations_clientopop_ref)CONCEPTSr+   ParseAsDictr   AiplatformEndpointOverridesr   
GA_VERSIONr   GetClientInstanceAI_PLATFORM_API_NAMEAI_PLATFORM_API_VERSIONMESSAGES_MODULEr   r   ModelsClientr   source_modelkms_key_namedestination_model_iddestination_parent_modelr   WaitForOpMayber   OperationsClientr
   ParseModelOperationnamer   r   destination_region_refdestination_regionclient_instance	operations         r   Run
CopyV1.Run4   s$   !]]11779/668G		2	2$$-?
A..

(
(

+
+I,@,@
ACo &55dm%% "2244:F$&7&79J9J'')F)F5H 
 ++&77$/N/NP00@	B
A 
A 
As   C>E##
E1r   __name__
__module____qualname____firstlineno____doc__r   staticmethodr$   rF   __static_attributes____classcell__r   s   @r   r   r      s/    	 C CB Br   r   c                   B   ^  \ rS rSrSrU 4S jr\S 5       rS rSr	U =r
$ )CopyV1Beta1I   r   c                 <   > [         [        U ]
  " U0 UD6  S U l        g r   )r   rT   r   r   r   s      r   r   CopyV1Beta1.__init__W   s    	+t%t6v6DMr   c                 N    [         R                  " U [        R                  5        g r   r   r"   s    r   r$   CopyV1Beta1.Args[   r&   r   c                    UR                   R                  R                  5       nUR                  5       S   n[        R
                  " [        R                  US9   [        R                  " [        R                  [        R                  [        R                     5      nUR                  U l        [        R                  " UUR                  S9R!                  X!R"                  UR$                  UR&                  UR(                  5      n[*        R,                  " [.        R0                  " 5       U[2        R4                  " UR6                  5      S9sS S S 5        $ ! , (       d  f       g = fr(   )r/   r+   r0   r1   r   r2   r   BETA_VERSIONr   r4   r5   r6   r7   r   r   r8   rT   r9   r:   r;   r<   r   r=   r   r>   r
   r?   r@   rA   s         r   rF   CopyV1Beta1.Run_   s   !]]11779/668G		2	2&&/A
C..

(
(

+
+I,B,B
CEo &55dm%% "2244?K$&7&79J9J'')F)F5H 
 ++&77900@B
C 
C 
Cs   C5E
E(rH   rI   rR   s   @r   rT   rT   I   s/    	 C CB Br   rT   N)rN   googlecloudsdk.api_lib.air    googlecloudsdk.api_lib.ai.modelsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r   r	   r
   r   r   ReleaseTracksReleaseTrackGAUniverseCompatibleCreateCommandr   ALPHABETArT    r   r   <module>rj      s    , 1 3 , ( 3 7 / 5 9 5 D%%(()&BT &B  *&BR D%%++T->->-C-CD%B& %B  E%Br   