HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/surface/projects/__pycache__/create.cpython-312.pyc
�

������dZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZddlmZdd
lmZddlmZdd
lmZddlmZddlmZddlmZddlmZddl m!Z!dZ"ejFejHejJjLejJjNejJjP�Gd�dejR���Z*y)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_ioz�Project 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�B�eZdZdZdej
iZed��Zd�Z	y)�CreateaCreate 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	��tj|�tj�rt	j
dt�}nt	j
dt�}|jdd|ddjt���|jdd	�
�|jddtjjjj�d
k(rdndt	jdd����|jdddd��tj�j!|�tj"d�j!|�tj$d�j!|�y)zDefault 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.)rz--enable-cloud-apis�
store_truezgoogleapis.comTFz2Enable `cloudapis.googleapis.com` during creation.zThis is not available.
)�default�
universe_help)�actionr rz--set-as-defaultz5Set newly created project as [core/project] property.zto 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�ArgszCreate.ArgsRsa���$�$�V�,��#�#�%��)�)�
!�>��e��)�)�
Q�
��e������
��
<�
C�
C��
�������
=�����������!�!�1�1�5�5�7�;K�K��
�
�
)�
)�H�4�
�
�
�������
D�	��
�N�N�� � ��(�	���1�2�>�>�v�F�	���+�,�8�8��@�c	�t�tj|d��|j}|sV|jrJt	j
|j�}|r)t
jddj|�d��r|}|stjdd��t	j|�}tj|tj�j j"�}tj$|tj�j j&�}	t)j*||jt)j,tj.|��||�	�}t;j<|d��t?j@�}|jBr9t;jDd�tGjH|jK�d
�|jLrYtOjPd�}	tOjR|	|�t:jTjWdj|��t?jX|t[j\dd�j �S#t0j2$r.d
}t5j6tj8|��Y��JwxYw)z"Default Run method implementation.F)�parent_requiredzNo project ID provided.zUse [{}] as project IDT)�throw_if_unattendedrz4an 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_asyncz!Enabling cloudapis.googleapis.comzcloudapis.googleapis.comzcore/projectz)Updated property [core/project] to [{0}].�cloudresourcemanager�v1)/r�CheckParentFlagsr�name�command_lib_util�
IdFromNamer�PromptContinuer(r�RequiredArgumentException�ParseProjectr�ParseCreateArgsr�GetMessages�Project�LabelsValue�GetTagsFromFlags�	TagsValuerr�ParentNameToResourceId�GetParentFromFlags�apitools_exceptions�HttpConflictError�core_exceptions�reraise�
HttpExceptionr�CreatedResourcer	�WaitForOperation�enable_cloud_apis�debugr
�
EnableService�Name�set_as_defaultr�
FromString�PersistProperty�status�Print�ExtractOperationResponser�GetMessagesModule)
�self�args�
project_id�	candidate�project_refr<r=�	create_op�msg�project_propertys
          r4�Runz
Create.Run�s1��
���4��7����J��$�)�)�"�-�-�d�i�i�8�i�	�z�0�0�
#�
"�
)�
)�)�
4�"�$��
���0�0�
�N�
P�P�"�/�/�
�;�K�
�
(�
(��m�'�'�)�1�1�=�=�?�F��!�!��m�'�'�)�1�1�;�;�=�D�=��%�%�
��y�y��4�4��&�&�t�,�.���
�i�����d�3��+�+�I�6�I����	�i�i�3�4����{�/�/�1�3M�N����#�.�.�~�>��� � �!1�:�>�	�j�j���B���z�*�,��.�.�y�/3�/E�/E�3I�37�09�9@��B�B��'�0�0�=��c����j�6�6�s�;�<�	=�s�"A
I6�6=J7�6J7N)
�__name__�
__module__�__qualname__�__doc__�
project_flags�!CREATE_DELETE_IN_CONSOLE_SEE_ALSO�
detailed_help�staticmethodr5rj�r6r4rr0s4���8�}�N�N�O�-��0A��0A�d2Br6rN)+rn�
__future__rrr�apitools.base.pyrrP�+googlecloudsdk.api_lib.cloudresourcemanagerrr�'googlecloudsdk.api_lib.resource_managerr	�googlecloudsdk.api_lib.servicesr
�googlecloudsdk.api_lib.utilr�googlecloudsdk.callioperr
�#googlecloudsdk.command_lib.projectsrrorrC�+googlecloudsdk.command_lib.resource_manager�$googlecloudsdk.command_lib.util.argsr�googlecloudsdk.corerRrr�googlecloudsdk.core.consolerr&�UniverseCompatible�
ReleaseTracks�ReleaseTrack�GA�BETA�ALPHA�
CreateCommandrrsr6r4�<module>r�s���'�&��'�>�D�E�>�6�,�/�(�.�F�H�=�<�=�#�*�2�E���������D�%�%�(�(�$�*;�*;�*@�*@��%�%�+�+�-�DB�T�
�
�DB�-��DBr6