
                             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 dd
lmZ  G d dej                        Zy)z(Command to activate named configuration.    )absolute_import)division)unicode_literals)base)
completers)config_validators)log)
properties)named_configsc                   0    e Zd ZdZdddZed        Zd Zy)Activatez*Activates an existing named configuration.z          {description}

          See `gcloud topic configurations` for an overview of named
          configurations.
          z          To activate an existing configuration named `my-config`, run:

            $ {command} my-config

          To list all properties in the activated configuration, run:

            $ gcloud config list --all
          )DESCRIPTIONEXAMPLESc                 H    | j                  dt        j                  d       y)zAdds args for this command.configuration_namez%Name of the configuration to activate)	completerhelpN)add_argumentr   NamedConfigCompleter)parsers    -lib/surface/config/configurations/activate.pyArgszActivate.Args3   s&     114  6    c                 n   t         j                  j                  |j                         t        j
                  j                  dj                  |j                               t        j                  j                  j                  j                         }|rt        j                  |       |j                  S )NzActivated [{0}].
)r   ConfigurationStoreActivateConfigr   r	   statuswriteformatr
   VALUEScoreprojectGetr   !WarnIfSettingProjectWhenAdcExists)selfargs
project_ids      r   RunzActivate.Run;   s}    $$33D4K4KLJJ)001H1HIJ""''//335J99*E"""r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r(    r   r   r   r      s/    2-$ 6 6#r   r   N)r,   
__future__r   r   r   googlecloudsdk.callioper   !googlecloudsdk.command_lib.configr   r   googlecloudsdk.corer	   r
   "googlecloudsdk.core.configurationsr   SilentCommandr   r/   r   r   <module>r6      s7     / &  ' ( 8 ? # * <%#t!! %#r   