()
| 98 | ) |
| 99 | |
| 100 | func (w *WorkspaceEvent) Validate() error { |
| 101 | if w.WorkspaceID == uuid.Nil { |
| 102 | return xerrors.New("workspaceID must be set") |
| 103 | } |
| 104 | if w.Kind == "" { |
| 105 | return xerrors.New("kind must be set") |
| 106 | } |
| 107 | if w.Kind == WorkspaceEventKindAgentLifecycleUpdate && w.AgentID == nil { |
| 108 | return xerrors.New("agentID must be set for Agent events") |
| 109 | } |
| 110 | return nil |
| 111 | } |
no test coverage detected