
    *                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ d	d
dZd	d
dZ G d de      Z e	j"                  e	j$                  j&                         G d dee	j(                               Z e	j"                  e	j$                  j,                         G d dee	j(                               Zy)z;Command to promote migration jobs for a database migration.    )absolute_import)division)unicode_literals)migration_jobs)resource_args)base)flagszE
        Promote a Database Migration Service migration job.
        zf        To promote a migration job:

          $ {command} MIGRATION_JOB --region=us-central1
        )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)_Promote3Promote a Database Migration Service migration job.c                 0    t        j                  | d       y)Args is called by calliope to gather arguments for this command.

    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.
    z
to promoteN)r   AddOnlyMigrationJobResourceArgsparsers    8lib/surface/database_migration/migration_jobs/promote.pyArgsz_Promote.Args4   s     11&,G    c                     |j                   j                  j                         }t        j                  | j                               }|j                  |j                         |      S )a*  Promote a Database Migration Service migration job.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Returns:
      A dict object representing the operations resource describing the promote
      operation if the promote was successful.
    )CONCEPTSmigration_jobParser   MigrationJobsClientReleaseTrackPromoteRelativeName)selfargsmigration_job_ref	mj_clients       r   Runz_Promote.Run>   sX     3399;2243D3D3FGI&&( r   N)__name__
__module____qualname____doc__staticmethodr   r#    r   r   r   r   1   s    ;H Hr   r   c                   $    e Zd ZdZeZed        Zy)	PromoteGAr   c                 X    t         j                  |        t        j                  |        yr   N)r   r   mj_flags*AddMigrationJobObjectsConfigFlagForPromoter   s    r   r   zPromoteGA.ArgsX   s     MM&77?r   N)r$   r%   r&   r'   DETAILED_HELP_GAdetailed_helpr(   r   r)   r   r   r+   r+   R   s    ;"-@ @r   r+   c                   $    e Zd ZdZeZed        Zy)PromoteAlphar   c                 .    t         j                  |        yr-   )r   r   r   s    r   r   zPromoteAlpha.Argsj   s     MM&r   N)r$   r%   r&   r'   DETAILED_HELP_ALPHAr1   r(   r   r)   r   r   r3   r3   d   s    ;%- r   r3   N)r'   
__future__r   r   r   )googlecloudsdk.api_lib.database_migrationr   r   googlecloudsdk.callioper   <googlecloudsdk.command_lib.database_migration.migration_jobsr	   r.   r5   r0   objectr   ReleaseTracksr   GACommandr+   ALPHAr3   r)   r   r   <module>r?      s    B &  ' D C ( Z		 		 v B D%%(()@$,, @ *@" D%%++,8T\\  -r   