
                             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  \R                   " S S\R                   5      5       rg)z?Command to provision a new Spectrum Access System's deployment.    )absolute_import)division)unicode_literals)sas_portal_api)base)
exceptions)log)
properties)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)	Provision   zProvision a new Spectrum Access System's deployment.

## EXAMPLES

The following command provisions a new SAS deployment:

  $ gcloud cbrs-spectrum-access provision --organization-name=MyOrgName
  --deployment-name=MyDeploymentName
c                 t    U R                  SSSS9  U R                  SSSS9  U R                  SS[        SS	9  g )
Nz--organization-nameFzThe display name to use in case a new SAS Portal organization needs to be created. If creating a deployment under an existing organization then the `--organization-id` flag must be set instead.)requiredhelpz--deployment-namezThe display name to use in case a new SAS Portal deployment needs to be created. If not set, a default display name of the form "[ID]" will be used where ID is the current Cloud Platform Project ID.z--organization-idzThe id of the organization to create a new deployment under. If left empty a new organization will be created with the name entered via the `--organization-name` flag. Either this or `--organization-name` must be set.)r   typer   )add_argumentint)parsers    -lib/surface/cbrs_spectrum_access/provision.pyArgsProvision.Args*   sc    
	  	 	  	 2  
    c                    UR                   (       d*  UR                  (       d  [        R                  " SS/S5      eUR                   (       a(  UR                  (       a  [        R                  " SS5      e[
        R                  R                  S5        [        R                  " SSS	S
9  [        R                  " 5         [        R                  " 5       R                  n[        R                  " 5       nUR!                  5       nUR                   Ul        UR$                  Ul        UR                  Ul        UR+                  U5      nUR,                  (       d  [.        R0                  R2                  R5                  S5      R7                  5       nSnU(       a  SU;   a  Sn[.        R0                  R8                  R:                  R7                  5       n[
        R                  R                  SR=                  X5      5        U$ )Nzorganization-namezorganization-idzEither `--organization-name` or `--organization-id` must be set. Use `--organization-name` when creating a new organization and `--organization-id` when create a deployment under an existing organization.z"organization-name, organization-idzEither `--organization-name` or `--organization-id` must be set but not both. Use `--organization-name` when creating a new organization and `--organization-id` when creating a deployment under an existing organization.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_string	sasportalzg.co/sasportalzprod-tt-sasportalz0https://wirelessconnectivity.google.com/test-saszA new SAS deployment with userID: {}  has been created. Go to {} to check spectrum availability, pre-register CBSDs, check CBSD status and manage users.)organization_nameorganization_idr   OneOfArgumentsRequiredExceptionInvalidArgumentExceptionr	   statusPrintr   PromptContinuer   EnableUserProjectQuotar   GetClientInstance	customersGetMessagesModule#SasPortalProvisionDeploymentRequestnewOrganizationDisplayNamedeployment_namenewDeploymentDisplayNameorganizationIdProvisionDeploymenterrorMessager
   VALUESapi_endpoint_overridesPropertyGetcoreprojectformat)	selfargsclientmessage_modulereqresultportal_api_overridesas_portal_urlr6   s	            r   RunProvision.RunL   s   !!$*>*>66 1
2  $"6"6//
.-  JJ	< 4 	!--/99F#557N

<
<
>C%)%;%;C"#'#7#7C --C'',F&--DDMM
  (n	"59L"LK!!&&..224g	jj1171P Mr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r@   __static_attributes__rB   r   r   r   r      s!      B9r   r   N)rG   
__future__r   r   r   &googlecloudsdk.api_lib.spectrum_accessr   googlecloudsdk.callioper   r   googlecloudsdk.corer	   r
   googlecloudsdk.core.consoler   HiddenDescribeCommandr   rB   r   r   <module>rQ      sN     F &  ' A ( . # * 2 f$$ f fr   