
    d                        S r SSKJr  SSKJr  SSKJr  SSK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  SrSrSR/                  \\5      rS\-   SS.r\R4                  R7                  \R4                  R9                  \5      SS5      r\R>                  " \S9r \RB                  " \RD                  RF                  5       " S S\RH                  5      5       r%g)zDCommand for generating main.tf file to configure Terraform Provider.    )absolute_import)division)unicode_literalsN)base)flags)log)
properties)
console_io)progress_tracker)files)runtime)templatez0.2zv3.90.0z\This command supports Google Terraform Provider version {}+ and Terraform Provider Schema {}z{description}

        a  
    To generate a `main.tf` file in the current directory using the gcloud default values for `zone`, `region` and `project` run:

      $ {command}

    To generate a `main.tf` file in the current directory using the user suppplied values for `zone`, `region` and `project` run:

      $ {command}  --project="my-project-id" --region="us-central1" --zone="us-central1-c

    To generate a `main.tf` file in the current directory using the gcloud default `billing_project` run:

      $ {command} --use-gcloud-billing-project

    To generate a `main.tf` file in the current directory using user specified `billing_project` value run:

      $ {command} --tf-user-project-override --tf-billing-project="my-other-project-id"
   )DESCRIPTIONEXAMPLES	templateszmain_tf.tpl)filenamec                   8    \ rS rSrSr\rS r\S 5       r	S r
Srg)InitProviderH   zCGenerate main.tf file to configure Google Cloud Terraform Provider.c                     UR                   nS=p4U(       a7  [        R                  R                  R                  R                  5       nSnX44$ UR                  (       a  UR                  nSnX44$ )zDProcess billing project flags in args and return Terraform settings.Ntrue)use_gcloud_billing_projectr	   VALUESbillingquota_projectGettf_user_project_overridetf_billing_project)selfargs_namspaceuse_gcloud_billinguser_project_overridebilling_projects        6lib/surface/resource_config/terraform/init_provider.py_GetBillingParamsInitProvider._GetBillingParamsN   sp    &AA.22"))11??CCEo$ !11 
	/	/%88o$ 11    c                 0    [         R                  " U5        g )N)r   AddInitProviderArgs)clsparsers     r$   ArgsInitProvider.ArgsZ   s    	f%r'   c                 @   U R                  U5      u  p#UR                  =(       d2    [        R                  R                  R                  R                  5       nUR                  =(       d2    [        R                  R                  R                  R                  5       nUR                  =(       d2    [        R                  R                  R                  R                  5       nUUUUUS.n[        R                  R                  [        R                  " 5       S5      n[        R                  R                  U5      (       a&  [        R                   " SR#                  U5      SSSS9  [$        R&                  " S5         [        R(                  " USS	9 n	[*        R,                  " U	40 UD6n
[.        R1                  U
5        S S S 5        S S S 5        [2        R4                  R7                  S
R#                  US95        g ! , (       d  f       NC= f! , (       d  f       NL= f)N)projectregionzoneuser_overrider#   zmain.tfz
{} Exists.z
Overwrite?TzInit Provider cancelled.)prompt_stringcancel_on_nocancel_stringzCreating Terraform init module)create_pathz%Created Terraform module file {path}.)path)r%   r/   r	   r   corer   r0   computer1   osr7   joinr   GetCWDisfiler
   PromptContinueformatr   ProgressTracker
FileWriterr   ContextINIT_FILE_TEMPLATErender_contextr   statusPrint)r   argsdo_overrider#   r/   r0   r1   template_contextr7   fctxs              r$   RunInitProvider.Run^   s   #'#9#9$#? KllBj//44<<@@BG[[BJ--55<<@@BF99<
))1166::<D$* 77<<	2D	ww~~d 3 3D 9.:-1.HJ 
	)	)*J	KDd3qooa4#34))#. 4 
L JJ<CCCNO 43 
L	Ks$   >H-G>H>
H	H
H N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpr%   classmethodr,   rL   __static_attributes__rN   r'   r$   r   r   H   s)    K -
2 & &Pr'   r   )&rS   
__future__r   r   r   r:   googlecloudsdk.callioper   +googlecloudsdk.command_lib.util.declarativer   googlecloudsdk.corer   r	   googlecloudsdk.core.consoler
   r   googlecloudsdk.core.utilr   makor   r   _SCHEMA_VERSION_MIN_PROVIDER_VERSIONr?   _SUPPORTED_MSGrT   r7   r;   dirname__file___INIT_TEMPLATE_NAMETemplaterC   ReleaseTracksReleaseTrackALPHADeclarativeCommandr   rN   r'   r$   <module>rj      s    K &  ' 	 ( = # * 2 8 *   ! ::@&+_;> 			2 ggllGGOOH{M;  &&0CD  D%%++,+P4** +P -+Pr'   