Skip to content

Commit

Permalink
Add self_serve arg to project creation. (#35)
Browse files Browse the repository at this point in the history
* Add self_serve arg to project creation.

* Formatting fixes
  • Loading branch information
dan-scale authored May 4, 2021
1 parent 8094e65 commit 792f658
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scaleapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,11 @@ def get_batches(
has_more = batches.has_more

def create_project(
self, project_name: str, task_type: TaskType, params: Dict = None
self,
project_name: str,
task_type: TaskType,
params: Dict = None,
self_serve: bool = False,
) -> Project:
"""Creates a new project.
https://docs.scale.com/reference#project-creation
Expand All @@ -524,7 +528,12 @@ def create_project(
Project: [description]
"""
endpoint = "projects"
payload = dict(type=task_type.value, name=project_name, params=params)
payload = dict(
type=task_type.value,
name=project_name,
params=params,
self_serve=self_serve,
)
projectdata = self.api.post_request(endpoint, body=payload)
return Project(projectdata, self)

Expand Down

0 comments on commit 792f658

Please sign in to comment.