
                            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
SS.r\	R                  " \	R                  R                   5      \	R"                   " S S\	R$                  5      5       5       r\	R                  " \	R                  R(                  5      \	R"                   " S S\	R$                  5      5       5       rg)z2Command to import IaC for an Application Template.    )absolute_import)division)unicode_literals)application_templates)base)flags)utilszMImport Infrastructure as Code (IaC) for a Design Center Application Template.a3           To import IaC from a Google Cloud Storage URI into the application template `my-template` in space `dev-space` and location `us-central1`, run:

          $ {command} my-template --location=us-central1 --space=dev-space --gcs-uri=gs://my-bucket/iac

        To import IaC from a local YAML file named `iac_module.yaml` into the application template `my-template` in space `dev-space` and location `us-central1`, run:

          $ {command} my-template --location=us-central1 --space=dev-space --iac-module-from-file=iac_module.yaml

        To import IaC from a Google Cloud Storage URI and allow partial import of valid edits into the application template `my-template`, run:

          $ {command} my-template --location=us-central1 --space=dev-space --gcs-uri=gs://my-bucket/iac --allow-partial-import

        To import IaC from a local YAML file and allow partial import of valid edits into the application template `my-template`, run:

          $ {command} my-template --location=us-central1 --space=dev-space --iac-module-from-file=iac_module.yaml --allow-partial-import

        To validate IaC from a Google Cloud Storage URI without importing into the application template `my-template`, run:

          $ {command} my-template --location=us-central1 --space=dev-space --gcs-uri=gs://my-bucket/iac --validate-iac

        To validate IaC from a local YAML file without importing into the application template `my-template`, run:

          $ {command} my-template --location=us-central1 --space=dev-space --iac-module-from-file=iac_module.yaml --validate-iac
        z         This command uses the designcenter/v1alpha API. The full documentation for
        this API can be found at:
        http://cloud.google.com/application-design-center/docs
        )DESCRIPTIONEXAMPLESzAPI REFERENCEc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)	ImportIac>   @Import Infrastructure as Code (IaC) for an Application Template.c                 Z    [         R                  " U SS9  [         R                  " U 5        g Nzto import IaC into)verbr   !AddApplicationTemplateResourceArgAddImportIacFlagsparsers    Dlib/surface/design_center/spaces/application_templates/import_iac.pyArgsImportIac.ArgsE   !    	++F9MN	F#    c                 (   [         R                  " U R                  5       5      nUR                  R                  R                  5       nS nUR                  (       a7  [        R                  " UR                  5      n [        R                  " X%5      nUR                  UR!                  5       UR"                  UUR$                  UR&                  S9nU$ ! [         a3  n[        R                  R                  SR                  U5      5      eS nAff = fNz-Invalid format for --iac-module-from-file: {})namegcs_uri
iac_moduleallow_partial_importvalidate_iacapisApplicationTemplatesClientReleaseTrackCONCEPTSapplication_templateParseiac_module_from_filer   ParseIacModuleFiler	   ParseIaCModuleData
ValueErrorarg_parsersArgumentTypeErrorformatr   RelativeNamer    r"   r#   selfargsclientapp_template_refiac_module_msgiac_module_dataeresponses           r   RunImportIac.RunJ       ,,T->->-@AF}}99??AN  001J1JKoG11&J
 **,!!66&&   (H O  G11;BB1EG 	GG   =C 
D.DD N__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r<   __static_attributes__r@   r   r   r   r   >   $     I -$ $r   r   c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)ImportIacGa`   r   c                 Z    [         R                  " U SS9  [         R                  " U 5        g r   r   r   s    r   r   ImportIacGa.Argsg   r   r   c                 (   [         R                  " U R                  5       5      nUR                  R                  R                  5       nS nUR                  (       a7  [        R                  " UR                  5      n [        R                  " X%5      nUR                  UR!                  5       UR"                  UUR$                  UR&                  S9nU$ ! [         a3  n[        R                  R                  SR                  U5      5      eS nAff = fr   r$   r3   s           r   r<   ImportIacGa.Runl   r>   r?   r@   NrA   r@   r   r   rM   rM   `   rK   r   rM   N)rF   
__future__r   r   r   $googlecloudsdk.api_lib.design_centerr   r%   googlecloudsdk.callioper   (googlecloudsdk.command_lib.design_centerr   r	   rG   ReleaseTracksr'   ALPHAUniverseCompatibleCommandr   GArM   r@   r   r   <module>r\      s    9 &  ' N ( : 6 c27 F D%%++,   -@ D%%(()$,,   *r   