
    A                     >   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  \R                  \R                  " \R                  R                   \R                  R"                  \R                  R$                  5       " S S	\R&                  5      5       5       rg
)z2Implements command to create a migration workflow.    )util)waiter)base)command_utils)
properties)	resourcesc                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)Create   zCreate a migration workflow.zcreate migration workflowszCreate a migration workflowz          To create a migration workflow in EU synchronously based on a config file, run:

            $ {command} --location=EU --config-file=config_file.yaml --no-async
            )briefDESCRIPTIONEXAMPLESc                     [         R                  R                  U 5        U R                  SSSS9  U R                  SSSS9  g )Nz
--locationz#Location of the migration workflow.T)helprequiredz--config-filez,Path to the migration workflows config file.)r   
ASYNC_FLAGAddToParseradd_argument)parsers    ,lib/surface/bq/migration_workflows/create.pyArgsCreate.Args+   sN    OO'
2  
 ;      c                    [         R                  " 5       nUR                  n[         R                  " S5      nU" 5       nUR                  =(       d1    [
        R                  R                  R                  R                  SS9nUR                  n[        R                  " UR                  [         R                  " S5      5      nSU SU 3Ul        Xl        UR                  U5      n	UR                   (       a  U	$ ["        R$                  R'                  U	R(                  SS9n
[        R*                  " U5      n[,        R.                  " UU
S	R1                  U	R(                  5      S
9n	U	$ )N8BigquerymigrationProjectsLocationsWorkflowsCreateRequestT)r   /GoogleCloudBigqueryMigrationV2MigrationWorkflowz	projects/z/locations/z.bigquerymigration.projects.locations.workflows)
collectionzRunning migration workflow [{}])polleroperation_refmessage)api_utilGetMigrationApiClientprojects_locations_workflowsGetMigrationApiMessageprojectr   VALUEScoreGetlocationr   GetResourceFromFileconfig_fileparent/googleCloudBigqueryMigrationV2MigrationWorkflowr
   async_r   REGISTRYParseRelativeNamenameBqMigrationWorkflowPollerr   WaitForformat)selfargsclientmigration_servicerequest_typerequestr%   r)   migration_workflowresponsemigration_workflow_refr   s               r   Run
Create.Run9   s9   ++-F;;22BL nGllOj//44<<@@$@OG}}H&::''=	
 !	XJ?GN>P; ''0H{{o(11CC
--E  D   667HIf.3::8==Ih Or    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r>   __static_attributes__r@   r   r   r
   r
      s4    
 % ,2-  $r   r
   N)rE   googlecloudsdk.api_lib.bqr   r!   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.command_lib.bqr   googlecloudsdk.corer   r   UniverseCompatibleReleaseTracksReleaseTrackALPHABETAGACommandr
   r@   r   r   <module>rU      s    9 7 . ( 7 * ) T..33T5F5F5I5I?T\\ ? ?r   