
                             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)z?Command to provision a new Spectrum Access System's deployment.    )absolute_import)division)unicode_literals)sas_portal_api)base)log)
properties)
console_ioc                   &    e Zd ZdZed        Zd Zy)	ProvisionzProvision a new Spectrum Access System's deployment.

  ## EXAMPLES

  The following command provisions a new SAS deployment:

    $ gcloud spectrum-access provision --organization-name=MyOrgName
    --deployment-name=MyDeploymentName
  c                 T    | j                  ddd       | j                  ddd       y )Nz--organization-nameFzThe display name to use in case a new SAS Portal organization needs to be created. If not set, a default display name of the form "Cloud organizations/[ID]" will be used where ID is the current Cloud Platform Organization ID.)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 "Cloud [ID]" will be used where ID is the current Cloud Platform Project ID.)add_argument)parsers    (lib/surface/spectrum_access/provision.pyArgszProvision.Args)   s@    
7	  	 	  	    c                    t         j                  j                  d       t        j                  ddd       t        j                          t        j                         j                  }t        j                         }|j                         }|j                  |_        |j                  |_        |j!                  |      }|j"                  st$        j&                  j(                  j+                  d      j-                         }d}|rd|v rd	}t$        j&                  j.                  j0                  j-                         }t         j                  j                  d
j3                  ||             |S )Na  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.)r   statusPrintr
   PromptContinuer   EnableUserProjectQuotar   GetClientInstance	customersGetMessagesModule#SasPortalProvisionDeploymentRequestorganization_namenewOrganizationDisplayNamedeployment_namenewDeploymentDisplayNameProvisionDeploymenterrorMessager	   VALUESapi_endpoint_overridesPropertyGetcoreprojectformat)	selfargsclientmesssage_modulereqresultportal_api_overridesas_portal_urlr-   s	            r   RunzProvision.Run@   s0   JJ	< 4 	!--/99F$668O

=
=
?C%)%;%;C"#'#7#7C '',F&--DDMM
  (n	"59L"LK!!&&..224g	jj1171P Mr   N)__name__
__module____qualname____doc__staticmethodr   r7    r   r   r   r      s       ,&r   r   N)r;   
__future__r   r   r   &googlecloudsdk.api_lib.spectrum_accessr   googlecloudsdk.callioper   googlecloudsdk.corer   r	   googlecloudsdk.core.consoler
   HiddenDescribeCommandr   r=   r   r   <module>rE      sK     F &  ' A ( # * 2 H$$ H Hr   