File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
main/kotlin/com/coder/gateway/models Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ data class WorkspaceAgentModel(
1717 val agentID : UUID ? ,
1818 val workspaceID : UUID ,
1919 val workspaceName : String ,
20- val name : String , // Name of the workspace OR the agent if this is for an agent.
20+ val name : String , // Name of the workspace OR workspace. agent if this is for an agent.
2121 val templateID : UUID ,
2222 val templateName : String ,
2323 val templateIconPath : String ,
Original file line number Diff line number Diff line change @@ -5,12 +5,19 @@ import com.coder.gateway.sdk.v2.models.WorkspaceStatus
55import com.coder.gateway.sdk.v2.models.WorkspaceTransition
66
77class DataGen {
8- static WorkspaceAgentModel workspace (String name , String workspaceName = name) {
8+ // Create a random workspace agent model. If the workspace name is omitted
9+ // then return a model without any agent bits, similar to what
10+ // toAgentModels() does if the workspace does not specify any agents.
11+ // TODO: Maybe better to randomly generate the workspace and then call
12+ // toAgentModels() on it. Also the way an "agent" model can have no
13+ // agent in it seems weird; can we refactor to remove
14+ // WorkspaceAgentModel and use the original structs from the API?
15+ static WorkspaceAgentModel workspace (String name , String workspaceName = " " , UUID agentId = UUID . randomUUID()) {
916 return new WorkspaceAgentModel (
17+ workspaceName == " " ? null : agentId,
1018 UUID . randomUUID(),
11- UUID . randomUUID(),
12- workspaceName,
13- name,
19+ workspaceName == " " ? name : workspaceName,
20+ workspaceName == " " ? name : (workspaceName + " ." + name),
1421 UUID . randomUUID(),
1522 " template-name" ,
1623 " template-icon-path" ,
You can’t perform that action at this time.
0 commit comments