
                             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	lmZ ej                   G d
 dej                               Zy)zVCommand to migrate a existing Spectrum Access System's organization into Google Cloud.    )absolute_import)division)unicode_literals)sas_portal_api)base)
exceptions)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)Migratea.  Migrates an existing SAS organization into Google Cloud.

  This will create a Google Cloud project for each existing deployment
  under the organization.

  ## EXAMPLES

  The following command migrates an existing SAS organization:

    $ gcloud cbrs-spectrum-access migrate --organization-id=1234
  c                 6    | j                  ddt        d       y )Nz--organization-idTz2The id of an existing SAS organization to migrate.)requiredtypehelp)add_argumentint)parsers    +lib/surface/cbrs_spectrum_access/migrate.pyArgszMigrate.Args+   s!    
A	      c                    |j                   st        j                  dd      t        j                  j                  d       t        j                  ddd       t        j                          t        j                         j                  }t        j                         }|j                         }|j                   |_        |j!                  |      }|j"                  st        j                  j                  d       |S )	Nzorganization-idz.Organization id must be passed to the command.a  This command will enable the Spectrum Access System and create a new SAS deployment for your organization. The Spectrum Access System is governed by your Google Cloud Agreement or Cloud Master Agreement and the Spectrum Access System specific terms at cloud.google.com/terms.FTzDo you accept the agreement?)defaultcancel_on_noprompt_stringz_A long running operation has started to migrate your organization, this may take a few minutes.)organization_idr   InvalidArgumentExceptionr	   statusPrintr
   PromptContinuer   EnableUserProjectQuotar   GetClientInstance	customersGetMessagesModule#SasPortalMigrateOrganizationRequestorganizationIdMigrateOrganizationerror)selfargsclientmessage_modulereqresults         r   RunzMigrate.Run4   s    //

: 
 JJ	< 4 	!--/99F#557N

<
<
>C--C'',F<< 
jj*
 Mr   N)__name__
__module____qualname____doc__staticmethodr   r.    r   r   r   r      s     
  #r   r   N)r2   
__future__r   r   r   &googlecloudsdk.api_lib.spectrum_accessr   googlecloudsdk.callioper   r   googlecloudsdk.corer	   googlecloudsdk.core.consoler
   HiddenDescribeCommandr   r4   r   r   <module>r<      sH     ] &  ' A ( . # 2 9d"" 9 9r   