Skip to content

create_project

create_project(
    space_name: NameString,
    display_name: ProjectDisplayName,
    *,
    config_overrides: Optional[CodeCatalystClientConfig] = None,
    description: Optional[ProjectDescription] = None,
) -> CreateProjectResponse

Creates a project in a specified space.

Parameters:

  • space_name (NameString) –

    The name of the space.

  • display_name (ProjectDisplayName) –

    The friendly name of the project that will be displayed to users.

  • description (Optional[ProjectDescription], default: None ) –

    The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose.

Raises:

  • AccessDeniedException –

    The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.

  • ConflictException –

    The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.

  • ResourceNotFoundException –

    The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.

  • ServiceQuotaExceededException –

    The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_codecatalyst/_services/code_catalyst.py
def create_project(
    self,
    space_name: "capo_codecatalyst.types.name_string.NameString",
    display_name: "capo_codecatalyst.types.project_display_name.ProjectDisplayName",
    *,
    config_overrides: Optional[CodeCatalystClientConfig] = None,
    description: Optional[
        "capo_codecatalyst.types.project_description.ProjectDescription"
    ] = None,
) -> "capo_codecatalyst.types.create_project_response.CreateProjectResponse":
    """<p>Creates a project in a specified space.</p>

    Args:
        space_name: <p>The name of the space.</p>
        display_name: <p>The friendly name of the project that will be displayed to users.</p>
        description: <p>The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose.</p>

    Raises:
        capo_codecatalyst.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.</p>
        capo_codecatalyst.errors.conflict_exception.ConflictException: <p>The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.</p>
        capo_codecatalyst.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.</p>
        capo_codecatalyst.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.</p>
        capo_codecatalyst.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codecatalyst.errors.validation_exception.ValidationException: <p>The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.</p>
        capo_codecatalyst.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecatalyst.types.create_project_request.CreateProjectRequest]",
    ) -> OperationResponse[
        "capo_codecatalyst.types.create_project_response.CreateProjectResponse"
    ]:
        import capo_codecatalyst._operations.code_catalyst.create_project

        output, http_response = (
            capo_codecatalyst._operations.code_catalyst.create_project.create_project(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProject")
    )
    input_: capo_codecatalyst.types.create_project_request.CreateProjectRequest = {
        "space_name": space_name,
        "display_name": display_name,
    }
    if description is not None:
        input_["description"] = description

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output