3166 lines
112 KiB
Go
3166 lines
112 KiB
Go
//go:build go1.22
|
|
|
|
// Package api provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
|
|
package api
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/flate"
|
|
"encoding/base64"
|
|
"errors"
|
|
"fmt"
|
|
"net/http"
|
|
"net/url"
|
|
"path"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/getkin/kin-openapi/openapi3"
|
|
"github.com/oapi-codegen/runtime"
|
|
)
|
|
|
|
// Defines values for AgentProcessHealth.
|
|
const (
|
|
HealthExited AgentProcessHealth = "exited"
|
|
HealthOk AgentProcessHealth = "ok"
|
|
HealthStuck AgentProcessHealth = "stuck"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the AgentProcessHealth enum.
|
|
func (e AgentProcessHealth) Valid() bool {
|
|
switch e {
|
|
case HealthExited:
|
|
return true
|
|
case HealthOk:
|
|
return true
|
|
case HealthStuck:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for AgentSessionRole.
|
|
const (
|
|
Implementer AgentSessionRole = "implementer"
|
|
Lead AgentSessionRole = "lead"
|
|
Reviewer AgentSessionRole = "reviewer"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the AgentSessionRole enum.
|
|
func (e AgentSessionRole) Valid() bool {
|
|
switch e {
|
|
case Implementer:
|
|
return true
|
|
case Lead:
|
|
return true
|
|
case Reviewer:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for AgentSessionState.
|
|
const (
|
|
AgentSessionStateCompleted AgentSessionState = "completed"
|
|
AgentSessionStateIdle AgentSessionState = "idle"
|
|
AgentSessionStateRunning AgentSessionState = "running"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the AgentSessionState enum.
|
|
func (e AgentSessionState) Valid() bool {
|
|
switch e {
|
|
case AgentSessionStateCompleted:
|
|
return true
|
|
case AgentSessionStateIdle:
|
|
return true
|
|
case AgentSessionStateRunning:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for AgentSessionVendor.
|
|
const (
|
|
Claude AgentSessionVendor = "claude"
|
|
Codex AgentSessionVendor = "codex"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the AgentSessionVendor enum.
|
|
func (e AgentSessionVendor) Valid() bool {
|
|
switch e {
|
|
case Claude:
|
|
return true
|
|
case Codex:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for AttachmentKind.
|
|
const (
|
|
AttachmentKindDiagram AttachmentKind = "diagram"
|
|
AttachmentKindDiff AttachmentKind = "diff"
|
|
AttachmentKindFile AttachmentKind = "file"
|
|
AttachmentKindImage AttachmentKind = "image"
|
|
AttachmentKindSnapshot AttachmentKind = "snapshot"
|
|
AttachmentKindTask AttachmentKind = "task"
|
|
AttachmentKindUrl AttachmentKind = "url"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the AttachmentKind enum.
|
|
func (e AttachmentKind) Valid() bool {
|
|
switch e {
|
|
case AttachmentKindDiagram:
|
|
return true
|
|
case AttachmentKindDiff:
|
|
return true
|
|
case AttachmentKindFile:
|
|
return true
|
|
case AttachmentKindImage:
|
|
return true
|
|
case AttachmentKindSnapshot:
|
|
return true
|
|
case AttachmentKindTask:
|
|
return true
|
|
case AttachmentKindUrl:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for DirEntryType.
|
|
const (
|
|
DirEntryTypeDir DirEntryType = "dir"
|
|
DirEntryTypeFile DirEntryType = "file"
|
|
DirEntryTypeOther DirEntryType = "other"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the DirEntryType enum.
|
|
func (e DirEntryType) Valid() bool {
|
|
switch e {
|
|
case DirEntryTypeDir:
|
|
return true
|
|
case DirEntryTypeFile:
|
|
return true
|
|
case DirEntryTypeOther:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for FileChangeStatus.
|
|
const (
|
|
Added FileChangeStatus = "added"
|
|
Deleted FileChangeStatus = "deleted"
|
|
Modified FileChangeStatus = "modified"
|
|
Renamed FileChangeStatus = "renamed"
|
|
TypeChanged FileChangeStatus = "type_changed"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the FileChangeStatus enum.
|
|
func (e FileChangeStatus) Valid() bool {
|
|
switch e {
|
|
case Added:
|
|
return true
|
|
case Deleted:
|
|
return true
|
|
case Modified:
|
|
return true
|
|
case Renamed:
|
|
return true
|
|
case TypeChanged:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for InboxItemKind.
|
|
const (
|
|
Question InboxItemKind = "question"
|
|
RateLimited InboxItemKind = "rate_limited"
|
|
SessionError InboxItemKind = "session_error"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the InboxItemKind enum.
|
|
func (e InboxItemKind) Valid() bool {
|
|
switch e {
|
|
case Question:
|
|
return true
|
|
case RateLimited:
|
|
return true
|
|
case SessionError:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for InboxItemPriority.
|
|
const (
|
|
Blocked InboxItemPriority = "blocked"
|
|
Fyi InboxItemPriority = "fyi"
|
|
Gate InboxItemPriority = "gate"
|
|
ReviewPriority InboxItemPriority = "review"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the InboxItemPriority enum.
|
|
func (e InboxItemPriority) Valid() bool {
|
|
switch e {
|
|
case Blocked:
|
|
return true
|
|
case Fyi:
|
|
return true
|
|
case Gate:
|
|
return true
|
|
case ReviewPriority:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for InboxResponseType.
|
|
const (
|
|
Dismiss InboxResponseType = "dismiss"
|
|
Option InboxResponseType = "option"
|
|
Other InboxResponseType = "other"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the InboxResponseType enum.
|
|
func (e InboxResponseType) Valid() bool {
|
|
switch e {
|
|
case Dismiss:
|
|
return true
|
|
case Option:
|
|
return true
|
|
case Other:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for InboxState.
|
|
const (
|
|
Answered InboxState = "answered"
|
|
Dismissed InboxState = "dismissed"
|
|
Open InboxState = "open"
|
|
Superseded InboxState = "superseded"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the InboxState enum.
|
|
func (e InboxState) Valid() bool {
|
|
switch e {
|
|
case Answered:
|
|
return true
|
|
case Dismissed:
|
|
return true
|
|
case Open:
|
|
return true
|
|
case Superseded:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for ReviewState.
|
|
const (
|
|
ReviewStateDone ReviewState = "done"
|
|
ReviewStateFailed ReviewState = "failed"
|
|
ReviewStateRunning ReviewState = "running"
|
|
ReviewStateSkipped ReviewState = "skipped"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the ReviewState enum.
|
|
func (e ReviewState) Valid() bool {
|
|
switch e {
|
|
case ReviewStateDone:
|
|
return true
|
|
case ReviewStateFailed:
|
|
return true
|
|
case ReviewStateRunning:
|
|
return true
|
|
case ReviewStateSkipped:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for SnapshotTrigger.
|
|
const (
|
|
SnapshotTriggerAskHuman SnapshotTrigger = "ask_human"
|
|
SnapshotTriggerMessage SnapshotTrigger = "message"
|
|
SnapshotTriggerTimer SnapshotTrigger = "timer"
|
|
SnapshotTriggerToolCall SnapshotTrigger = "tool_call"
|
|
SnapshotTriggerTurnEnd SnapshotTrigger = "turn_end"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the SnapshotTrigger enum.
|
|
func (e SnapshotTrigger) Valid() bool {
|
|
switch e {
|
|
case SnapshotTriggerAskHuman:
|
|
return true
|
|
case SnapshotTriggerMessage:
|
|
return true
|
|
case SnapshotTriggerTimer:
|
|
return true
|
|
case SnapshotTriggerToolCall:
|
|
return true
|
|
case SnapshotTriggerTurnEnd:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for TaskStatus.
|
|
const (
|
|
TaskStatusActive TaskStatus = "active"
|
|
TaskStatusDiscarded TaskStatus = "discarded"
|
|
TaskStatusMerged TaskStatus = "merged"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the TaskStatus enum.
|
|
func (e TaskStatus) Valid() bool {
|
|
switch e {
|
|
case TaskStatusActive:
|
|
return true
|
|
case TaskStatusDiscarded:
|
|
return true
|
|
case TaskStatusMerged:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for TaskTab.
|
|
const (
|
|
TabChanges TaskTab = "changes"
|
|
TabFiles TaskTab = "files"
|
|
TabInbox TaskTab = "inbox"
|
|
TabPreview TaskTab = "preview"
|
|
TabProject TaskTab = "project"
|
|
TabReviews TaskTab = "reviews"
|
|
TabTerminal TaskTab = "terminal"
|
|
TabTranscript TaskTab = "transcript"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the TaskTab enum.
|
|
func (e TaskTab) Valid() bool {
|
|
switch e {
|
|
case TabChanges:
|
|
return true
|
|
case TabFiles:
|
|
return true
|
|
case TabInbox:
|
|
return true
|
|
case TabPreview:
|
|
return true
|
|
case TabProject:
|
|
return true
|
|
case TabReviews:
|
|
return true
|
|
case TabTerminal:
|
|
return true
|
|
case TabTranscript:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// Defines values for ZombieKind.
|
|
const (
|
|
ProcessWithoutSession ZombieKind = "process_without_session"
|
|
RunningWithoutProcess ZombieKind = "running_without_process"
|
|
)
|
|
|
|
// Valid indicates whether the value is a known member of the ZombieKind enum.
|
|
func (e ZombieKind) Valid() bool {
|
|
switch e {
|
|
case ProcessWithoutSession:
|
|
return true
|
|
case RunningWithoutProcess:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
// AgentProcess defines model for AgentProcess.
|
|
type AgentProcess struct {
|
|
// Health stuck means a turn is running and no stream event has arrived for stuck_after_seconds; exited means the process is gone.
|
|
Health AgentProcessHealth `json:"health"`
|
|
|
|
// LastEventAt When the process last wrote a line to its stream
|
|
LastEventAt time.Time `json:"last_event_at"`
|
|
Pid int `json:"pid"`
|
|
SessionId string `json:"session_id"`
|
|
|
|
// State The session's state
|
|
State string `json:"state"`
|
|
TaskId string `json:"task_id"`
|
|
Vendor string `json:"vendor"`
|
|
}
|
|
|
|
// AgentProcessHealth stuck means a turn is running and no stream event has arrived for stuck_after_seconds; exited means the process is gone.
|
|
type AgentProcessHealth string
|
|
|
|
// AgentSession defines model for AgentSession.
|
|
type AgentSession struct {
|
|
CreatedAt time.Time `json:"created_at"`
|
|
CreatedBy string `json:"created_by"`
|
|
|
|
// ForkedAt With forked_from: the vendor's id of the last thing the fork keeps, a message for Claude Code, a turn for Codex.
|
|
ForkedAt *string `json:"forked_at,omitempty"`
|
|
|
|
// ForkedFrom A fork's first start resumes this vendor session, cut at forked_at, under a new vendor_session_id; absent for other sessions.
|
|
ForkedFrom *string `json:"forked_from,omitempty"`
|
|
Id string `json:"id"`
|
|
|
|
// Model Requested model; empty means the vendor's default. A session only switches between its own vendor's models.
|
|
Model string `json:"model"`
|
|
|
|
// Owner The login whose lead agent this is; empty for a task's session.
|
|
Owner string `json:"owner"`
|
|
|
|
// Role reviewer: a review's session (see Review); a task's sessions list leaves these out.
|
|
Role AgentSessionRole `json:"role"`
|
|
State AgentSessionState `json:"state"`
|
|
|
|
// TaskId Empty for a lead session.
|
|
TaskId string `json:"task_id"`
|
|
|
|
// Vendor Follows from the model the session was created with: gpt-* models run on Codex, every other model on Claude Code.
|
|
Vendor AgentSessionVendor `json:"vendor"`
|
|
|
|
// VendorSessionId Claude Code's session id, chosen by byre; or the Codex thread id, empty until the session's first turn starts its thread.
|
|
VendorSessionId string `json:"vendor_session_id"`
|
|
|
|
// WorkflowStage The stage (from 1) of the task's workflow this session runs; absent for a session outside a workflow.
|
|
WorkflowStage *int `json:"workflow_stage,omitempty"`
|
|
}
|
|
|
|
// AgentSessionRole reviewer: a review's session (see Review); a task's sessions list leaves these out.
|
|
type AgentSessionRole string
|
|
|
|
// AgentSessionState defines model for AgentSession.State.
|
|
type AgentSessionState string
|
|
|
|
// AgentSessionVendor Follows from the model the session was created with: gpt-* models run on Codex, every other model on Claude Code.
|
|
type AgentSessionVendor string
|
|
|
|
// Attachment defines model for Attachment.
|
|
type Attachment struct {
|
|
Caption *string `json:"caption,omitempty"`
|
|
EndLine *int `json:"end_line,omitempty"`
|
|
|
|
// Image image: data URL.
|
|
Image *string `json:"image,omitempty"`
|
|
Kind AttachmentKind `json:"kind"`
|
|
|
|
// Mermaid diagram: Mermaid source.
|
|
Mermaid *string `json:"mermaid,omitempty"`
|
|
|
|
// Path file: repo-relative path. image: an image file in the task's worktree, absolute or relative to it.
|
|
Path *string `json:"path,omitempty"`
|
|
|
|
// Ref diff: git revision range.
|
|
Ref *string `json:"ref,omitempty"`
|
|
SnapshotId *string `json:"snapshot_id,omitempty"`
|
|
StartLine *int `json:"start_line,omitempty"`
|
|
TaskId *string `json:"task_id,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
}
|
|
|
|
// AttachmentKind defines model for Attachment.Kind.
|
|
type AttachmentKind string
|
|
|
|
// Blob defines model for Blob.
|
|
type Blob struct {
|
|
ContentType string `json:"content_type"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
CreatedBy string `json:"created_by"`
|
|
Id string `json:"id"`
|
|
}
|
|
|
|
// DirEntry defines model for DirEntry.
|
|
type DirEntry struct {
|
|
// Ignored git ignores the entry: .gitignore and the other exclude files match it or a directory above it.
|
|
Ignored bool `json:"ignored"`
|
|
Name string `json:"name"`
|
|
|
|
// Size file: its size in bytes.
|
|
Size int64 `json:"size"`
|
|
Symlink bool `json:"symlink"`
|
|
|
|
// Type What the entry is, following a symlink that stays in the worktree. other: a symlink that leaves the worktree or points nowhere, or a device, socket or pipe.
|
|
Type DirEntryType `json:"type"`
|
|
}
|
|
|
|
// DirEntryType What the entry is, following a symlink that stays in the worktree. other: a symlink that leaves the worktree or points nowhere, or a device, socket or pipe.
|
|
type DirEntryType string
|
|
|
|
// DirListing defines model for DirListing.
|
|
type DirListing struct {
|
|
Entries []DirEntry `json:"entries"`
|
|
|
|
// Path The directory, relative to the worktree root; empty for the root.
|
|
Path string `json:"path"`
|
|
|
|
// Truncated The directory has more entries than were returned.
|
|
Truncated bool `json:"truncated"`
|
|
}
|
|
|
|
// Error defines model for Error.
|
|
type Error struct {
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
// Event defines model for Event.
|
|
type Event struct {
|
|
Actor string `json:"actor"`
|
|
AgentSessionId *string `json:"agent_session_id,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
Kind string `json:"kind"`
|
|
|
|
// Owner Set on a lead agent's events and a user's focus.updated: the login they belong to. Only that user is sent them.
|
|
Owner *string `json:"owner,omitempty"`
|
|
Payload map[string]interface{} `json:"payload"`
|
|
ProjectId *string `json:"project_id,omitempty"`
|
|
Seq int64 `json:"seq"`
|
|
TaskId *string `json:"task_id,omitempty"`
|
|
}
|
|
|
|
// FileChange defines model for FileChange.
|
|
type FileChange struct {
|
|
Additions int `json:"additions"`
|
|
Binary bool `json:"binary"`
|
|
Deletions int `json:"deletions"`
|
|
|
|
// OldPath renamed: the path before the rename.
|
|
OldPath *string `json:"old_path,omitempty"`
|
|
Path string `json:"path"`
|
|
Status FileChangeStatus `json:"status"`
|
|
}
|
|
|
|
// FileChangeStatus defines model for FileChange.Status.
|
|
type FileChangeStatus string
|
|
|
|
// FileContent defines model for FileContent.
|
|
type FileContent struct {
|
|
// Binary The file isn't UTF-8 text; text is empty.
|
|
Binary bool `json:"binary"`
|
|
Path string `json:"path"`
|
|
Size int64 `json:"size"`
|
|
Text string `json:"text"`
|
|
|
|
// Truncated text holds only the start of the file.
|
|
Truncated bool `json:"truncated"`
|
|
}
|
|
|
|
// FileDiff defines model for FileDiff.
|
|
type FileDiff struct {
|
|
Patch string `json:"patch"`
|
|
Path string `json:"path"`
|
|
}
|
|
|
|
// Focus defines model for Focus.
|
|
type Focus struct {
|
|
// ProjectId The project the right pane shows; the task's project when task_id is set
|
|
ProjectId *string `json:"project_id,omitempty"`
|
|
Tab TaskTab `json:"tab"`
|
|
|
|
// Tabs The tabs the lead put first, in order. The other task tabs follow them.
|
|
Tabs []TaskTab `json:"tabs"`
|
|
|
|
// TaskId The task the right pane shows; absent for none.
|
|
TaskId *string `json:"task_id,omitempty"`
|
|
}
|
|
|
|
// InboxItem defines model for InboxItem.
|
|
type InboxItem struct {
|
|
AgentSessionId string `json:"agent_session_id"`
|
|
Blocking bool `json:"blocking"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
Id string `json:"id"`
|
|
Kind InboxItemKind `json:"kind"`
|
|
|
|
// Payload question: context (Markdown with the choices inline as `- ( ) text` / `- (*) text` pick-one or `- [ ] text` / `- [x] text` pick-any list items), question, why_blocked, options (each choice's text, in order), multiple (true for pick-any), recommended (the marked choices' text), attachments. session_error: error. rate_limited: vendor, rate_limit (the vendor's rate-limit status), error.
|
|
Payload map[string]interface{} `json:"payload"`
|
|
Priority InboxItemPriority `json:"priority"`
|
|
ProjectId string `json:"project_id"`
|
|
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
|
|
ResolvedBy *string `json:"resolved_by,omitempty"`
|
|
Responses []InboxResponse `json:"responses"`
|
|
|
|
// Reviews question: the review of the first snapshot the task took after the question was asked (the snapshot at the end of the turn that asked it), once that snapshot exists; empty for other items.
|
|
Reviews []Review `json:"reviews"`
|
|
State InboxState `json:"state"`
|
|
TaskId string `json:"task_id"`
|
|
ThreadId string `json:"thread_id"`
|
|
}
|
|
|
|
// InboxItemKind defines model for InboxItem.Kind.
|
|
type InboxItemKind string
|
|
|
|
// InboxItemPriority defines model for InboxItem.Priority.
|
|
type InboxItemPriority string
|
|
|
|
// InboxRespond defines model for InboxRespond.
|
|
type InboxRespond struct {
|
|
Responses []InboxResponseCreate `json:"responses"`
|
|
}
|
|
|
|
// InboxResponse defines model for InboxResponse.
|
|
type InboxResponse struct {
|
|
Attachments []Attachment `json:"attachments"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
DeliveredAt *time.Time `json:"delivered_at,omitempty"`
|
|
Id string `json:"id"`
|
|
ItemId string `json:"item_id"`
|
|
Options *[]string `json:"options,omitempty"`
|
|
Text *string `json:"text,omitempty"`
|
|
Type InboxResponseType `json:"type"`
|
|
User string `json:"user"`
|
|
}
|
|
|
|
// InboxResponseCreate defines model for InboxResponseCreate.
|
|
type InboxResponseCreate struct {
|
|
Attachments *[]Attachment `json:"attachments,omitempty"`
|
|
ItemId string `json:"item_id"`
|
|
|
|
// Options option: the chosen options; exactly one for a pick-one question, one or more for a pick-any question.
|
|
Options *[]string `json:"options,omitempty"`
|
|
|
|
// Text other: the text sent to the agent. option on a pick-any question: optional text sent along with the checked options.
|
|
Text *string `json:"text,omitempty"`
|
|
Type InboxResponseType `json:"type"`
|
|
}
|
|
|
|
// InboxResponseType defines model for InboxResponseType.
|
|
type InboxResponseType string
|
|
|
|
// InboxState defines model for InboxState.
|
|
type InboxState string
|
|
|
|
// MessageCreate defines model for MessageCreate.
|
|
type MessageCreate struct {
|
|
// Images Blob ids from uploadBlob, sent to the agent as images alongside the text.
|
|
Images *[]string `json:"images,omitempty"`
|
|
|
|
// Model Model for this turn and later ones. When it differs from the session's model, the session switches before the message is sent.
|
|
Model *string `json:"model,omitempty"`
|
|
|
|
// Text May be empty when images are given.
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
// NotificationPrefs Which new inbox items and finished turns notify this user in their open byre pages.
|
|
type NotificationPrefs struct {
|
|
// BlockingQuestions Questions asked with blocking: true. On by default.
|
|
BlockingQuestions bool `json:"blocking_questions"`
|
|
|
|
// Errors session_error items.
|
|
Errors bool `json:"errors"`
|
|
|
|
// Questions Non-blocking questions.
|
|
Questions bool `json:"questions"`
|
|
|
|
// RateLimits rate_limited items.
|
|
RateLimits bool `json:"rate_limits"`
|
|
|
|
// Reports Task turns that end with a summary (turn.ended with summary: true).
|
|
Reports bool `json:"reports"`
|
|
}
|
|
|
|
// PaneFocus defines model for PaneFocus.
|
|
type PaneFocus struct {
|
|
// Focused True while the browser window has focus and the focused element is inside the right pane.
|
|
Focused bool `json:"focused"`
|
|
}
|
|
|
|
// Participant defines model for Participant.
|
|
type Participant struct {
|
|
DisplayName string `json:"display_name"`
|
|
GitEmail string `json:"git_email"`
|
|
|
|
// GitName Empty when the user hasn't set a git identity; they then get no trailer.
|
|
GitName string `json:"git_name"`
|
|
Login string `json:"login"`
|
|
}
|
|
|
|
// Preview defines model for Preview.
|
|
type Preview struct {
|
|
CreatedAt time.Time `json:"created_at"`
|
|
Name string `json:"name"`
|
|
|
|
// Port A port in the task's block, served at https://<byre's host>:<port>/.
|
|
Port int `json:"port"`
|
|
TaskId string `json:"task_id"`
|
|
}
|
|
|
|
// Project defines model for Project.
|
|
type Project struct {
|
|
CreatedAt time.Time `json:"created_at"`
|
|
CreatedBy string `json:"created_by"`
|
|
DefaultBranch string `json:"default_branch"`
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
Remote string `json:"remote"`
|
|
RepoPath string `json:"repo_path"`
|
|
}
|
|
|
|
// ProjectCreate defines model for ProjectCreate.
|
|
type ProjectCreate struct {
|
|
Name string `json:"name"`
|
|
RepoPath string `json:"repo_path"`
|
|
}
|
|
|
|
// ProtocolError defines model for ProtocolError.
|
|
type ProtocolError struct {
|
|
At time.Time `json:"at"`
|
|
|
|
// Raw The line as received
|
|
Raw string `json:"raw"`
|
|
Reason string `json:"reason"`
|
|
SessionId string `json:"session_id"`
|
|
|
|
// Size The line's full length in bytes.
|
|
Size int `json:"size"`
|
|
Vendor string `json:"vendor"`
|
|
}
|
|
|
|
// ProtocolErrors defines model for ProtocolErrors.
|
|
type ProtocolErrors struct {
|
|
// Counts Stream lines the adapter couldn't parse or didn't recognise since byre started, keyed by vendor.
|
|
Counts map[string]int `json:"counts"`
|
|
|
|
// Recent The most recent ones, newest first.
|
|
Recent []ProtocolError `json:"recent"`
|
|
}
|
|
|
|
// Review An agent session on the vendor the task's agent doesn't use, reviewing one snapshot's change.
|
|
type Review struct {
|
|
// AgentSessionId The reviewer's session; empty when skipped.
|
|
AgentSessionId string `json:"agent_session_id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
// Error failed: why.
|
|
Error string `json:"error"`
|
|
FinishedAt *time.Time `json:"finished_at,omitempty"`
|
|
Id string `json:"id"`
|
|
|
|
// Model Empty when skipped.
|
|
Model string `json:"model"`
|
|
|
|
// Result done: the reviewer's submit_review arguments: summary (Markdown) and findings, each with severity, category, title, detail, path and line.
|
|
Result *map[string]interface{} `json:"result,omitempty"`
|
|
SnapshotN int `json:"snapshot_n"`
|
|
|
|
// State skipped: the snapshot's step changed no files, so no reviewer ran.
|
|
State ReviewState `json:"state"`
|
|
TaskId string `json:"task_id"`
|
|
|
|
// Vendor Empty when skipped.
|
|
Vendor string `json:"vendor"`
|
|
}
|
|
|
|
// ReviewState skipped: the snapshot's step changed no files, so no reviewer ran.
|
|
type ReviewState string
|
|
|
|
// SessionCreate defines model for SessionCreate.
|
|
type SessionCreate struct {
|
|
// Images Blob ids from uploadBlob, sent to the agent as images alongside the prompt.
|
|
Images *[]string `json:"images,omitempty"`
|
|
Model *string `json:"model,omitempty"`
|
|
Prompt string `json:"prompt"`
|
|
}
|
|
|
|
// Snapshot defines model for Snapshot.
|
|
type Snapshot struct {
|
|
AgentSessionId string `json:"agent_session_id"`
|
|
|
|
// CommitSha A commit of tree_sha whose parent is the worktree's HEAD when it was taken.
|
|
CommitSha string `json:"commit_sha"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
// EventSeq The task's latest event when the snapshot was started: the tree holds at least the work up to it.
|
|
EventSeq int64 `json:"event_seq"`
|
|
Id string `json:"id"`
|
|
|
|
// N Position in the task's snapshots, from 1; the ref is refs/byre/tasks/{task_id}/snap/{n}.
|
|
N int `json:"n"`
|
|
TaskId string `json:"task_id"`
|
|
TreeSha string `json:"tree_sha"`
|
|
|
|
// Trigger turn_end: after byre's end-of-turn commit. message (the agent wrote text after one or more tool calls), tool_call, ask_human and timer appear only on snapshots taken by earlier builds.
|
|
Trigger SnapshotTrigger `json:"trigger"`
|
|
}
|
|
|
|
// SnapshotTrigger turn_end: after byre's end-of-turn commit. message (the agent wrote text after one or more tool calls), tool_call, ask_human and timer appear only on snapshots taken by earlier builds.
|
|
type SnapshotTrigger string
|
|
|
|
// Stage defines model for Stage.
|
|
type Stage struct {
|
|
// Model The stage agent's model, which also picks its vendor: gpt-* models run on Codex, every other model on Claude Code.
|
|
Model string `json:"model"`
|
|
|
|
// Name One line of 1 to 100 characters, unique within the workflow.
|
|
Name string `json:"name"`
|
|
|
|
// Prompt The stage agent's instructions.
|
|
Prompt string `json:"prompt"`
|
|
}
|
|
|
|
// Status defines model for Status.
|
|
type Status struct {
|
|
ActiveTasks int `json:"active_tasks"`
|
|
|
|
// AgentProcesses Every agent process byre is tracking, idle sessions included.
|
|
AgentProcesses []AgentProcess `json:"agent_processes"`
|
|
DbBytes int64 `json:"db_bytes"`
|
|
LastEventSeq int64 `json:"last_event_seq"`
|
|
|
|
// LiveAgents Agent processes currently running.
|
|
LiveAgents int `json:"live_agents"`
|
|
Projects int `json:"projects"`
|
|
ProtocolErrors ProtocolErrors `json:"protocol_errors"`
|
|
|
|
// RateLimits The latest rate-limit status each vendor reported, keyed by vendor.
|
|
RateLimits map[string]map[string]interface{} `json:"rate_limits"`
|
|
|
|
// RunningTurns Turns running now, oldest session first.
|
|
RunningTurns []TurnRef `json:"running_turns"`
|
|
SseClients int `json:"sse_clients"`
|
|
StartedAt time.Time `json:"started_at"`
|
|
|
|
// StuckAfterSeconds How long a running turn may go without a stream event before it counts as stuck.
|
|
StuckAfterSeconds int `json:"stuck_after_seconds"`
|
|
|
|
// Zombies Sessions marked running with no live process, and agent processes byre has no session for.
|
|
Zombies []Zombie `json:"zombies"`
|
|
}
|
|
|
|
// Task defines model for Task.
|
|
type Task struct {
|
|
BaseRef string `json:"base_ref"`
|
|
Branch string `json:"branch"`
|
|
|
|
// ClosedAt When the task was merged or discarded.
|
|
ClosedAt *time.Time `json:"closed_at,omitempty"`
|
|
|
|
// Color Index into the UI's task palette, assigned at creation: a colour no active task holds, the one given out longest ago.
|
|
Color int `json:"color"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
CreatedBy string `json:"created_by"`
|
|
|
|
// ForkedAt With forked_from: the n of the snapshot it was forked at.
|
|
ForkedAt *int `json:"forked_at,omitempty"`
|
|
|
|
// ForkedFrom The task this one was forked from; absent for other tasks.
|
|
ForkedFrom *string `json:"forked_from,omitempty"`
|
|
Id string `json:"id"`
|
|
|
|
// MergeCommit merged: the squash commit on the default branch; empty when there was nothing to merge.
|
|
MergeCommit *string `json:"merge_commit,omitempty"`
|
|
|
|
// MergeQueuedAt When Merge was requested while another task in the project was merging; absent once the merge starts or when none is held.
|
|
MergeQueuedAt *time.Time `json:"merge_queued_at,omitempty"`
|
|
|
|
// MergeTitle The title of the squash commit Merge makes: the task title until the agent sets another with set_merge_title.
|
|
MergeTitle string `json:"merge_title"`
|
|
|
|
// PortBase The first of the task's block of ports (port_base to port_base+9), passed to its agent and terminal as PORT.
|
|
PortBase int `json:"port_base"`
|
|
ProjectId string `json:"project_id"`
|
|
Status TaskStatus `json:"status"`
|
|
Title string `json:"title"`
|
|
|
|
// TodoItem The title of the TODO.md item the task was started from; absent for other tasks.
|
|
TodoItem *string `json:"todo_item,omitempty"`
|
|
|
|
// Workflow The name of the workflow the task froze at creation (getTaskWorkflow has its copy); absent for a task without one.
|
|
Workflow *string `json:"workflow,omitempty"`
|
|
WorktreePath string `json:"worktree_path"`
|
|
}
|
|
|
|
// TaskStatus defines model for Task.Status.
|
|
type TaskStatus string
|
|
|
|
// TaskChanges defines model for TaskChanges.
|
|
type TaskChanges struct {
|
|
// Base The commit or tree compared with: the merge-base of the task branch and the default branch, since, or the previous snapshot's tree.
|
|
Base string `json:"base"`
|
|
Files []FileChange `json:"files"`
|
|
|
|
// Tree Tree of the worktree as if everything were staged, or the snapshot's tree.
|
|
Tree string `json:"tree"`
|
|
}
|
|
|
|
// TaskCreate defines model for TaskCreate.
|
|
type TaskCreate struct {
|
|
Title string `json:"title"`
|
|
|
|
// Workflow The name of a workflow for the task to freeze: it keeps a copy of the workflow's definition as it is now.
|
|
Workflow *string `json:"workflow,omitempty"`
|
|
}
|
|
|
|
// TaskTab defines model for TaskTab.
|
|
type TaskTab string
|
|
|
|
// TaskWorkflow The workflow a task froze when it was created, as it was then.
|
|
type TaskWorkflow struct {
|
|
// Definition The WorkflowDefinition as YAML.
|
|
Definition string `json:"definition"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// TerminalSize defines model for TerminalSize.
|
|
type TerminalSize struct {
|
|
Cols int `json:"cols"`
|
|
Rows int `json:"rows"`
|
|
}
|
|
|
|
// Todo defines model for Todo.
|
|
type Todo struct {
|
|
// Exists Whether the default branch has a TODO.md at its root.
|
|
Exists bool `json:"exists"`
|
|
Items []TodoItem `json:"items"`
|
|
}
|
|
|
|
// TodoItem defines model for TodoItem.
|
|
type TodoItem struct {
|
|
// Body The item's further lines
|
|
Body string `json:"body"`
|
|
|
|
// Section The text of the nearest heading above the item; empty when there is none.
|
|
Section string `json:"section"`
|
|
|
|
// Title The item's first line, without its list marker: the item's identity.
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
// TodoStart defines model for TodoStart.
|
|
type TodoStart struct {
|
|
Model *string `json:"model,omitempty"`
|
|
|
|
// Title The title of the item to start.
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
// TurnRef defines model for TurnRef.
|
|
type TurnRef struct {
|
|
SessionId string `json:"session_id"`
|
|
TaskId string `json:"task_id"`
|
|
Vendor string `json:"vendor"`
|
|
}
|
|
|
|
// Unmerged defines model for Unmerged.
|
|
type Unmerged struct {
|
|
// Commits Commits on the task branch that aren't on the default branch.
|
|
Commits int `json:"commits"`
|
|
Deletions int `json:"deletions"`
|
|
|
|
// Files Files that differ from the merge base
|
|
Files int `json:"files"`
|
|
Insertions int `json:"insertions"`
|
|
|
|
// Uncommitted Paths with uncommitted changes in the worktree.
|
|
Uncommitted int `json:"uncommitted"`
|
|
}
|
|
|
|
// User defines model for User.
|
|
type User struct {
|
|
DisplayName string `json:"display_name"`
|
|
GitEmail string `json:"git_email"`
|
|
GitName string `json:"git_name"`
|
|
Login string `json:"login"`
|
|
|
|
// NotificationPrefs Which new inbox items and finished turns notify this user in their open byre pages.
|
|
NotificationPrefs NotificationPrefs `json:"notification_prefs"`
|
|
}
|
|
|
|
// UserUpdate defines model for UserUpdate.
|
|
type UserUpdate struct {
|
|
GitEmail string `json:"git_email"`
|
|
GitName string `json:"git_name"`
|
|
}
|
|
|
|
// WorkflowDefinition A workflow's file, which holds everything but its name: a sequence of stages run in order. Sent and returned as YAML.
|
|
type WorkflowDefinition struct {
|
|
Description string `json:"description,omitempty"`
|
|
Stages []Stage `json:"stages"`
|
|
}
|
|
|
|
// WorkflowSummary defines model for WorkflowSummary.
|
|
type WorkflowSummary struct {
|
|
Description string `json:"description"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Zombie defines model for Zombie.
|
|
type Zombie struct {
|
|
Detail string `json:"detail"`
|
|
Kind ZombieKind `json:"kind"`
|
|
Pid *int `json:"pid,omitempty"`
|
|
SessionId *string `json:"session_id,omitempty"`
|
|
TaskId *string `json:"task_id,omitempty"`
|
|
}
|
|
|
|
// ZombieKind defines model for Zombie.Kind.
|
|
type ZombieKind string
|
|
|
|
// StreamEventsParams defines parameters for StreamEvents.
|
|
type StreamEventsParams struct {
|
|
After *int64 `form:"after,omitempty" json:"after,omitempty"`
|
|
TaskId *string `form:"task_id,omitempty" json:"task_id,omitempty"`
|
|
Lead *bool `form:"lead,omitempty" json:"lead,omitempty"`
|
|
LastEventID *int64 `json:"Last-Event-ID,omitempty"`
|
|
}
|
|
|
|
// ListInboxParams defines parameters for ListInbox.
|
|
type ListInboxParams struct {
|
|
ProjectId *string `form:"project_id,omitempty" json:"project_id,omitempty"`
|
|
TaskId *string `form:"task_id,omitempty" json:"task_id,omitempty"`
|
|
State *InboxState `form:"state,omitempty" json:"state,omitempty"`
|
|
}
|
|
|
|
// GetTaskChangesParams defines parameters for GetTaskChanges.
|
|
type GetTaskChangesParams struct {
|
|
// Since A commit to compare with instead of the merge-base, such as a user.message event's head. Not allowed with snapshot.
|
|
Since *string `form:"since,omitempty" json:"since,omitempty"`
|
|
|
|
// Snapshot A snapshot's n: show the task as it was in that snapshot rather than the live worktree.
|
|
Snapshot *int `form:"snapshot,omitempty" json:"snapshot,omitempty"`
|
|
|
|
// Step With snapshot: compare with the previous snapshot (the snapshot commit's parent for the first one).
|
|
Step *bool `form:"step,omitempty" json:"step,omitempty"`
|
|
}
|
|
|
|
// GetTaskDiffParams defines parameters for GetTaskDiff.
|
|
type GetTaskDiffParams struct {
|
|
Base string `form:"base" json:"base"`
|
|
Tree string `form:"tree" json:"tree"`
|
|
Path string `form:"path" json:"path"`
|
|
OldPath *string `form:"old_path,omitempty" json:"old_path,omitempty"`
|
|
}
|
|
|
|
// GetTaskDirParams defines parameters for GetTaskDir.
|
|
type GetTaskDirParams struct {
|
|
// Path Slash-separated, relative to the worktree root; empty or absent for the root.
|
|
Path *string `form:"path,omitempty" json:"path,omitempty"`
|
|
}
|
|
|
|
// ListTaskEventsParams defines parameters for ListTaskEvents.
|
|
type ListTaskEventsParams struct {
|
|
After *int64 `form:"after,omitempty" json:"after,omitempty"`
|
|
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// GetTaskFileParams defines parameters for GetTaskFile.
|
|
type GetTaskFileParams struct {
|
|
// Path Slash-separated, relative to the worktree root.
|
|
Path string `form:"path" json:"path"`
|
|
}
|
|
|
|
// GetTaskImageParams defines parameters for GetTaskImage.
|
|
type GetTaskImageParams struct {
|
|
Path string `form:"path" json:"path"`
|
|
}
|
|
|
|
// MergeTaskJSONBody defines parameters for MergeTask.
|
|
type MergeTaskJSONBody struct {
|
|
// MergeTitle The squash commit's title: one line, at most 72 characters.
|
|
MergeTitle string `json:"merge_title"`
|
|
}
|
|
|
|
// GetTaskTerminalParams defines parameters for GetTaskTerminal.
|
|
type GetTaskTerminalParams struct {
|
|
Cols int `form:"cols" json:"cols"`
|
|
Rows int `form:"rows" json:"rows"`
|
|
}
|
|
|
|
// RespondInboxJSONRequestBody defines body for RespondInbox for application/json ContentType.
|
|
type RespondInboxJSONRequestBody = InboxRespond
|
|
|
|
// UpdateMeJSONRequestBody defines body for UpdateMe for application/json ContentType.
|
|
type UpdateMeJSONRequestBody = UserUpdate
|
|
|
|
// SetFocusJSONRequestBody defines body for SetFocus for application/json ContentType.
|
|
type SetFocusJSONRequestBody = Focus
|
|
|
|
// MessageLeadJSONRequestBody defines body for MessageLead for application/json ContentType.
|
|
type MessageLeadJSONRequestBody = MessageCreate
|
|
|
|
// UpdateNotificationPrefsJSONRequestBody defines body for UpdateNotificationPrefs for application/json ContentType.
|
|
type UpdateNotificationPrefsJSONRequestBody = NotificationPrefs
|
|
|
|
// SetPaneFocusJSONRequestBody defines body for SetPaneFocus for application/json ContentType.
|
|
type SetPaneFocusJSONRequestBody = PaneFocus
|
|
|
|
// CreateProjectJSONRequestBody defines body for CreateProject for application/json ContentType.
|
|
type CreateProjectJSONRequestBody = ProjectCreate
|
|
|
|
// CreateTaskJSONRequestBody defines body for CreateTask for application/json ContentType.
|
|
type CreateTaskJSONRequestBody = TaskCreate
|
|
|
|
// StartTodoItemJSONRequestBody defines body for StartTodoItem for application/json ContentType.
|
|
type StartTodoItemJSONRequestBody = TodoStart
|
|
|
|
// SendMessageJSONRequestBody defines body for SendMessage for application/json ContentType.
|
|
type SendMessageJSONRequestBody = MessageCreate
|
|
|
|
// MergeTaskJSONRequestBody defines body for MergeTask for application/json ContentType.
|
|
type MergeTaskJSONRequestBody MergeTaskJSONBody
|
|
|
|
// CreateSessionJSONRequestBody defines body for CreateSession for application/json ContentType.
|
|
type CreateSessionJSONRequestBody = SessionCreate
|
|
|
|
// ServerInterface represents all server handlers.
|
|
type ServerInterface interface {
|
|
|
|
// (GET /api/admin/status)
|
|
GetStatus(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (POST /api/blobs)
|
|
UploadBlob(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (GET /api/blobs/{blobId})
|
|
GetBlob(w http.ResponseWriter, r *http.Request, blobId string)
|
|
|
|
// (GET /api/events)
|
|
StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)
|
|
|
|
// (GET /api/inbox)
|
|
ListInbox(w http.ResponseWriter, r *http.Request, params ListInboxParams)
|
|
|
|
// (POST /api/inbox/responses)
|
|
RespondInbox(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (GET /api/inbox/{itemId})
|
|
GetInboxItem(w http.ResponseWriter, r *http.Request, itemId string)
|
|
|
|
// (GET /api/me)
|
|
GetMe(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (PUT /api/me)
|
|
UpdateMe(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (GET /api/me/focus)
|
|
GetFocus(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (PUT /api/me/focus)
|
|
SetFocus(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (POST /api/me/lead/messages)
|
|
MessageLead(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (GET /api/me/lead/sessions)
|
|
ListLeadSessions(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (PUT /api/me/notifications)
|
|
UpdateNotificationPrefs(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (PUT /api/me/pane-focus)
|
|
SetPaneFocus(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (GET /api/projects)
|
|
ListProjects(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (POST /api/projects)
|
|
CreateProject(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (GET /api/projects/{projectId})
|
|
GetProject(w http.ResponseWriter, r *http.Request, projectId string)
|
|
|
|
// (GET /api/projects/{projectId}/tasks)
|
|
ListTasks(w http.ResponseWriter, r *http.Request, projectId string)
|
|
|
|
// (POST /api/projects/{projectId}/tasks)
|
|
CreateTask(w http.ResponseWriter, r *http.Request, projectId string)
|
|
|
|
// (GET /api/projects/{projectId}/todo)
|
|
GetTodo(w http.ResponseWriter, r *http.Request, projectId string)
|
|
|
|
// (POST /api/projects/{projectId}/todo/tasks)
|
|
StartTodoItem(w http.ResponseWriter, r *http.Request, projectId string)
|
|
|
|
// (GET /api/sessions/{sessionId})
|
|
GetSession(w http.ResponseWriter, r *http.Request, sessionId string)
|
|
|
|
// (POST /api/sessions/{sessionId}/compact)
|
|
CompactSession(w http.ResponseWriter, r *http.Request, sessionId string)
|
|
|
|
// (POST /api/sessions/{sessionId}/interrupt)
|
|
InterruptSession(w http.ResponseWriter, r *http.Request, sessionId string)
|
|
|
|
// (POST /api/sessions/{sessionId}/messages)
|
|
SendMessage(w http.ResponseWriter, r *http.Request, sessionId string)
|
|
|
|
// (GET /api/tasks/{taskId})
|
|
GetTask(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/changes)
|
|
GetTaskChanges(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskChangesParams)
|
|
|
|
// (GET /api/tasks/{taskId}/co-authors)
|
|
GetCoAuthors(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/diff)
|
|
GetTaskDiff(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskDiffParams)
|
|
|
|
// (GET /api/tasks/{taskId}/dir)
|
|
GetTaskDir(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskDirParams)
|
|
|
|
// (POST /api/tasks/{taskId}/discard)
|
|
DiscardTask(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/events)
|
|
ListTaskEvents(w http.ResponseWriter, r *http.Request, taskId string, params ListTaskEventsParams)
|
|
|
|
// (GET /api/tasks/{taskId}/file)
|
|
GetTaskFile(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskFileParams)
|
|
|
|
// (GET /api/tasks/{taskId}/image)
|
|
GetTaskImage(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskImageParams)
|
|
|
|
// (POST /api/tasks/{taskId}/merge)
|
|
MergeTask(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (POST /api/tasks/{taskId}/merge-in)
|
|
MergeIn(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/previews)
|
|
ListPreviews(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/reviews)
|
|
ListReviews(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/sessions)
|
|
ListSessions(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (POST /api/tasks/{taskId}/sessions)
|
|
CreateSession(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/snapshots)
|
|
ListSnapshots(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (POST /api/tasks/{taskId}/snapshots/{n}/fork)
|
|
ForkSnapshot(w http.ResponseWriter, r *http.Request, taskId string, n int)
|
|
|
|
// (GET /api/tasks/{taskId}/terminal)
|
|
GetTaskTerminal(w http.ResponseWriter, r *http.Request, taskId string, params GetTaskTerminalParams)
|
|
|
|
// (GET /api/tasks/{taskId}/unmerged)
|
|
GetUnmerged(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/tasks/{taskId}/workflow)
|
|
GetTaskWorkflow(w http.ResponseWriter, r *http.Request, taskId string)
|
|
|
|
// (GET /api/workflows)
|
|
ListWorkflows(w http.ResponseWriter, r *http.Request)
|
|
|
|
// (DELETE /api/workflows/{name})
|
|
DeleteWorkflow(w http.ResponseWriter, r *http.Request, name string)
|
|
|
|
// (GET /api/workflows/{name})
|
|
GetWorkflow(w http.ResponseWriter, r *http.Request, name string)
|
|
|
|
// (PUT /api/workflows/{name})
|
|
PutWorkflow(w http.ResponseWriter, r *http.Request, name string)
|
|
}
|
|
|
|
// ServerInterfaceWrapper converts contexts to parameters.
|
|
type ServerInterfaceWrapper struct {
|
|
Handler ServerInterface
|
|
HandlerMiddlewares []MiddlewareFunc
|
|
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
|
|
}
|
|
|
|
type MiddlewareFunc func(http.Handler) http.Handler
|
|
|
|
// GetStatus operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetStatus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetStatus(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// UploadBlob operation middleware
|
|
func (siw *ServerInterfaceWrapper) UploadBlob(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.UploadBlob(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetBlob operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetBlob(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "blobId" -------------
|
|
var blobId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "blobId", r.PathValue("blobId"), &blobId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "blobId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetBlob(w, r, blobId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// StreamEvents operation middleware
|
|
func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params StreamEventsParams
|
|
|
|
// ------------- Optional query parameter "after" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "after", r.URL.Query(), ¶ms.After, runtime.BindQueryParameterOptions{Type: "integer", Format: "int64"})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "after"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "after", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "task_id" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "task_id", r.URL.Query(), ¶ms.TaskId, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "task_id"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "task_id", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "lead" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "lead", r.URL.Query(), ¶ms.Lead, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "lead"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "lead", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Last-Event-ID" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Last-Event-ID")]; found {
|
|
var LastEventID int64
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Last-Event-ID", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Last-Event-ID", valueList[0], &LastEventID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: "int64"})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Last-Event-ID", Err: err})
|
|
return
|
|
}
|
|
|
|
params.LastEventID = &LastEventID
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.StreamEvents(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListInbox operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListInbox(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListInboxParams
|
|
|
|
// ------------- Optional query parameter "project_id" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "project_id", r.URL.Query(), ¶ms.ProjectId, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "project_id"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "project_id", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "task_id" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "task_id", r.URL.Query(), ¶ms.TaskId, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "task_id"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "task_id", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "state" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "state", r.URL.Query(), ¶ms.State, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "state"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "state", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListInbox(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// RespondInbox operation middleware
|
|
func (siw *ServerInterfaceWrapper) RespondInbox(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.RespondInbox(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetInboxItem operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetInboxItem(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "itemId" -------------
|
|
var itemId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "itemId", r.PathValue("itemId"), &itemId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetInboxItem(w, r, itemId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetMe operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetMe(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetMe(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// UpdateMe operation middleware
|
|
func (siw *ServerInterfaceWrapper) UpdateMe(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.UpdateMe(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetFocus operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetFocus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetFocus(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// SetFocus operation middleware
|
|
func (siw *ServerInterfaceWrapper) SetFocus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.SetFocus(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// MessageLead operation middleware
|
|
func (siw *ServerInterfaceWrapper) MessageLead(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.MessageLead(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListLeadSessions operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListLeadSessions(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListLeadSessions(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// UpdateNotificationPrefs operation middleware
|
|
func (siw *ServerInterfaceWrapper) UpdateNotificationPrefs(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.UpdateNotificationPrefs(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// SetPaneFocus operation middleware
|
|
func (siw *ServerInterfaceWrapper) SetPaneFocus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.SetPaneFocus(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListProjects operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListProjects(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListProjects(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateProject operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateProject(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateProject(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetProject operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetProject(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "projectId" -------------
|
|
var projectId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetProject(w, r, projectId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListTasks operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListTasks(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "projectId" -------------
|
|
var projectId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListTasks(w, r, projectId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateTask operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateTask(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "projectId" -------------
|
|
var projectId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateTask(w, r, projectId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTodo operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTodo(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "projectId" -------------
|
|
var projectId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTodo(w, r, projectId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// StartTodoItem operation middleware
|
|
func (siw *ServerInterfaceWrapper) StartTodoItem(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "projectId" -------------
|
|
var projectId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "projectId", r.PathValue("projectId"), &projectId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "projectId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.StartTodoItem(w, r, projectId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetSession operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetSession(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "sessionId" -------------
|
|
var sessionId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetSession(w, r, sessionId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CompactSession operation middleware
|
|
func (siw *ServerInterfaceWrapper) CompactSession(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "sessionId" -------------
|
|
var sessionId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CompactSession(w, r, sessionId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// InterruptSession operation middleware
|
|
func (siw *ServerInterfaceWrapper) InterruptSession(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "sessionId" -------------
|
|
var sessionId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.InterruptSession(w, r, sessionId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// SendMessage operation middleware
|
|
func (siw *ServerInterfaceWrapper) SendMessage(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "sessionId" -------------
|
|
var sessionId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "sessionId", r.PathValue("sessionId"), &sessionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "sessionId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.SendMessage(w, r, sessionId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTask operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTask(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTask(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskChanges operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskChanges(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTaskChangesParams
|
|
|
|
// ------------- Optional query parameter "since" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "since", r.URL.Query(), ¶ms.Since, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "since"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "since", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "snapshot" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "snapshot", r.URL.Query(), ¶ms.Snapshot, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "snapshot"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "snapshot", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "step" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "step", r.URL.Query(), ¶ms.Step, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "step"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "step", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskChanges(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetCoAuthors operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetCoAuthors(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetCoAuthors(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskDiff operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskDiff(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTaskDiffParams
|
|
|
|
// ------------- Required query parameter "base" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "base", r.URL.Query(), ¶ms.Base, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "base"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "base", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Required query parameter "tree" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "tree", r.URL.Query(), ¶ms.Tree, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "tree"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "tree", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Required query parameter "path" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "path", r.URL.Query(), ¶ms.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "old_path" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "old_path", r.URL.Query(), ¶ms.OldPath, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "old_path"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "old_path", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskDiff(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskDir operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskDir(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTaskDirParams
|
|
|
|
// ------------- Optional query parameter "path" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "path", r.URL.Query(), ¶ms.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskDir(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// DiscardTask operation middleware
|
|
func (siw *ServerInterfaceWrapper) DiscardTask(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.DiscardTask(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListTaskEvents operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListTaskEvents(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListTaskEventsParams
|
|
|
|
// ------------- Optional query parameter "after" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "after", r.URL.Query(), ¶ms.After, runtime.BindQueryParameterOptions{Type: "integer", Format: "int64"})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "after"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "after", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", r.URL.Query(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "limit"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListTaskEvents(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskFile operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskFile(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTaskFileParams
|
|
|
|
// ------------- Required query parameter "path" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "path", r.URL.Query(), ¶ms.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskFile(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskImage operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskImage(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTaskImageParams
|
|
|
|
// ------------- Required query parameter "path" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "path", r.URL.Query(), ¶ms.Path, runtime.BindQueryParameterOptions{Type: "string", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "path"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "path", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskImage(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// MergeTask operation middleware
|
|
func (siw *ServerInterfaceWrapper) MergeTask(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.MergeTask(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// MergeIn operation middleware
|
|
func (siw *ServerInterfaceWrapper) MergeIn(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.MergeIn(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListPreviews operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListPreviews(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListPreviews(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListReviews operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListReviews(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListReviews(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListSessions operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListSessions(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListSessions(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateSession operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateSession(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateSession(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListSnapshots operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListSnapshots(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListSnapshots(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ForkSnapshot operation middleware
|
|
func (siw *ServerInterfaceWrapper) ForkSnapshot(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Path parameter "n" -------------
|
|
var n int
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "n", r.PathValue("n"), &n, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "n", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ForkSnapshot(w, r, taskId, n)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskTerminal operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskTerminal(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTaskTerminalParams
|
|
|
|
// ------------- Required query parameter "cols" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "cols", r.URL.Query(), ¶ms.Cols, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "cols"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cols", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
// ------------- Required query parameter "rows" -------------
|
|
|
|
err = runtime.BindQueryParameterWithOptions("form", true, true, "rows", r.URL.Query(), ¶ms.Rows, runtime.BindQueryParameterOptions{Type: "integer", Format: ""})
|
|
if err != nil {
|
|
var requiredError *runtime.RequiredParameterError
|
|
if errors.As(err, &requiredError) {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "rows"})
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "rows", Err: err})
|
|
}
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskTerminal(w, r, taskId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetUnmerged operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetUnmerged(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetUnmerged(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTaskWorkflow operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTaskWorkflow(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "taskId" -------------
|
|
var taskId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "taskId", r.PathValue("taskId"), &taskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "taskId", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTaskWorkflow(w, r, taskId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListWorkflows operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListWorkflows(w http.ResponseWriter, r *http.Request) {
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListWorkflows(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// DeleteWorkflow operation middleware
|
|
func (siw *ServerInterfaceWrapper) DeleteWorkflow(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "name" -------------
|
|
var name string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "name", r.PathValue("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.DeleteWorkflow(w, r, name)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetWorkflow operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetWorkflow(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "name" -------------
|
|
var name string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "name", r.PathValue("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetWorkflow(w, r, name)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PutWorkflow operation middleware
|
|
func (siw *ServerInterfaceWrapper) PutWorkflow(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
_ = err
|
|
|
|
// ------------- Path parameter "name" -------------
|
|
var name string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "name", r.PathValue("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: "", ValueIsUnescaped: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PutWorkflow(w, r, name)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
type UnescapedCookieParamError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *UnescapedCookieParamError) Error() string {
|
|
return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName)
|
|
}
|
|
|
|
func (e *UnescapedCookieParamError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type UnmarshalingParamError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *UnmarshalingParamError) Error() string {
|
|
return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error())
|
|
}
|
|
|
|
func (e *UnmarshalingParamError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type RequiredParamError struct {
|
|
ParamName string
|
|
}
|
|
|
|
func (e *RequiredParamError) Error() string {
|
|
return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName)
|
|
}
|
|
|
|
type RequiredHeaderError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *RequiredHeaderError) Error() string {
|
|
return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName)
|
|
}
|
|
|
|
func (e *RequiredHeaderError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type InvalidParamFormatError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *InvalidParamFormatError) Error() string {
|
|
return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error())
|
|
}
|
|
|
|
func (e *InvalidParamFormatError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type TooManyValuesForParamError struct {
|
|
ParamName string
|
|
Count int
|
|
}
|
|
|
|
func (e *TooManyValuesForParamError) Error() string {
|
|
return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count)
|
|
}
|
|
|
|
// Handler creates http.Handler with routing matching OpenAPI spec.
|
|
func Handler(si ServerInterface) http.Handler {
|
|
return HandlerWithOptions(si, StdHTTPServerOptions{})
|
|
}
|
|
|
|
// ServeMux is an abstraction of [http.ServeMux].
|
|
type ServeMux interface {
|
|
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
|
|
http.Handler
|
|
}
|
|
|
|
type StdHTTPServerOptions struct {
|
|
BaseURL string
|
|
BaseRouter ServeMux
|
|
Middlewares []MiddlewareFunc
|
|
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
|
|
}
|
|
|
|
// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
|
|
func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler {
|
|
return HandlerWithOptions(si, StdHTTPServerOptions{
|
|
BaseRouter: m,
|
|
})
|
|
}
|
|
|
|
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler {
|
|
return HandlerWithOptions(si, StdHTTPServerOptions{
|
|
BaseURL: baseURL,
|
|
BaseRouter: m,
|
|
})
|
|
}
|
|
|
|
// HandlerWithOptions creates http.Handler with additional options
|
|
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler {
|
|
m := options.BaseRouter
|
|
|
|
if m == nil {
|
|
m = http.NewServeMux()
|
|
}
|
|
if options.ErrorHandlerFunc == nil {
|
|
options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) {
|
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
|
}
|
|
}
|
|
|
|
wrapper := ServerInterfaceWrapper{
|
|
Handler: si,
|
|
HandlerMiddlewares: options.Middlewares,
|
|
ErrorHandlerFunc: options.ErrorHandlerFunc,
|
|
}
|
|
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/me", wrapper.GetMe)
|
|
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me", wrapper.UpdateMe)
|
|
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me/notifications", wrapper.UpdateNotificationPrefs)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/me/lead/sessions", wrapper.ListLeadSessions)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/me/lead/messages", wrapper.MessageLead)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/me/focus", wrapper.GetFocus)
|
|
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me/focus", wrapper.SetFocus)
|
|
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/me/pane-focus", wrapper.SetPaneFocus)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects", wrapper.ListProjects)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/projects", wrapper.CreateProject)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects/{projectId}", wrapper.GetProject)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects/{projectId}/tasks", wrapper.ListTasks)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/projects/{projectId}/tasks", wrapper.CreateTask)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/projects/{projectId}/todo", wrapper.GetTodo)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/projects/{projectId}/todo/tasks", wrapper.StartTodoItem)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}", wrapper.GetTask)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/workflow", wrapper.GetTaskWorkflow)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/unmerged", wrapper.GetUnmerged)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/co-authors", wrapper.GetCoAuthors)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/merge", wrapper.MergeTask)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/merge-in", wrapper.MergeIn)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/discard", wrapper.DiscardTask)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/events", wrapper.ListTaskEvents)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/changes", wrapper.GetTaskChanges)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/image", wrapper.GetTaskImage)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/diff", wrapper.GetTaskDiff)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/dir", wrapper.GetTaskDir)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/file", wrapper.GetTaskFile)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/terminal", wrapper.GetTaskTerminal)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/previews", wrapper.ListPreviews)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/snapshots", wrapper.ListSnapshots)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/reviews", wrapper.ListReviews)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/snapshots/{n}/fork", wrapper.ForkSnapshot)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/tasks/{taskId}/sessions", wrapper.ListSessions)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/tasks/{taskId}/sessions", wrapper.CreateSession)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/sessions/{sessionId}", wrapper.GetSession)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/sessions/{sessionId}/messages", wrapper.SendMessage)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/sessions/{sessionId}/compact", wrapper.CompactSession)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/sessions/{sessionId}/interrupt", wrapper.InterruptSession)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/blobs", wrapper.UploadBlob)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/blobs/{blobId}", wrapper.GetBlob)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/inbox", wrapper.ListInbox)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/inbox/{itemId}", wrapper.GetInboxItem)
|
|
m.HandleFunc(http.MethodPost+" "+options.BaseURL+"/api/inbox/responses", wrapper.RespondInbox)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/events", wrapper.StreamEvents)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/admin/status", wrapper.GetStatus)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/workflows", wrapper.ListWorkflows)
|
|
m.HandleFunc(http.MethodDelete+" "+options.BaseURL+"/api/workflows/{name}", wrapper.DeleteWorkflow)
|
|
m.HandleFunc(http.MethodGet+" "+options.BaseURL+"/api/workflows/{name}", wrapper.GetWorkflow)
|
|
m.HandleFunc(http.MethodPut+" "+options.BaseURL+"/api/workflows/{name}", wrapper.PutWorkflow)
|
|
|
|
return m
|
|
}
|
|
|
|
// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec.
|
|
// Stored as a slice of fixed-width chunks rather than one concatenated
|
|
// const string: with thousands of chunks the chained `+` fold is several
|
|
// times slower for the Go compiler than parsing a slice literal.
|
|
var swaggerSpec = []string{
|
|
"7L1tcxs5kiD8VxB8nghZuyVKnum9u5XjPrhtd4/n2m2fpb6Ou9kJDViVJDEqAjSAEsV2+L9fIBNAoYoo",
|
|
"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"R7KVN25iT6PGrhsvmTgqA1MwXmOvVO/mDSlbNCc1tA7SjfTf9l711gcjfgPsFI59vOLDpaqpgxdLO8NF",
|
|
"6zR48MCtCPZv2ieZF4kMSlUB++7s7CyaM93roUO8z5zSwM1eT1jS4G+EMyw0lBvkivub0+UHxfZ09x60",
|
|
"7257SkTcE16xQGOLli3Chq7hf2yfcZN0BMvSeKyb2ZfzqbMQXjwOVwdNd5UCI49sNlI49iN7yMJmYY6h",
|
|
"4mb+eWjXNf1PdsJp49RB6XyoGfGYdpzsJ+5EY6iEN71iezIwO42OKyWPrAfzwCX9Y7ff8UMH2sV5hvzN",
|
|
"Dggy7uAbFJ3D0vZbSn6Nbz2GatJvoDVCQ8G0xbSHGTb0JWSK77U22lRoiRA4/eiefSIEdxi4C4uX+Psw",
|
|
"dmVq7tEn1ZRhHS7id0QbvpGwT5kp1Xp7L/wYyoW9Hw1seT9MY1RgRa973Dmy9OG2ucgDuEyigXx8e8jp",
|
|
"fiBK8T3T7mbUavZoZhiwtK55mbi5qXu008PIXlWDE16HgYHdYf568fbnoBlhxR0TPaKODz518sfTs7PU",
|
|
"I5piVHACE2Z1VtLHsQzXfNd0sWWM1WwUojxe+dEdnrG3enSPId+puOGnT/83AAD//w==",
|
|
}
|
|
|
|
// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes,
|
|
// after base64-decoding and flate-decompressing the embedded blob.
|
|
func decodeSpec() ([]byte, error) {
|
|
encoded := strings.Join(swaggerSpec, "")
|
|
compressed, err := base64.StdEncoding.DecodeString(encoded)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error base64 decoding spec: %w", err)
|
|
}
|
|
zr := flate.NewReader(bytes.NewReader(compressed))
|
|
var buf bytes.Buffer
|
|
if _, err := buf.ReadFrom(zr); err != nil {
|
|
return nil, fmt.Errorf("read flate: %w", err)
|
|
}
|
|
if err := zr.Close(); err != nil {
|
|
return nil, fmt.Errorf("close flate reader: %w", err)
|
|
}
|
|
|
|
return buf.Bytes(), nil
|
|
}
|
|
|
|
var rawSpec = decodeSpecCached()
|
|
|
|
// a naive cache of the decoded OpenAPI spec
|
|
func decodeSpecCached() func() ([]byte, error) {
|
|
data, err := decodeSpec()
|
|
return func() ([]byte, error) {
|
|
return data, err
|
|
}
|
|
}
|
|
|
|
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
|
|
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
|
|
res := make(map[string]func() ([]byte, error))
|
|
if len(pathToFile) > 0 {
|
|
res[pathToFile] = rawSpec
|
|
}
|
|
|
|
return res
|
|
}
|
|
|
|
// GetSpec returns the OpenAPI specification corresponding to the generated
|
|
// code in this file. External references in the spec are resolved through
|
|
// PathToRawSpec; externally-referenced files must be embedded in their
|
|
// corresponding Go packages (via the import-mapping feature). URL-based
|
|
// external refs are not supported.
|
|
func GetSpec() (swagger *openapi3.T, err error) {
|
|
resolvePath := PathToRawSpec("")
|
|
|
|
loader := openapi3.NewLoader()
|
|
loader.IsExternalRefsAllowed = true
|
|
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
|
|
pathToFile := url.String()
|
|
pathToFile = path.Clean(pathToFile)
|
|
getSpec, ok := resolvePath[pathToFile]
|
|
if !ok {
|
|
err1 := fmt.Errorf("path not found: %s", pathToFile)
|
|
return nil, err1
|
|
}
|
|
return getSpec()
|
|
}
|
|
var specData []byte
|
|
specData, err = rawSpec()
|
|
if err != nil {
|
|
return
|
|
}
|
|
swagger, err = loader.LoadFromData(specData)
|
|
if err != nil {
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI
|
|
// specification: decompressed but not unmarshaled. External references
|
|
// are not resolved here; the bytes are the spec exactly as embedded by
|
|
// codegen. The result is cached at package init time, so repeated calls
|
|
// are cheap.
|
|
func GetSpecJSON() ([]byte, error) {
|
|
return rawSpec()
|
|
}
|
|
|
|
// GetSwagger returns the OpenAPI specification corresponding to the
|
|
// generated code in this file.
|
|
//
|
|
// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger
|
|
// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for
|
|
// backwards compatibility.
|
|
func GetSwagger() (*openapi3.T, error) {
|
|
return GetSpec()
|
|
}
|