
    S                     Z    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 jr
S	 rS
 rg)zJConvenience utilities for building python calliope config export commands.    )absolute_import)division)unicode_literals)flags)
kcc_clientNc           	      `   U=(       d    SR                  U 5      nU nU(       a  SR                  X 5      nSnU(       a  SnSR                  U R                  5       R                  5       5      nSR                  XTS9SR                  U R	                  5       UUUS	9S
R                  U UUUS9S.nU$ )z=Builds and returns help text for declarative export commands.z{}sz{} {}aan-z?Export the configuration for {a_or_an} {singular_with_service}.)a_or_ansingular_with_servicea               *{{command}}* exports the configuration for {a_or_an} {singular_with_service}.

            {singular_capitalized} configurations can be exported in
            Kubernetes Resource Model (krm) or Terraform HCL formats. The
            default format is `krm`.

            Specifying `--all` allows you to export the configurations for all
            {plural} within the project.

            Specifying `--path` allows you to export the configuration(s) to
            a local directory.
          )singular_capitalizedr   pluralr   aQ              To export the configuration for {a_or_an} {singular}, run:

              $ {{command}} my-{resource_name}

            To export the configuration for {a_or_an} {singular} to a file, run:

              $ {{command}} my-{resource_name} --path=/path/to/dir/

            To export the configuration for {a_or_an} {singular} in Terraform
            HCL format, run:

              $ {{command}} my-{resource_name} --resource-format=terraform

            To export the configurations for all {plural} within a
            project, run:

              $ {{command}} --all
          )singularr   resource_namer   )briefDESCRIPTIONEXAMPLES)formatjoinlowersplit
capitalize)r   r   servicebegins_with_vowelr   r   r   detailed_helps           Flib/googlecloudsdk/command_lib/util/declarative/python_command_util.pyBuildHelpTextr      s     +U\\(+& ##NN7= 'G((8>>+1134- L6'6O f#+#6#6#8$9	  $ f)	  S.-^ 
    c                     U R                  SSS9nUR                  5       nU" U40 UD6  [        R                  " USS9  [        R                  " U 5        [        R                  " U 5        g )NT)mutexrequiredproject)
collection)	add_groupdeclarative_config_flags
AddAllFlagAddPathFlagAddFormatFlag)parseradd_to_parserkwargsmutex_groupresource_groups        r   RegisterArgsr/   ]   s^      td ;+((*.)&)%%kiH&&v.((0r   c                     [         R                  " 5       n[        U SS 5      (       a  UR                  XS9$ UR	                  XS9$ )Nall)argsr$   )resource_uri)r   	KccClientgetattr	ExportAllExport)r2   r$   resource_refclients       r   	RunExportr:   f   sD    !&T5$==	t	77r   )NNF)__doc__
__future__r   r   r   +googlecloudsdk.command_lib.util.declarativer   r&   3googlecloudsdk.command_lib.util.declarative.clientsr   r   r/   r:    r   r   <module>r@      s+    Q &  ' Y JAH18r   