
                            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  SSKJr  SSKJr  SSKJr  \R(                  " \R*                  R,                  5      \R.                   " S S\R0                  5      5       5       r\R(                  " \R*                  R4                  \R*                  R6                  5      \R.                   " S S\5      5       5       rg)z%Command to copy a model in Vertex AI.    )absolute_import)division)unicode_literals)
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.Args3       	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.Run7   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'   rI   __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
$ )CopyV1Beta1L   r   c                 <   > [         [        U ]
  " U0 UD6  S U l        g r   )r   rW   r   r   r   s      r   r   CopyV1Beta1.__init__Z   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+   )r2   r.   r3   r4   r   r5   r
   BETA_VERSIONr   r7   r8   r9   r:   r   r   r;   rW   r<   r=   r>   r?   r   r@   r   rA   r   rB   rC   rD   s         r   rI   CopyV1Beta1.Runb   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(rK   rL   rU   s   @r   rW   rW   L   s/    	 C CB Br    rW   N)rQ   
__future__r   r   r   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BETArW    r    r   <module>rn      s    , &  ' 0 3 , ( 3 7 / 5 9 5 D%%(()&BT &B  *&BR D%%++T->->-C-CD%B& %B  E%Br    