Skip to content

Commit 6f139f1

Browse files
committed
Update models.py
1 parent 660aa19 commit 6f139f1

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

api/src/workspaces/models.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ def validate_url(self, data, value):
6969

7070
return value
7171

72-
72+
# don't remove the Field(None) bits, those are required for some reason
73+
class WorkspaceLongQuestUpdate(BaseModel):
74+
definition: Optional[str] = Field(None)
75+
type: Optional[QuestDefinitionType] = Field(None)
76+
url: Optional[str] = Field(None)
77+
7378
class WorkspaceImageryBase(BaseModel):
7479

7580
workspace_id: int
@@ -84,6 +89,11 @@ class WorkspaceImageryBase(BaseModel):
8489

8590
model_config = ConfigDict(from_attributes=True)
8691

92+
# don't remove the Field(None) bits, those are required for some reason
93+
class WorkspaceImageryUpdate(BaseModel):
94+
definition: Optional[list[Any]] = Field(None)
95+
96+
8797

8898
class WorkspaceBase(BaseModel):
8999

@@ -134,8 +144,13 @@ class WorkspaceCreate(WorkspaceBase):
134144
pass
135145

136146

137-
class WorkspaceUpdate(WorkspaceBase):
138-
pass
147+
# don't remove the Field(None) bits, those are required for some reason
148+
class WorkspaceUpdate(BaseModel):
149+
title: Optional[str] = Field(None)
150+
description: Optional[str] = Field(None)
151+
externalAppAccess: Optional[ExternalAppsDefinitionType] = Field(None)
152+
longFormQuestDef: Optional[WorkspaceLongQuestBase] = Field(None)
153+
imageryListDef: Optional[WorkspaceImageryBase] = Field(None)
139154

140155

141156
class WorkspaceResponse(WorkspaceBase):

0 commit comments

Comments
 (0)