
                             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
 ej                   G d dej                               Zy	)
z&Command to create named configuration.    )base)config_validators)log)named_configs)universe_descriptorc                   0    e Zd ZdZdddZed        Zd Zy)Createz"Creates a new named configuration.a;            {description}

          Except for special cases (NONE), configuration names start with a
          lower case letter and contain only lower case letters a-z, digits 0-9,
          and hyphens '-'.

          See `gcloud topic configurations` for an overview of named
          configurations.
          za          To create a new named configuration, run:

            $ {command} my-config
          )DESCRIPTIONEXAMPLESc                     | j                  dd       | j                  dddd       | j                  d	t        dd
       y)zAdds args for this command.configuration_namez#Name of the configuration to create)helpz
--activate
store_trueTz1If true, activate this configuration upon create.)actiondefaultr   z--universe-domainzLIf set, creates the configuration with the specified [core/universe_domain].)typehiddenr   N)add_argumentstr)parsers    +lib/surface/config/configurations/create.pyArgszCreate.Args/   sa     #H   @	   '      c                 n   t         j                  j                  |j                        }t	        j
                  |j                         |j                  rbt         j                  j                  |j                         t        j                  j                  dj                  |j                               n9t        j                  j                  dj                  |j                               |j                  rt        j                  |j                         t        j                         }|j!                  |j                        \  }}|s|j#                  dd|j                         nt        j                  j                  d       t        j                  j                  d       |j                  S )NzActivated [{0}].zeTo use this configuration, activate it by running:
  $ gcloud config configurations activate {name}

)namecoreuniverse_domainzDomain is switched to primary.z(Updated property [core/universe_domain].)r   ConfigurationStoreCreateConfigr   r   CreatedResourceactivateActivateConfigstatusPrintformatr   r   /WarnIfSettingUniverseDomainWithNoDescriptorDatar   UniverseDescriptor"UpdateDescriptorFromUniverseDomainPersistProperty)selfargscreated_configuniverse_descriptor_obj_is_deprecated_and_switcheds         r   Runz
Create.RunE   sX   "55BBN //0}}&&55d6M6MN	jj)001H1HIJ	jjAAG** BH B GG


 !4 F F H
!
D
D"" $a	# (&&%t';';	
 	

9:	jjAB"""r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r0    r   r   r	   r	      s/    *	-$  *##r   r	   N)r4   googlecloudsdk.callioper   !googlecloudsdk.command_lib.configr   googlecloudsdk.corer   "googlecloudsdk.core.configurationsr   'googlecloudsdk.core.universe_descriptorr   UniverseCompatibleSilentCommandr	   r7   r   r   <module>r?      sC     - ( ? # < G N#T N# N#r   