Skip to content

Commit 2865aec

Browse files
author
Val Brodsky
committed
Init checkin
1 parent 06b7ddb commit 2865aec

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

libs/labelbox/src/labelbox/schema/labeling_service.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from datetime import datetime
22
from enum import Enum
33

4+
from ..client import Client
45
from labelbox.data.annotation_types.types import Cuid
56
from labelbox.orm.db_object import experimental
67
from labelbox.pydantic_compat import BaseModel
@@ -25,5 +26,34 @@ class LabelingService(_CamelCaseMixin, BaseModel):
2526
created_by_id: Cuid
2627
status: LabelingServiceStatus
2728

29+
@classmethod
30+
def start(cls, client: Client, project_id: Cuid) -> 'LabelingService':
31+
return cls._create(client=client, project_id=project_id)
32+
33+
"""
34+
mutation CreateProjectBoostWorkforce($projectId: ID!) {
35+
upsertProjectBoostWorkforce(data: { projectId: $projectId }) {
36+
success
37+
__typename
38+
}
39+
}
40+
{
41+
"projectId": "clz0b7jg901fh07zic3u67b7g"
42+
}
43+
44+
45+
{
46+
"data": {
47+
"upsertProjectBoostWorkforce": {
48+
"success": true,
49+
"__typename": "ProjectBoostWorkforceResult"
50+
}
51+
}
52+
}
53+
"""
54+
@classmethod
55+
def _create(cls, client: Client, project_id: Cuid) -> 'LabelingService':
56+
...
57+
2858
def status_as_string(self):
2959
return self.status.value

libs/labelbox/src/labelbox/schema/project.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,6 @@ def get_labeling_service(self) -> LabelingService:
19451945
message="The project does not have a labeling service.")
19461946
return LabelingService(**result["projectBoostWorkforce"])
19471947

1948-
19491948
class ProjectMember(DbObject):
19501949
user = Relationship.ToOne("User", cache=True)
19511950
role = Relationship.ToOne("Role", cache=True)

0 commit comments

Comments
 (0)