(s codersdk.WorkspaceAgentLifecycle)
| 409 | } |
| 410 | |
| 411 | func ProtoFromLifecycleState(s codersdk.WorkspaceAgentLifecycle) (proto.Lifecycle_State, error) { |
| 412 | caps, ok := proto.Lifecycle_State_value[strings.ToUpper(string(s))] |
| 413 | if !ok { |
| 414 | return 0, xerrors.Errorf("unknown lifecycle state: %s", s) |
| 415 | } |
| 416 | return proto.Lifecycle_State(caps), nil |
| 417 | } |
| 418 | |
| 419 | func DevcontainersFromProto(pdcs []*proto.WorkspaceAgentDevcontainer) ([]codersdk.WorkspaceAgentDevcontainer, error) { |
| 420 | ret := make([]codersdk.WorkspaceAgentDevcontainer, len(pdcs)) |