TaskTable converts a Task to it's reduced version. A more generalized solution is to use json marshaling to consistently keep these two structs in sync. That would be a lot of overhead, and a more costly unit test is written to make sure these match up.
()
| 158 | // That would be a lot of overhead, and a more costly unit test is |
| 159 | // written to make sure these match up. |
| 160 | func (t Task) TaskTable() TaskTable { |
| 161 | return TaskTable{ |
| 162 | ID: t.ID, |
| 163 | OrganizationID: t.OrganizationID, |
| 164 | OwnerID: t.OwnerID, |
| 165 | Name: t.Name, |
| 166 | DisplayName: t.DisplayName, |
| 167 | WorkspaceID: t.WorkspaceID, |
| 168 | TemplateVersionID: t.TemplateVersionID, |
| 169 | TemplateParameters: t.TemplateParameters, |
| 170 | Prompt: t.Prompt, |
| 171 | CreatedAt: t.CreatedAt, |
| 172 | DeletedAt: t.DeletedAt, |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | func (t Task) RBACObject() rbac.Object { |
| 177 | obj := rbac.ResourceTask. |
no outgoing calls