
                            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	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SKJr  SSKJr  SSKJr  SSK J!r!  Sr"\RF                  \RH                  " \RJ                  RL                  \RJ                  RN                  \RJ                  RP                  5       " S S\RR                  5      5       5       r*g)z Command to create a new project.    )absolute_import)division)unicode_literals)
exceptions)projects_api)projects_util)
operations)
enable_api)apis)arg_parsers)base)flags)util)labels_util)log)
properties)
console_iozProject IDs are immutable and can be set only during project creation. They must start with a lowercase letter and can have lowercase ASCII letters, digits or hyphens. Project IDs must be between 6 and 30 characters.c                   J    \ rS rSrSrS\R                  0r\S 5       r	S r
Srg)Create0   a  Create a new project.

Creates a new project with the given project ID. By default, projects are not
created under a parent resource. To do so, use either the `--organization` or
`--folder` flag.

## EXAMPLES

The following command creates a project with ID `example-foo-bar-1`, name
`Happy project` and label `type=happy`:

  $ {command} example-foo-bar-1 --name="Happy project" --labels=type=happy

By default, projects are not created under a parent resource. The following
command creates a project with ID `example-2` with parent `folders/12345`:

  $ {command} example-2 --folder=12345

The following command creates a project with ID `example-3` with parent
`organizations/2048`:

  $ {command} example-3 --organization=2048

## SEE ALSO

{see_also}
see_alsoc           
         [         R                  " U 5        [        R                  " 5       (       a  [        R
                  " S[        5      nO[        R
                  " S[        5      nU R                  SSUSSR                  [        5      S9  U R                  SS	S
9  U R                  SS[        R                  R                  R                  R                  5       S:X  a  SOS[        R                  " SSS9S9  U R                  SSSSS9  [        R                  " 5       R!                  U 5        [        R"                  " S5      R!                  U 5        [        R$                  " S5      R!                  U 5        g)zDefault argument specification.z[a-z][a-z0-9-]{5,29}zD^(?!.*-$)(((?:[a-z][\.a-z0-9-]{2,29})\:?)?(?:[a-z][a-z0-9-]{5,29})$)id
PROJECT_ID?z+ID for the project you want to create.

{0})metavartypenargshelpz--namezWName for the project you want to create. If not specified, will use project id as name.)r   z--enable-cloud-apis
store_truezgoogleapis.comTFz2Enable `cloudapis.googleapis.com` during creation.zThis is not available.
)defaultuniverse_help)actionr!   r   z--set-as-defaultz5Set newly created project as [core/project] property.zto use as a parentN)r   AddCreateLabelsFlagsr   IsDefaultUniverser   RegexpValidatorID_DESCRIPTIONadd_argumentformatVALUEScoreuniverse_domainGetUniverseHelpTextr   TagsFlagAddToParserOrganizationIdFlagFolderIdFlag)parsertype_s     lib/surface/projects/create.pyArgsCreate.ArgsR   sd    $$V,##%%))
!>e ))
Q
e <CC
   =   !!11557;KK ))H4
  
 D	   
NN  (	12>>vF	+,88@    c           	         [         R                  " USS9  UR                  nU(       dd  UR                  (       aS  [        R
                  " UR                  5      nU(       a,  [        R                  " SSR                  U5      SS9(       a  UnU(       d  [        R                  " SS5      e[        R                  " U5      n[        R                  " U[        R                  " 5       R                   R"                  5      n[         R$                  " U[        R                  " 5       R                   R&                  5      n [(        R*                  " UUR                  [(        R,                  " [         R.                  " U5      5      UUS	9n[:        R<                  " USS9  [>        R@                  " W5      n[>        RB                  " U[D        RF                  " SS5      R                   5      n	URH                  (       a;  [:        RJ                  " S5        [L        RN                  " URQ                  5       S5        URR                  (       aZ  [T        RV                  " S5      n
[T        RX                  " X5        [:        RZ                  R]                  SR                  U5      5        [        R^                  " U	5        U	$ ! [0        R2                   a0    S
n[4        R6                  " [        R8                  " U5      5         GNsf = f)z"Default Run method implementation.F)parent_requiredzNo project ID provided.zUse [{}] as project IDT)throw_if_unattendedr   z4an ID or a name must be provided for the new project)display_nameparentlabelstagszyProject creation failed. The project ID you specified is already in use by another project. Please try an alternative ID.)is_asynccloudresourcemanagerv1z!Enabling cloudapis.googleapis.comzcloudapis.googleapis.comzcore/projectz)Updated property [core/project] to [{0}].)0r   CheckParentFlagsr   namecommand_lib_projects_util
IdFromNamer   PromptContinuer)   r   RequiredArgumentExceptionParseProjectr   ParseCreateArgsr   GetMessagesProjectLabelsValueGetTagsFromFlags	TagsValuer   r   ParentNameToResourceIdGetParentFromFlagsapitools_exceptionsHttpConflictErrorcore_exceptionsreraiseHttpExceptionr   CreatedResourcer	   WaitForOperationExtractOperationResponser   GetMessagesModuleenable_cloud_apisdebugr
   EnableServiceNameset_as_defaultr   
FromStringPersistPropertystatusPrint-CheckAndPrintEnvironmentTagMessageWithProject)selfargs
project_id	candidateproject_refr>   r?   	create_opmsgprojectproject_propertys              r5   Run
Create.Run   sA    
47J$))+66tyyAi	z00
#
"
)
))
4"$ 
00
NP P+88DK((m'')11==?F!!m'')11;;=D=%%
yy44&&t,.i d3++I6I114))*@$GOOG
 	ii34{//13MN#..~>  !1>	jj
5
<
<Z
H KK N7 00 =c j66s;<	=s   >A
J8 8A K<;K< N)__name__
__module____qualname____firstlineno____doc__project_flags!CREATE_DELETE_IN_CONSOLE_SEE_ALSOdetailed_helpstaticmethodr6   rn   __static_attributes__rp   r8   r5   r   r   0   s3    8 }NNO-0A 0Ad7r8   r   N)+ru   
__future__r   r   r   apitools.base.pyr   rR   +googlecloudsdk.api_lib.cloudresourcemanagerr   r   'googlecloudsdk.api_lib.resource_managerr	   googlecloudsdk.api_lib.servicesr
   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r   #googlecloudsdk.command_lib.projectsr   rv   r   rE   +googlecloudsdk.command_lib.resource_manager$googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corerT   r   r   googlecloudsdk.core.consoler   r'   UniverseCompatibleReleaseTracksReleaseTrackGABETAALPHACreateCommandr   rp   r8   r5   <module>r      s    ' &  ' > D E > 6 , / ( . F Q = < = # * 2E D%%(($*;*;*@*@%%++-IT I- Ir8   