// Package protocol provides primitives to interact with the openapi HTTP API. // // Code generated by albedo/apigen version v2.8.0 DO NOT EDIT. package protocol import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "github.com/oapi-codegen/runtime" ) // Account defines model for Account. type Account struct { Detail string `json:"detail"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Label string `json:"label"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` SelectedByProfiles []ID `json:"selected_by_profiles"` } // ActionOperation Operation must be declared in this contract, or the installed extension contract version. Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map keys name declared parameters; body map keys are JSON pointers into the request object. Missing optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with no remote schema retrieval. type ActionOperation struct { Body map[string]Binding `json:"body"` Headers map[string]Binding `json:"headers"` Method string `json:"method"` OperationID string `json:"operation_id"` Path map[string]Binding `json:"path"` // PathTemplate Daemon-relative URL, including any representation query. No foreign origin or fragment. PathTemplate ResourceURL `json:"path_template"` Query map[string]Binding `json:"query"` // ResultSchema Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. ResultSchema DynamicJSON `json:"result_schema"` // SuccessStatus Expected synchronous JSON success status. Omitted operations accept 200 or 201 for mutations and 200 for reads. SuccessStatus *int64 `json:"success_status,omitempty"` } // ActiveOutput Ordered unfinished output captured with the session cursor. Exactly one of text or reference is non-null. References retain a fixed byte cutoff through their short snapshot lease. A run retains at most 64 MiB of unfinished output across at most 256 descriptors. Inline output is limited to 64 KiB encoded; larger content uses references. type ActiveOutput struct { Bytes Counter `json:"bytes"` ElapsedMs *int64 `json:"elapsed_ms" nullable:"true"` Kind string `json:"kind"` // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` Reference *ContentReference `json:"reference" nullable:"true"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` Text *string `json:"text" nullable:"true"` } // Activity defines model for Activity. type Activity struct { CurrentRequest *AgentRequest `json:"current_request,omitempty" nullable:"true"` LatestAnswer *struct { Bytes Counter `json:"bytes"` // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` } `json:"latest_answer" nullable:"true"` LatestInput *struct { Bytes Counter `json:"bytes"` // InputID Opaque identity. Never infer a resource type or route from its contents. InputID ID `json:"input_id"` Source string `json:"source"` } `json:"latest_input" nullable:"true"` LatestProgress *string `json:"latest_progress,omitempty" nullable:"true"` Lines []struct { Kind string `json:"kind"` Text string `json:"text"` } `json:"lines"` // ObservedAt UTC RFC 3339. ObservedAt Timestamp `json:"observed_at"` OutputScalars Counter `json:"output_scalars"` OutputUTF8Bytes Counter `json:"output_utf8_bytes"` } // ActivityEvent defines model for ActivityEvent. type ActivityEvent struct { Data struct { Activity Activity `json:"activity"` CurrentProgress []ToolProgress `json:"current_progress"` Cursor Cursor `json:"cursor"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` Status SessionStatus `json:"status"` } `json:"data"` Type string `json:"type"` } // AdmissionProblem defines model for AdmissionProblem. type AdmissionProblem struct { Code string `json:"code"` Detail string `json:"detail"` Fields []struct { Detail string `json:"detail"` Pointer string `json:"pointer"` } `json:"fields,omitempty"` Status int64 `json:"status"` Title string `json:"title"` Type string `json:"type"` } // AgentRequest defines model for AgentRequest. type AgentRequest struct { // InputID Opaque identity. Never infer a resource type or route from its contents. InputID ID `json:"input_id"` Text string `json:"text"` } // Auth defines model for Auth. type Auth struct { Accounts []Account `json:"accounts"` Providers []LoginProvider `json:"providers"` } // Binding JSON pointer resolves against the selected row, submitted form, or installed session snapshot. No expression language. type Binding = json.RawMessage // CachePolicyEntry defines model for CachePolicyEntry. type CachePolicyEntry struct { Checked string `json:"checked"` Clock string `json:"clock"` Evidence string `json:"evidence"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Layer string `json:"layer"` Match struct { Extension []string `json:"extension" nullable:"true"` Host []string `json:"host" nullable:"true"` Model []string `json:"model" nullable:"true"` } `json:"match"` Note string `json:"note"` Policy string `json:"policy"` Read *float64 `json:"read" nullable:"true"` Source string `json:"source"` Survival *struct { Max *Counter `json:"max" nullable:"true"` Typical Counter `json:"typical"` } `json:"survival" nullable:"true"` Tiers []struct { Seconds Counter `json:"seconds"` Write *float64 `json:"write" nullable:"true"` } `json:"tiers" nullable:"true"` } // CachePolicyLayer defines model for CachePolicyLayer. type CachePolicyLayer struct { Error *SafeReason `json:"error" nullable:"true"` Loaded bool `json:"loaded"` Name string `json:"name"` Path string `json:"path"` } // CachePolicyPage defines model for CachePolicyPage. type CachePolicyPage struct { Entries []CachePolicyEntry `json:"entries"` Layers []CachePolicyLayer `json:"layers"` Matched *CachePolicyEntry `json:"matched" nullable:"true"` Next *PageToken `json:"next" nullable:"true"` } // CachePolicyReloadOutcome defines model for CachePolicyReloadOutcome. type CachePolicyReloadOutcome struct { Failure *SafeReason `json:"failure" nullable:"true"` State string `json:"state"` } // CachePrior defines model for CachePrior. type CachePrior struct { Model *ID `json:"model" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` Source string `json:"source"` TTLSeconds *int64 `json:"ttl_seconds" nullable:"true"` } // CapabilitySettings defines model for CapabilitySettings. type CapabilitySettings struct { Preferences map[string]bool `json:"preferences"` } // CapabilitySettingsChange defines model for CapabilitySettingsChange. type CapabilitySettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource CapabilitySettingsResource `json:"resource"` } // CapabilitySettingsPatch Resolve candidate IDs to stable preference keys under the observed catalog revision. type CapabilitySettingsPatch struct { // CatalogRevision Opaque identity. Never infer a resource type or route from its contents. CatalogRevision ID `json:"catalog_revision"` // CatalogSessionID Opaque identity. Never infer a resource type or route from its contents. CatalogSessionID ID `json:"catalog_session_id"` Choices map[string]*bool `json:"choices"` } // CapabilitySettingsResource defines model for CapabilitySettingsResource. type CapabilitySettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value CapabilitySettings `json:"value"` } // Catalog Pagination is independent for discovered candidates and loaded commands; next tokens identify their section. type Catalog struct { Discovery *struct { Candidates []CatalogCandidate `json:"candidates"` Diagnostics []SafeReason `json:"diagnostics"` Next *PageToken `json:"next" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } `json:"discovery" nullable:"true"` DiscoveryFailure *SafeReason `json:"discovery_failure" nullable:"true"` Loaded struct { Commands []json.RawMessage `json:"commands"` Next *PageToken `json:"next" nullable:"true"` Revision *ID `json:"revision" nullable:"true"` } `json:"loaded"` // NativeCommands Static HTTP declarations for selected extensions when no composition has been loaded. Reading these declarations does not prepare extensions or start a kernel. NativeCommands []HTTPCommand `json:"native_commands,omitempty"` Pages []PageDescriptor `json:"pages,omitempty"` } // CatalogCandidate defines model for CatalogCandidate. type CatalogCandidate struct { Dependencies []ID `json:"dependencies"` Description string `json:"description"` Diagnostic *SafeReason `json:"diagnostic" nullable:"true"` EffectiveEnabled bool `json:"effective_enabled"` Eligible bool `json:"eligible"` // Extension Installed extension metadata for the inspector. Null for other candidate kinds. Extension *ExtensionMetadata `json:"extension" nullable:"true"` GlobalPreference *bool `json:"global_preference" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` PreferenceKey *ID `json:"preference_key" nullable:"true"` Quarantined bool `json:"quarantined"` ResolvedSource *string `json:"resolved_source" nullable:"true"` SessionOverride *bool `json:"session_override" nullable:"true"` ShadowedBy *ID `json:"shadowed_by" nullable:"true"` Source string `json:"source"` Title string `json:"title"` Valid bool `json:"valid"` } // Checkpoint defines model for Checkpoint. type Checkpoint struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` Position Counter `json:"position"` Preview Preview `json:"preview"` Title string `json:"title"` TurnType string `json:"turn_type"` } // CheckpointPage defines model for CheckpointPage. type CheckpointPage struct { HighWater Counter `json:"high_water"` Items []Checkpoint `json:"items"` Newer *PageToken `json:"newer" nullable:"true"` Older *PageToken `json:"older" nullable:"true"` } // ChildSessionIntent defines model for ChildSessionIntent. type ChildSessionIntent struct { Address string `json:"address"` Effort *string `json:"effort" nullable:"true"` // InitialInputID Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. InitialInputID UUIDv7 `json:"initial_input_id"` Kind string `json:"kind"` Model *ID `json:"model" nullable:"true"` Name string `json:"name"` // ParentID Opaque identity. Never infer a resource type or route from its contents. ParentID ID `json:"parent_id"` Task string `json:"task"` } // ChildSessionRequest defines model for ChildSessionRequest. type ChildSessionRequest struct { Address string `json:"address"` Effort *string `json:"effort,omitempty" nullable:"true"` // InitialInputID Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. InitialInputID UUIDv7 `json:"initial_input_id"` Kind string `json:"kind"` Model *ID `json:"model,omitempty" nullable:"true"` Name string `json:"name"` // ParentID Opaque identity. Never infer a resource type or route from its contents. ParentID ID `json:"parent_id"` Task string `json:"task"` } // CollectionBatch Examples: {"events":[{"data":{"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"session_id":"01a0fcea-2b00-7000-8000-000000000001","status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null}},"type":"activity"}]} type CollectionBatch = json.RawMessage // CollectionInvalidateEvent defines model for CollectionInvalidateEvent. type CollectionInvalidateEvent struct { Data struct { ScopeDirty bool `json:"scope_dirty"` SessionIDs []ID `json:"session_ids"` Urls []ResourceURL `json:"urls"` } `json:"data"` Type string `json:"type"` } // CollectionMailEvent defines model for CollectionMailEvent. type CollectionMailEvent struct { Data MailMetadata `json:"data"` Type string `json:"type"` } // CollectionOverflowEvent defines model for CollectionOverflowEvent. type CollectionOverflowEvent struct { Data EmptyRequest `json:"data"` Type string `json:"type"` } // CollectionReadyBatch Examples: {"events":[{"data":{},"type":"ready"},{"data":{"reason":"initial"},"type":"reset"}]} type CollectionReadyBatch struct { Events []interface{} `json:"events"` } // CollectionReadyEvent defines model for CollectionReadyEvent. type CollectionReadyEvent struct { Data EmptyRequest `json:"data"` Type string `json:"type"` } // CollectionResetEvent defines model for CollectionResetEvent. type CollectionResetEvent struct { Data struct { Reason string `json:"reason"` } `json:"data"` Type string `json:"type"` } // CollectionSSE One parsed SSE event. Decode data as JSON and validate CollectionBatch separately; contentSchema is not asserted by ordinary JSON Schema validation. No event, id or retry fields are emitted. // // Examples: {"data":"{\"events\":[{\"type\":\"ready\",\"data\":{}},{\"type\":\"reset\",\"data\":{\"reason\":\"initial\"}}]}"}, {"data":"{\"events\":[{\"type\":\"activity\",\"data\":{\"session_id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"cursor\":{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"sequence\":0},\"status\":{\"phase\":\"idle\",\"run_id\":null,\"interrupt_requested\":false,\"blocking_reason\":null},\"current_progress\":[],\"activity\":{\"lines\":[],\"output_scalars\":0,\"output_utf8_bytes\":0,\"observed_at\":\"2026-10-02T14:00:00Z\",\"latest_input\":null,\"latest_answer\":null}}}]}"} type CollectionSSE struct { Data string `json:"data"` } // CommandInputRequest defines model for CommandInputRequest. type CommandInputRequest struct { // Arguments Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Arguments DynamicJSON `json:"arguments"` ClientID *string `json:"client_id,omitempty"` // CommandID Opaque identity. Never infer a resource type or route from its contents. CommandID ID `json:"command_id"` Kind string `json:"kind"` } // CompactionObservation defines model for CompactionObservation. type CompactionObservation struct { AfterTokens *Counter `json:"after_tokens" nullable:"true"` BeforeTokens *Counter `json:"before_tokens" nullable:"true"` EvictedEntries Counter `json:"evicted_entries"` Strategy *ID `json:"strategy" nullable:"true"` Summary string `json:"summary"` } // CompactionRequest defines model for CompactionRequest. type CompactionRequest struct { // Strategy Opaque identity. Never infer a resource type or route from its contents. Strategy *ID `json:"strategy,omitempty"` } // CompactionResult defines model for CompactionResult. type CompactionResult struct { EffectiveStrategy *ID `json:"effective_strategy" nullable:"true"` Failure *SafeReason `json:"failure" nullable:"true"` Observation *CompactionObservation `json:"observation" nullable:"true"` SelectionApplied bool `json:"selection_applied"` State string `json:"state"` } // Composition defines model for Composition. type Composition struct { Availability map[string]bool `json:"availability"` Dependencies map[string][]ID `json:"dependencies"` // DesiredRevision Opaque identity. Never infer a resource type or route from its contents. DesiredRevision ID `json:"desired_revision"` LoadedRevision *ID `json:"loaded_revision" nullable:"true"` NeedsReload bool `json:"needs_reload"` Quarantine []QuarantineDiagnostic `json:"quarantine"` } // ContentPart Offsets count exact stored UTF-8 bytes. type ContentPart struct { Complete bool `json:"complete"` Encoding string `json:"encoding"` Field string `json:"field"` OffsetBytes Counter `json:"offset_bytes"` Text string `json:"text"` } // ContentReference defines model for ContentReference. type ContentReference struct { Bytes Counter `json:"bytes"` Field string `json:"field"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } // ContextCompaction defines model for ContextCompaction. type ContextCompaction struct { AfterItems *Counter `json:"after_items" nullable:"true"` BeforeItems *Counter `json:"before_items" nullable:"true"` EstimateMethod *string `json:"estimate_method" nullable:"true"` EstimatedInputTokens *Counter `json:"estimated_input_tokens" nullable:"true"` InputLimitTokens *Counter `json:"input_limit_tokens" nullable:"true"` ProviderCachedInputTokens *Counter `json:"provider_cached_input_tokens" nullable:"true"` ProviderInputTokens *Counter `json:"provider_input_tokens" nullable:"true"` Source *string `json:"source" nullable:"true"` Status string `json:"status"` Strategy *ID `json:"strategy" nullable:"true"` TriggerFreePercent *float64 `json:"trigger_free_percent" nullable:"true"` } // ContextRead defines model for ContextRead. type ContextRead = json.RawMessage // ContextSection defines model for ContextSection. type ContextSection struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` ItemCount Counter `json:"item_count"` Kind string `json:"kind"` Label string `json:"label"` PageCount Counter `json:"page_count"` Preview Preview `json:"preview"` Source *string `json:"source" nullable:"true"` UTF8Bytes Counter `json:"utf8_bytes"` } // ContextSectionPage defines model for ContextSectionPage. type ContextSectionPage struct { Omitted *string `json:"omitted" nullable:"true"` Page Counter `json:"page"` PageCount Counter `json:"page_count"` // SectionID Opaque identity. Never infer a resource type or route from its contents. SectionID ID `json:"section_id"` // SnapshotID Opaque identity. Never infer a resource type or route from its contents. SnapshotID ID `json:"snapshot_id"` Text string `json:"text"` } // ContextSummary defines model for ContextSummary. type ContextSummary struct { CapturedAt *Timestamp `json:"captured_at" nullable:"true"` Compaction ContextCompaction `json:"compaction"` ContextWindowTokens *Counter `json:"context_window_tokens" nullable:"true"` Model *ID `json:"model" nullable:"true"` Protocol *string `json:"protocol" nullable:"true"` Provider *ID `json:"provider" nullable:"true"` Reason *SafeReason `json:"reason" nullable:"true"` Sections []ContextSection `json:"sections"` SnapshotID *ID `json:"snapshot_id" nullable:"true"` State string `json:"state"` } // ContinueInputRequest defines model for ContinueInputRequest. type ContinueInputRequest struct { ClientID *string `json:"client_id,omitempty"` Kind string `json:"kind"` } // Counter defines model for Counter. type Counter = int64 // Creation defines model for Creation. type Creation struct { Resolved struct { Effort *string `json:"effort" nullable:"true"` Model *ID `json:"model" nullable:"true"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } `json:"resolved"` Submitted json.RawMessage `json:"submitted"` } // CreationDecision defines model for CreationDecision. type CreationDecision struct { Admission string `json:"admission"` Creation *Creation `json:"creation" nullable:"true"` DecidedAt *Timestamp `json:"decided_at" nullable:"true"` DeletedAt *Timestamp `json:"deleted_at" nullable:"true"` HTTPStatus int64 `json:"http_status"` Kind string `json:"kind"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // Cursor defines model for Cursor. type Cursor struct { // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` Sequence Counter `json:"sequence"` } // Delivery defines model for Delivery. type Delivery struct { Attempts Counter `json:"attempts"` DeferralReason *SafeReason `json:"deferral_reason" nullable:"true"` DeliveredAt *Timestamp `json:"delivered_at" nullable:"true"` // HookID Opaque identity. Never infer a resource type or route from its contents. HookID ID `json:"hook_id"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // ReceivedAt UTC RFC 3339. ReceivedAt Timestamp `json:"received_at"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // DeliveryDetail defines model for DeliveryDetail. type DeliveryDetail struct { Attempts Counter `json:"attempts"` DeferralReason *SafeReason `json:"deferral_reason" nullable:"true"` DeliveredAt *Timestamp `json:"delivered_at" nullable:"true"` // HookID Opaque identity. Never infer a resource type or route from its contents. HookID ID `json:"hook_id"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Payload struct { Data string `json:"data"` Encoding string `json:"encoding"` } `json:"payload"` // ReceivedAt UTC RFC 3339. ReceivedAt Timestamp `json:"received_at"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // DeliveryPage defines model for DeliveryPage. type DeliveryPage struct { Items []Delivery `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // DynamicJSON Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. type DynamicJSON = json.RawMessage // ETag Strong opaque validator for the complete canonical representation. type ETag = string // EmptyRequest defines model for EmptyRequest. type EmptyRequest = map[string]interface{} // EntryContentPage defines model for EntryContentPage. type EntryContentPage struct { // EntryID Opaque identity. Never infer a resource type or route from its contents. EntryID ID `json:"entry_id"` Next *PageToken `json:"next" nullable:"true"` Parts []ContentPart `json:"parts"` } // ExtensionDeletion defines model for ExtensionDeletion. type ExtensionDeletion struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Notification Notification `json:"notification"` } // ExtensionMetadata defines model for ExtensionMetadata. type ExtensionMetadata struct { Context bool `json:"context"` Plugins []ID `json:"plugins"` PythonModules []ID `json:"python_modules"` Tools []ID `json:"tools"` } // ExtensionSettings defines model for ExtensionSettings. type ExtensionSettings struct { Defaults map[string]bool `json:"defaults"` } // ExtensionSettingsChange defines model for ExtensionSettingsChange. type ExtensionSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource ExtensionSettingsResource `json:"resource"` } // ExtensionSettingsPatch defines model for ExtensionSettingsPatch. type ExtensionSettingsPatch struct { Defaults map[string]*bool `json:"defaults,omitempty"` } // ExtensionSettingsResource defines model for ExtensionSettingsResource. type ExtensionSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ExtensionSettings `json:"value"` } // FailureBatch Terminal failure, alone with no snapshot. It does not commit a replacement cursor. // // Examples: {"cursor":0,"events":[{"data":{"code":"history_unavailable","detail":"Durable history could not be loaded."},"type":"failure"}],"generation":"J6kYj6IGcXyP3eMIp-WL3A"} type FailureBatch struct { Cursor Counter `json:"cursor"` Events []FailureEvent `json:"events"` // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` } // FailureEvent defines model for FailureEvent. type FailureEvent struct { Data SafeReason `json:"data"` Type string `json:"type"` } // FileDiff defines model for FileDiff. type FileDiff struct { Added Counter `json:"added"` Diff string `json:"diff"` Kind string `json:"kind"` Path string `json:"path"` Removed Counter `json:"removed"` } // FileUnavailable defines model for FileUnavailable. type FileUnavailable struct { Kind string `json:"kind"` Path string `json:"path"` Reason string `json:"reason"` } // ForkSessionIntent defines model for ForkSessionIntent. type ForkSessionIntent struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` Kind string `json:"kind"` Name *string `json:"name" nullable:"true"` // SourceSessionID Opaque identity. Never infer a resource type or route from its contents. SourceSessionID ID `json:"source_session_id"` } // ForkSessionRequest defines model for ForkSessionRequest. type ForkSessionRequest struct { // CheckpointID Opaque identity. Never infer a resource type or route from its contents. CheckpointID ID `json:"checkpoint_id"` Kind string `json:"kind"` Name *string `json:"name,omitempty" nullable:"true"` // SourceSessionID Opaque identity. Never infer a resource type or route from its contents. SourceSessionID ID `json:"source_session_id"` } // FormField defines model for FormField. type FormField struct { Choices []struct { Label string `json:"label"` // Value Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Value DynamicJSON `json:"value"` } `json:"choices"` // Default Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Default DynamicJSON `json:"default"` // DefaultBinding Prefill from the selected row or installed session, before showing the form. DefaultBinding *struct { Pointer string `json:"pointer"` Source string `json:"source"` } `json:"default_binding,omitempty"` Description string `json:"description"` Label string `json:"label"` Maximum *float64 `json:"maximum" nullable:"true"` Minimum *float64 `json:"minimum" nullable:"true"` Name string `json:"name"` Required bool `json:"required"` Type string `json:"type"` } // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. type Generation = string // GitFacts defines model for GitFacts. type GitFacts struct { Added *Counter `json:"added" nullable:"true"` Branch *string `json:"branch" nullable:"true"` Changed *Counter `json:"changed" nullable:"true"` Dirty *bool `json:"dirty" nullable:"true"` Kind string `json:"kind"` Modified *Counter `json:"modified" nullable:"true"` Removed *Counter `json:"removed" nullable:"true"` Revision *string `json:"revision" nullable:"true"` // Root Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Root Workspace `json:"root"` TouchedAt *Timestamp `json:"touched_at" nullable:"true"` } // Glance defines model for Glance. type Glance struct { // Data Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Data *DynamicJSON `json:"data,omitempty"` // Extension Opaque identity. Never infer a resource type or route from its contents. Extension ID `json:"extension"` Rows []PageRow `json:"rows"` Title string `json:"title"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } // HTTPCommand defines model for HTTPCommand. type HTTPCommand struct { Arguments []FormField `json:"arguments"` CallerPermissions []string `json:"caller_permissions"` Delivery string `json:"delivery"` Description string `json:"description"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // Operation Operation must be declared in this contract, or the installed extension contract version. Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map keys name declared parameters; body map keys are JSON pointers into the request object. Missing optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with no remote schema retrieval. Operation ActionOperation `json:"operation"` SlashName string `json:"slash_name"` } // HistoryEntry defines model for HistoryEntry. type HistoryEntry struct { CheckpointID *ID `json:"checkpoint_id" nullable:"true"` Content []json.RawMessage `json:"content"` ContentComplete bool `json:"content_complete"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` InputID *ID `json:"input_id" nullable:"true"` Kind string `json:"kind"` Mail *HistoryMail `json:"mail,omitempty" nullable:"true"` Position Counter `json:"position"` // ThinkingDurationMs Observed thinking duration, when recorded. ThinkingDurationMs *Counter `json:"thinking_duration_ms,omitempty" nullable:"true"` Tool *struct { Name string `json:"name"` ProgressCallID *ID `json:"progress_call_id" nullable:"true"` // ToolCallID Opaque identity. Never infer a resource type or route from its contents. ToolCallID ID `json:"tool_call_id"` } `json:"tool" nullable:"true"` TurnID *ID `json:"turn_id" nullable:"true"` TurnType *string `json:"turn_type,omitempty"` } // HistoryMail defines model for HistoryMail. type HistoryMail struct { Kind string `json:"kind"` // MailID Opaque identity. Never infer a resource type or route from its contents. MailID ID `json:"mail_id"` SenderLabel string `json:"sender_label"` SenderSessionID *ID `json:"sender_session_id" nullable:"true"` } // HistoryPage Examples: {"high_water":0,"items":[],"newer":null,"older":null} type HistoryPage struct { HighWater Counter `json:"high_water"` Items []HistoryEntry `json:"items"` Newer *PageToken `json:"newer" nullable:"true"` Older *PageToken `json:"older" nullable:"true"` } // HistoryRead The requested view determines the item type. Empty pages are valid for either view. type HistoryRead = json.RawMessage // Hook defines model for Hook. type Hook struct { ConfigurationResource HookConfigurationResource `json:"configuration_resource"` DeferralReason *SafeReason `json:"deferral_reason" nullable:"true"` DeliveryURL string `json:"delivery_url"` PendingCount Counter `json:"pending_count"` } // HookChange Secret appears only on creation and explicit rotation, including a generated secret. Never present on PATCH or reads. // // Examples: {"notification":{"code":null,"detail":null,"state":"not_requested"},"resource":{"etag":"\"hook-revision-1\"","url":"/extensions/webhooks/hooks/hook-1?view=configuration","value":{"enabled":true,"id":"hook-1","name":"ci","revision":"hook-revision-1","session_id":"01a0fcea-2b00-7000-8000-000000000001","signature_header":"X-Albedo-Signature","signature_prefix":"sha256="}},"secret":"synthetic-example-hook-secret"} type HookChange struct { Notification Notification `json:"notification"` Resource HookConfigurationResource `json:"resource"` Secret *string `json:"secret,omitempty"` } // HookConfiguration defines model for HookConfiguration. type HookConfiguration struct { Enabled bool `json:"enabled"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Name string `json:"name"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` SignatureHeader string `json:"signature_header"` SignaturePrefix string `json:"signature_prefix"` } // HookConfigurationResource defines model for HookConfigurationResource. type HookConfigurationResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value HookConfiguration `json:"value"` } // HookCreate Examples: {"name":"ci","session_id":"01a0fcea-2b00-7000-8000-000000000001"} type HookCreate struct { Enabled *bool `json:"enabled,omitempty"` Name string `json:"name"` Secret *string `json:"secret,omitempty"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` SignatureHeader *string `json:"signature_header,omitempty"` SignaturePrefix *string `json:"signature_prefix,omitempty"` } // HookPage defines model for HookPage. type HookPage struct { Items []Hook `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // HookPatch defines model for HookPatch. type HookPatch struct { Enabled *bool `json:"enabled,omitempty"` Name *string `json:"name,omitempty"` SignatureHeader *string `json:"signature_header,omitempty"` SignaturePrefix *string `json:"signature_prefix,omitempty"` } // HookPermission defines model for HookPermission. type HookPermission struct { AgentManage bool `json:"agent_manage"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // HookPermissionChange defines model for HookPermissionChange. type HookPermissionChange struct { Notification Notification `json:"notification"` Resource HookPermissionResource `json:"resource"` } // HookPermissionPatch defines model for HookPermissionPatch. type HookPermissionPatch struct { AgentManage *bool `json:"agent_manage,omitempty"` } // HookPermissionResource defines model for HookPermissionResource. type HookPermissionResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value HookPermission `json:"value"` } // HookSecretRequest defines model for HookSecretRequest. type HookSecretRequest struct { Secret *string `json:"secret,omitempty"` } // Host defines model for Host. type Host struct { Architecture *string `json:"architecture" nullable:"true"` Authentication *struct { ControlPath *string `json:"control_path" nullable:"true"` Instructions string `json:"instructions"` SSHTarget string `json:"ssh_target"` } `json:"authentication" nullable:"true"` Detail *SafeReason `json:"detail" nullable:"true"` Home *Workspace `json:"home" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` Os *string `json:"os" nullable:"true"` State string `json:"state"` // Step Current probe progress. Null when connecting or when no probe is running. Step *string `json:"step,omitempty" nullable:"true"` // Target Opaque identity. Never infer a resource type or route from its contents. Target ID `json:"target"` } // HostPage defines model for HostPage. type HostPage struct { Items []Host `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ID Opaque identity. Never infer a resource type or route from its contents. type ID = string // ImageContent defines model for ImageContent. type ImageContent struct { Image ImageMetadata `json:"image"` Kind string `json:"kind"` } // ImageMetadata defines model for ImageMetadata. type ImageMetadata struct { Height int64 `json:"height"` MimeType string `json:"mime_type"` OriginalBytes Counter `json:"original_bytes"` // Reference Its url is the image resource, which serves the decoded bytes. Reference ContentReference `json:"reference"` Width int64 `json:"width"` } // ImageUpload Strict base64; decoded dimensions and provider constraints are validated before admission. type ImageUpload struct { Data string `json:"data"` MimeType string `json:"mime_type"` } // Input defines model for Input. type Input struct { AcceptanceOrder *Counter `json:"acceptance_order" nullable:"true"` AcceptedAt *Timestamp `json:"accepted_at" nullable:"true"` Admission string `json:"admission"` BlockingReason *SafeReason `json:"blocking_reason" nullable:"true"` ClientID *string `json:"client_id" nullable:"true"` Delivery *string `json:"delivery" nullable:"true"` HTTPStatus int64 `json:"http_status"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Problem *AdmissionProblem `json:"problem" nullable:"true"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` TranscriptPosition *Counter `json:"transcript_position" nullable:"true"` Turn *Turn `json:"turn" nullable:"true"` } // InputCancellation defines model for InputCancellation. type InputCancellation struct { // Input Examples: {"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null} Input Input `json:"input"` Result string `json:"result"` } // InputCommand defines model for InputCommand. type InputCommand struct { Arguments []FormField `json:"arguments"` CallerPermissions []string `json:"caller_permissions"` // CommandID Opaque identity. Never infer a resource type or route from its contents. CommandID ID `json:"command_id"` Delivery string `json:"delivery"` Description string `json:"description"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` SlashName string `json:"slash_name"` } // InputDecision defines model for InputDecision. type InputDecision struct { // Input Examples: {"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null} Input Input `json:"input"` Kind string `json:"kind"` } // InputRequest defines model for InputRequest. type InputRequest = json.RawMessage // InterruptRequest defines model for InterruptRequest. type InterruptRequest struct { RunID *ID `json:"run_id" nullable:"true"` ThroughInputOrder Counter `json:"through_input_order"` } // Interruption defines model for Interruption. type Interruption struct { CancelledInputIDs []ID `json:"cancelled_input_ids"` RunID *ID `json:"run_id" nullable:"true"` State string `json:"state"` Warnings Warnings `json:"warnings"` } // JJFacts defines model for JJFacts. type JJFacts struct { Bookmark *struct { Ahead Counter `json:"ahead"` Name string `json:"name"` } `json:"bookmark" nullable:"true"` ChangeID *string `json:"change_id" nullable:"true"` Changed *Counter `json:"changed" nullable:"true"` Conflicts *bool `json:"conflicts" nullable:"true"` Description *string `json:"description" nullable:"true"` Dirty *bool `json:"dirty" nullable:"true"` Kind string `json:"kind"` Revision *string `json:"revision" nullable:"true"` // Root Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Root Workspace `json:"root"` TouchedAt *Timestamp `json:"touched_at" nullable:"true"` } // JSONContent defines model for JSONContent. type JSONContent struct { Field string `json:"field"` Kind string `json:"kind"` // Value Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Value DynamicJSON `json:"value"` } // JobCollection Examples: {"items":[],"live_job_count":0,"page":{"actions":[],"empty_state":"no background jobs running","glance":null,"rows":[],"summary":"0 background jobs running","title":"jobs"}} type JobCollection struct { Items []KernelJob `json:"items"` LiveJobCount Counter `json:"live_job_count"` Page PageDescriptor `json:"page"` } // JobStop Examples: {"stopped":"job-1"} type JobStop struct { // Stopped Opaque identity. Never infer a resource type or route from its contents. Stopped ID `json:"stopped"` } // Kernel defines model for Kernel. type Kernel struct { Build *string `json:"build" nullable:"true"` InstanceID *ID `json:"instance_id" nullable:"true"` // LiveJobCount Observed owned jobs. Null while booting or when the kernel owner is lost. LiveJobCount *Counter `json:"live_job_count" nullable:"true"` // RunningJobs Up to 100 observed live jobs, ordered by ID. Null when the kernel owner is unavailable. The count may exceed this list. RunningJobs []KernelJob `json:"running_jobs" nullable:"true"` Stage *string `json:"stage" nullable:"true"` Stale bool `json:"stale"` StalenessReasons []SafeReason `json:"staleness_reasons"` State string `json:"state"` } // KernelJob defines model for KernelJob. type KernelJob struct { Command string `json:"command"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Pid *Counter `json:"pid" nullable:"true"` // StartedAt Wall-clock milliseconds since the epoch when the owner recorded the job. Zero when unknown, which clients treat as settled work. StartedAt Counter `json:"started_at"` } // KernelUpgradeResult defines model for KernelUpgradeResult. type KernelUpgradeResult struct { Failure *SafeReason `json:"failure" nullable:"true"` NewBuild *string `json:"new_build" nullable:"true"` NewKernelID *ID `json:"new_kernel_id" nullable:"true"` OldBuild *string `json:"old_build" nullable:"true"` OldKernelID *ID `json:"old_kernel_id" nullable:"true"` State string `json:"state"` StoppedJobs []struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Reason SafeReason `json:"reason"` } `json:"stopped_jobs"` Warnings Warnings `json:"warnings"` } // LinkChange defines model for LinkChange. type LinkChange struct { NotificationCount Counter `json:"notification_count"` Notifications []TargetNotification `json:"notifications"` Resource LinkConfigurationResource `json:"resource"` Truncated bool `json:"truncated"` } // LinkConfiguration defines model for LinkConfiguration. type LinkConfiguration struct { // GroupID Opaque identity. Never infer a resource type or route from its contents. GroupID ID `json:"group_id"` Members []Workspace `json:"members"` Next *PageToken `json:"next" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // LinkConfigurationResource defines model for LinkConfigurationResource. type LinkConfigurationResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value LinkConfiguration `json:"value"` } // LinkGroup defines model for LinkGroup. type LinkGroup struct { ConfigurationResource LinkConfigurationResource `json:"configuration_resource"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` Presence []struct { // Exists Observed directory presence. Null for an uninspected or unreachable location. Exists *bool `json:"exists" nullable:"true"` Host *Host `json:"host" nullable:"true"` SessionCount Counter `json:"session_count"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } `json:"presence"` } // LinkMerge defines model for LinkMerge. type LinkMerge struct { // OtherEtag Strong opaque validator for the complete canonical representation. OtherEtag ETag `json:"other_etag"` // OtherWorkspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. OtherWorkspace Workspace `json:"other_workspace"` } // Login Examples: {"accounts":[],"expires_at":"2026-10-02T14:15:00Z","failure":null,"id":"01a0fcea-2b00-7000-8000-000000000003","instructions":"Paste the callback URL if the browser cannot reach the daemon.","progress":"Waiting for authorization.","provider":"example-provider","state":"waiting","url":"https://provider.example/authorize?state=synthetic-state"} type Login struct { Accounts []Account `json:"accounts"` // ExpiresAt UTC RFC 3339. ExpiresAt Timestamp `json:"expires_at"` Failure *SafeReason `json:"failure" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Instructions *string `json:"instructions" nullable:"true"` Progress string `json:"progress"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` State string `json:"state"` URL *string `json:"url" nullable:"true"` } // LoginPatch defines model for LoginPatch. type LoginPatch struct { Response *string `json:"response,omitempty"` } // LoginProvider defines model for LoginProvider. type LoginProvider struct { Detail string `json:"detail"` Fields []FormField `json:"fields"` Flows []string `json:"flows"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Label string `json:"label"` } // LoginRequest Flow defaults to the provider preferred flow. Form names, types and required values are checked against that provider declaration. Values are write-only. type LoginRequest struct { Flow *string `json:"flow,omitempty"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` Values map[string]json.RawMessage `json:"values"` } // MCPDefinition defines model for MCPDefinition. type MCPDefinition struct { Arguments []string `json:"arguments"` BearerTokenEnvVar *string `json:"bearer_token_env_var" nullable:"true"` CallTimeoutMs int64 `json:"call_timeout_ms"` Command *string `json:"command" nullable:"true"` Cwd *Workspace `json:"cwd" nullable:"true"` DisabledTools []string `json:"disabled_tools"` Enabled bool `json:"enabled"` EnabledTools []string `json:"enabled_tools" nullable:"true"` Environment map[string]ValueSource `json:"environment"` Headers map[string]ValueSource `json:"headers"` SecretPresence SecretPresence `json:"secret_presence"` StartupTimeoutMs int64 `json:"startup_timeout_ms"` Transport string `json:"transport"` URL *string `json:"url" nullable:"true"` } // MCPDefinitionPatch Partial merge patch. Public and secret sources cannot overlap. HTTP and stdio fields are validated against transport on the complete candidate. Public environment/header entries accept null removal; a null whole map clears it. Switching credential sources removes the former source in the same patch. type MCPDefinitionPatch struct { Arguments []string `json:"arguments,omitempty"` BearerTokenEnvVar *string `json:"bearer_token_env_var,omitempty" nullable:"true"` CallTimeoutMs *int64 `json:"call_timeout_ms,omitempty"` Command *string `json:"command,omitempty" nullable:"true"` Cwd *Workspace `json:"cwd,omitempty" nullable:"true"` DisabledTools []string `json:"disabled_tools,omitempty"` Enabled *bool `json:"enabled,omitempty"` EnabledTools []string `json:"enabled_tools,omitempty" nullable:"true"` Environment *map[string]*ValueSource `json:"environment,omitempty" nullable:"true"` Headers *map[string]*ValueSource `json:"headers,omitempty" nullable:"true"` Secrets *MCPSecretsPatch `json:"secrets,omitempty"` StartupTimeoutMs *int64 `json:"startup_timeout_ms,omitempty"` Transport *string `json:"transport,omitempty"` URL *string `json:"url,omitempty" nullable:"true"` } // MCPSecretsPatch defines model for MCPSecretsPatch. type MCPSecretsPatch struct { BearerToken *string `json:"bearer_token,omitempty" nullable:"true"` Environment map[string]*string `json:"environment,omitempty"` Headers map[string]*string `json:"headers,omitempty"` } // MCPSettings defines model for MCPSettings. type MCPSettings struct { Definitions map[string]MCPDefinition `json:"definitions"` } // MCPSettingsChange defines model for MCPSettingsChange. type MCPSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource MCPSettingsResource `json:"resource"` } // MCPSettingsPatch Validate candidate connections before atomic commit unless explicitly disabled. // // Examples: {"definitions":{"example":{"enabled":true,"secrets":{"bearer_token":"synthetic-example-token"},"transport":"http","url":"https://tools.example/mcp"}},"validate_connection":true} type MCPSettingsPatch struct { Definitions map[string]*MCPDefinitionPatch `json:"definitions,omitempty"` ValidateConnection *bool `json:"validate_connection,omitempty"` } // MCPSettingsResource defines model for MCPSettingsResource. type MCPSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value MCPSettings `json:"value"` } // MailMetadata defines model for MailMetadata. type MailMetadata struct { Bytes Counter `json:"bytes"` Kind string `json:"kind"` // MailID Opaque identity. Never infer a resource type or route from its contents. MailID ID `json:"mail_id"` // ReceiverSessionID Opaque identity. Never infer a resource type or route from its contents. ReceiverSessionID ID `json:"receiver_session_id"` SenderLabel *string `json:"sender_label" nullable:"true"` SenderSessionID *ID `json:"sender_session_id" nullable:"true"` } // MessageInputRequest Examples: {"client_id":"draft-1","kind":"message","text":"Fix the parser."} type MessageInputRequest struct { ClientID *string `json:"client_id,omitempty"` // Images Attached in order; the text's numbered image markers say where each was attached. Images []ImageUpload `json:"images,omitempty"` Kind string `json:"kind"` // Pastes Pasted text the text marks by number; a long one is saved to a file the model reads. Pastes []string `json:"pastes,omitempty"` Text string `json:"text"` } // Model defines model for Model. type Model struct { CachePolicy struct { Source *string `json:"source" nullable:"true"` TTLSeconds *Counter `json:"ttl_seconds" nullable:"true"` } `json:"cache_policy"` // CapKey Opaque identity. Never infer a resource type or route from its contents. CapKey ID `json:"cap_key"` DefaultContextTokens *Counter `json:"default_context_tokens" nullable:"true"` EffectiveContextTokens *Counter `json:"effective_context_tokens" nullable:"true"` Efforts []struct { ID string `json:"id"` Label string `json:"label"` } `json:"efforts"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` ImageEdge *int64 `json:"image_edge" nullable:"true"` InputModalities []string `json:"input_modalities"` Label string `json:"label"` MaxContextTokens *Counter `json:"max_context_tokens" nullable:"true"` MaxOutputTokens *Counter `json:"max_output_tokens" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` Raised bool `json:"raised"` Source string `json:"source"` } // ModelPage defines model for ModelPage. type ModelPage struct { Items []Model `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ModelRead defines model for ModelRead. type ModelRead = json.RawMessage // ModelReloadOutcome defines model for ModelReloadOutcome. type ModelReloadOutcome struct { Failure *SafeReason `json:"failure" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` State string `json:"state"` } // ModelSettings defines model for ModelSettings. type ModelSettings struct { CacheTTLPriors []CachePrior `json:"cache_ttl_priors"` RaisedCaps map[string]bool `json:"raised_caps"` } // ModelSettingsChange defines model for ModelSettingsChange. type ModelSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource ModelSettingsResource `json:"resource"` } // ModelSettingsPatch Keys are cap_key values from model metadata. True raises to the advertised maximum; false uses the ordinary limit; null clears the choice. A missing choice defaults to false. Only raised_caps is writable. type ModelSettingsPatch struct { RaisedCaps map[string]*bool `json:"raised_caps,omitempty"` } // ModelSettingsResource defines model for ModelSettingsResource. type ModelSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ModelSettings `json:"value"` } // NewSessionIntent defines model for NewSessionIntent. type NewSessionIntent struct { Effort *string `json:"effort" nullable:"true"` Kind string `json:"kind"` Model *ID `json:"model" nullable:"true"` Name *string `json:"name" nullable:"true"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // NewSessionRequest Examples: {"kind":"new","workspace":"/workspace/project"} type NewSessionRequest struct { Effort *string `json:"effort,omitempty" nullable:"true"` Kind string `json:"kind"` Model *ID `json:"model,omitempty" nullable:"true"` Name *string `json:"name,omitempty" nullable:"true"` ProviderProfile *ID `json:"provider_profile,omitempty" nullable:"true"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // Notification defines model for Notification. type Notification struct { Code *string `json:"code" nullable:"true"` Detail *string `json:"detail" nullable:"true"` State string `json:"state"` } // PageAction defines model for PageAction. type PageAction struct { Confirmation *string `json:"confirmation" nullable:"true"` Fields []FormField `json:"fields"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` KeyboardHint *string `json:"keyboard_hint" nullable:"true"` Label string `json:"label"` // Operation Operation must be declared in this contract, or the installed extension contract version. Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map keys name declared parameters; body map keys are JSON pointers into the request object. Missing optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with no remote schema retrieval. Operation ActionOperation `json:"operation"` } // PageDescriptor defines model for PageDescriptor. type PageDescriptor struct { Actions []PageAction `json:"actions"` EmptyState string `json:"empty_state"` Glance *Glance `json:"glance" nullable:"true"` Rows []PageRow `json:"rows"` Summary string `json:"summary"` Title string `json:"title"` } // PageRow defines model for PageRow. type PageRow struct { Badge *string `json:"badge" nullable:"true"` Detail *string `json:"detail" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Resource *struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` // Value Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Value DynamicJSON `json:"value"` } `json:"resource" nullable:"true"` Text string `json:"text"` Tone string `json:"tone"` } // PageToken Opaque continuation, tied to the query and representation; never authority. type PageToken = string // Paperclip defines model for Paperclip. type Paperclip struct { // CreatedAt UTC RFC 3339. CreatedAt Timestamp `json:"created_at"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Message string `json:"message"` Reply string `json:"reply"` Resolution string `json:"resolution"` ResolvingSessionID *ID `json:"resolving_session_id" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` SessionID *ID `json:"session_id" nullable:"true"` Status string `json:"status"` Suggestion string `json:"suggestion"` Title string `json:"title"` Topic string `json:"topic"` // UpdatedAt UTC RFC 3339. UpdatedAt Timestamp `json:"updated_at"` Workspace *Workspace `json:"workspace" nullable:"true"` } // PaperclipChange defines model for PaperclipChange. type PaperclipChange struct { Notification Notification `json:"notification"` Resource PaperclipResource `json:"resource"` } // PaperclipCreate defines model for PaperclipCreate. type PaperclipCreate struct { Message string `json:"message"` SessionID *ID `json:"session_id,omitempty" nullable:"true"` Suggestion *string `json:"suggestion,omitempty"` Title *string `json:"title,omitempty"` Topic *string `json:"topic,omitempty"` Workspace *Workspace `json:"workspace,omitempty" nullable:"true"` } // PaperclipPage defines model for PaperclipPage. type PaperclipPage struct { Glance *Glance `json:"glance,omitempty"` Items []PaperclipResource `json:"items"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` } // PaperclipPatch Reply cannot accompany resolved or dismissed status. It acknowledges the item. type PaperclipPatch struct { Reply *string `json:"reply,omitempty"` Resolution *string `json:"resolution,omitempty"` Status *string `json:"status,omitempty"` } // PaperclipResource defines model for PaperclipResource. type PaperclipResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value Paperclip `json:"value"` } // PendingInput defines model for PendingInput. type PendingInput struct { AcceptanceOrder Counter `json:"acceptance_order"` // AcceptedAt UTC RFC 3339. AcceptedAt Timestamp `json:"accepted_at"` BlockingReason *SafeReason `json:"blocking_reason" nullable:"true"` Delivery string `json:"delivery"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Preview Preview `json:"preview"` } // PreferencePatch defines model for PreferencePatch. type PreferencePatch struct { Archived *bool `json:"archived,omitempty"` Pinned *bool `json:"pinned,omitempty"` } // Preview defines model for Preview. type Preview struct { Text string `json:"text"` TranscriptCount Counter `json:"transcript_count"` Truncated bool `json:"truncated"` } // Problem Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem struct { Code string `json:"code"` Decision json.RawMessage `json:"decision,omitempty"` Detail string `json:"detail"` Fields []struct { Detail string `json:"detail"` Pointer string `json:"pointer"` } `json:"fields,omitempty"` Status int64 `json:"status"` Title string `json:"title"` Type string `json:"type"` } // ProgressPreview defines model for ProgressPreview. type ProgressPreview struct { OffsetScalars Counter `json:"offset_scalars"` Text string `json:"text"` } // ProviderProfile defines model for ProviderProfile. type ProviderProfile struct { AccountID *ID `json:"account_id" nullable:"true"` Effort *string `json:"effort" nullable:"true"` Endpoint *string `json:"endpoint" nullable:"true"` // Extension Opaque identity. Never infer a resource type or route from its contents. Extension ID `json:"extension"` HasKey bool `json:"has_key"` ImageEdge *int64 `json:"image_edge" nullable:"true"` Location *string `json:"location" nullable:"true"` // Model Opaque identity. Never infer a resource type or route from its contents. Model ID `json:"model"` Project *string `json:"project" nullable:"true"` Protocol string `json:"protocol"` } // ProviderProfilePatch Partial existing profile; extension and model required when creating a new map entry. type ProviderProfilePatch struct { AccountID *ID `json:"account_id,omitempty" nullable:"true"` APIKey *string `json:"api_key,omitempty" nullable:"true"` Effort *string `json:"effort,omitempty" nullable:"true"` Endpoint *string `json:"endpoint,omitempty" nullable:"true"` // Extension Opaque identity. Never infer a resource type or route from its contents. Extension *ID `json:"extension,omitempty"` ImageEdge *int64 `json:"image_edge,omitempty" nullable:"true"` Location *string `json:"location,omitempty" nullable:"true"` // Model Opaque identity. Never infer a resource type or route from its contents. Model *ID `json:"model,omitempty"` Project *string `json:"project,omitempty" nullable:"true"` Protocol *string `json:"protocol,omitempty"` } // ProviderRequestRecord defines model for ProviderRequestRecord. type ProviderRequestRecord struct { AccountID *ID `json:"account_id" nullable:"true"` CacheCreationTokens TokenObservation `json:"cache_creation_tokens"` CacheMarks []struct { Index *Counter `json:"index" nullable:"true"` Through string `json:"through"` TTLSeconds Counter `json:"ttl_seconds"` } `json:"cache_marks"` CacheWrite1HTokens TokenObservation `json:"cache_write_1h_tokens"` CacheWrite5MTokens TokenObservation `json:"cache_write_5m_tokens"` CachedTokens TokenObservation `json:"cached_tokens"` CompletionTokens TokenObservation `json:"completion_tokens"` EndedAt *Timestamp `json:"ended_at" nullable:"true"` Failure *SafeReason `json:"failure" nullable:"true"` HeadHash string `json:"head_hash"` HTTPStatus *int64 `json:"http_status" nullable:"true"` InputCount Counter `json:"input_count"` Kind string `json:"kind"` // Model Opaque identity. Never infer a resource type or route from its contents. Model ID `json:"model"` Outcome string `json:"outcome"` ProjectionHash *string `json:"projection_hash" nullable:"true"` PromptTokens TokenObservation `json:"prompt_tokens"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` // ProviderProfile Opaque identity. Never infer a resource type or route from its contents. ProviderProfile ID `json:"provider_profile"` ReasoningTokens TokenObservation `json:"reasoning_tokens"` ReplacedInputCount *Counter `json:"replaced_input_count" nullable:"true"` RunID *ID `json:"run_id" nullable:"true"` Sequence Counter `json:"sequence"` // StartedAt UTC RFC 3339. StartedAt Timestamp `json:"started_at"` Strategy *string `json:"strategy" nullable:"true"` TranscriptPositions []Counter `json:"transcript_positions"` } // ProviderSettings defines model for ProviderSettings. type ProviderSettings struct { DefaultProfile *ID `json:"default_profile" nullable:"true"` Profiles map[string]ProviderProfile `json:"profiles"` } // ProviderSettingsChange defines model for ProviderSettingsChange. type ProviderSettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource ProviderSettingsResource `json:"resource"` } // ProviderSettingsPatch Removing the selected profile requires replacing or clearing default_profile in this same patch. // // Examples: {"default_profile":"personal","profiles":{"personal":{"account_id":null,"api_key":"synthetic-example-key","effort":null,"endpoint":"https://provider.example/v1","extension":"openai","image_edge":null,"location":null,"model":"example-model","project":null,"protocol":"responses"}}} type ProviderSettingsPatch struct { DefaultProfile *ID `json:"default_profile,omitempty" nullable:"true"` Profiles map[string]*ProviderProfilePatch `json:"profiles,omitempty"` } // ProviderSettingsResource defines model for ProviderSettingsResource. type ProviderSettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ProviderSettings `json:"value"` } // ProxyChunk defines model for ProxyChunk. type ProxyChunk struct { Choices []struct { Delta struct { Content *string `json:"content,omitempty"` ReasoningContent *string `json:"reasoning_content,omitempty"` Role *string `json:"role,omitempty"` ToolCalls []ProxyToolDelta `json:"tool_calls,omitempty"` } `json:"delta"` FinishReason *string `json:"finish_reason" nullable:"true"` Index Counter `json:"index"` } `json:"choices"` Created Counter `json:"created"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Model string `json:"model"` Object string `json:"object"` Usage *ProxyUsage `json:"usage,omitempty" nullable:"true"` } // ProxyCompletion Examples: {"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Hello","role":"assistant"}}],"created":1790949600,"id":"completion-1","model":"personal/example-model","object":"chat.completion","usage":{"completion_tokens":1,"prompt_tokens":1,"total_tokens":2}} type ProxyCompletion struct { Choices []struct { FinishReason string `json:"finish_reason"` Index Counter `json:"index"` Message struct { Content *string `json:"content" nullable:"true"` ReasoningContent *string `json:"reasoning_content,omitempty" nullable:"true"` Role string `json:"role"` ToolCalls []ProxyToolCall `json:"tool_calls,omitempty"` } `json:"message"` } `json:"choices"` Created Counter `json:"created"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Model string `json:"model"` Object string `json:"object"` Usage *ProxyUsage `json:"usage" nullable:"true"` } // ProxyCompletionRequest Examples: {"messages":[{"content":"Hello","role":"user"}],"model":"personal/example-model","stream":true} type ProxyCompletionRequest struct { MaxCompletionTokens *int64 `json:"max_completion_tokens,omitempty"` MaxTokens *int64 `json:"max_tokens,omitempty"` Messages []ProxyMessage `json:"messages"` Model string `json:"model"` ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"` Reasoning *struct { Effort string `json:"effort"` } `json:"reasoning,omitempty"` ReasoningEffort *string `json:"reasoning_effort,omitempty"` ResponseFormat json.RawMessage `json:"response_format,omitempty"` Stop json.RawMessage `json:"stop,omitempty"` Stream *bool `json:"stream,omitempty"` StreamOptions *struct { IncludeUsage *bool `json:"include_usage,omitempty"` } `json:"stream_options,omitempty"` Temperature *float64 `json:"temperature,omitempty"` ToolChoice json.RawMessage `json:"tool_choice,omitempty"` Tools []ProxyToolDefinition `json:"tools,omitempty"` TopP *float64 `json:"top_p,omitempty"` } // ProxyError defines model for ProxyError. type ProxyError struct { Error struct { Code *string `json:"code" nullable:"true"` Message string `json:"message"` Param *string `json:"param" nullable:"true"` Type string `json:"type"` } `json:"error"` } // ProxyImagePart defines model for ProxyImagePart. type ProxyImagePart struct { ImageURL struct { Detail *string `json:"detail,omitempty"` URL string `json:"url"` } `json:"image_url"` Type string `json:"type"` } // ProxyMessage Tool messages require tool_call_id. Only assistant messages carry tool_calls. Images are accepted only as user data URLs. type ProxyMessage struct { Content json.RawMessage `json:"content,omitempty" nullable:"true"` Name *string `json:"name,omitempty"` ReasoningContent *string `json:"reasoning_content,omitempty" nullable:"true"` Role string `json:"role"` ToolCallID *string `json:"tool_call_id,omitempty"` ToolCalls []ProxyToolCall `json:"tool_calls,omitempty"` } // ProxyModels defines model for ProxyModels. type ProxyModels struct { Data []struct { Created Counter `json:"created"` ID string `json:"id"` Object string `json:"object"` OwnedBy string `json:"owned_by"` } `json:"data"` Errors []struct { Message string `json:"message"` // Profile Opaque identity. Never infer a resource type or route from its contents. Profile ID `json:"profile"` } `json:"errors,omitempty"` Object string `json:"object"` } // ProxySSE Data is a JSON chunk or error, followed by literal [DONE]. Validate decoded JSON explicitly. type ProxySSE struct { Data json.RawMessage `json:"data"` } // ProxyTextPart defines model for ProxyTextPart. type ProxyTextPart struct { Text string `json:"text"` Type string `json:"type"` } // ProxyToolCall defines model for ProxyToolCall. type ProxyToolCall struct { Function struct { Arguments string `json:"arguments"` Name string `json:"name"` } `json:"function"` ID string `json:"id"` Type string `json:"type"` } // ProxyToolDefinition defines model for ProxyToolDefinition. type ProxyToolDefinition struct { Function struct { Description *string `json:"description,omitempty"` Name string `json:"name"` // Parameters Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Parameters *DynamicJSON `json:"parameters,omitempty"` Strict *bool `json:"strict,omitempty"` } `json:"function"` Type string `json:"type"` } // ProxyToolDelta defines model for ProxyToolDelta. type ProxyToolDelta struct { Function *struct { Arguments string `json:"arguments"` Name string `json:"name"` } `json:"function,omitempty"` ID *string `json:"id,omitempty"` Index Counter `json:"index"` Type *string `json:"type,omitempty"` } // ProxyUsage defines model for ProxyUsage. type ProxyUsage struct { CompletionTokens Counter `json:"completion_tokens"` CompletionTokensDetails *struct { ReasoningTokens Counter `json:"reasoning_tokens"` } `json:"completion_tokens_details,omitempty"` PromptTokens Counter `json:"prompt_tokens"` PromptTokensDetails *struct { CachedTokens Counter `json:"cached_tokens"` } `json:"prompt_tokens_details,omitempty"` TotalTokens Counter `json:"total_tokens"` } // QuarantineDiagnostic defines model for QuarantineDiagnostic. type QuarantineDiagnostic struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Reason SafeReason `json:"reason"` } // QuotaObservation defines model for QuotaObservation. type QuotaObservation struct { // AccountID Opaque identity. Never infer a resource type or route from its contents. AccountID ID `json:"account_id"` Error *SafeReason `json:"error" nullable:"true"` Label string `json:"label"` LimitID string `json:"limit_id"` // ObservedAt UTC RFC 3339. ObservedAt Timestamp `json:"observed_at"` Plan *string `json:"plan" nullable:"true"` // Provider Opaque identity. Never infer a resource type or route from its contents. Provider ID `json:"provider"` ResetsAt *Timestamp `json:"resets_at" nullable:"true"` Scope *string `json:"scope" nullable:"true"` Sequence Counter `json:"sequence"` Source string `json:"source"` Status string `json:"status"` UsedPercent *float64 `json:"used_percent" nullable:"true"` WindowLabel *string `json:"window_label" nullable:"true"` WindowSeconds *Counter `json:"window_seconds" nullable:"true"` } // QuotaPage defines model for QuotaPage. type QuotaPage struct { Items []QuotaObservation `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // RecentWorkspace defines model for RecentWorkspace. type RecentWorkspace struct { ActivityAt *Timestamp `json:"activity_at" nullable:"true"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` UseCount Counter `json:"use_count"` } // RecentWorkspacePage defines model for RecentWorkspacePage. type RecentWorkspacePage struct { Items []RecentWorkspace `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ReferenceContent defines model for ReferenceContent. type ReferenceContent struct { Kind string `json:"kind"` Reference ContentReference `json:"reference"` } // ReloadRequest defines model for ReloadRequest. type ReloadRequest struct { Target *string `json:"target,omitempty"` } // ReloadResult defines model for ReloadResult. type ReloadResult struct { CachePolicy *CachePolicyReloadOutcome `json:"cache_policy" nullable:"true"` Models []ModelReloadOutcome `json:"models"` Session *SessionReloadOutcome `json:"session" nullable:"true"` } // ReplayBatch Empty keepalive keeps the last sequence. Nonempty event sequences are contiguous from the requested cursor. // // Examples: {"cursor":1,"events":[{"data":{"input":{"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null}},"sequence":1,"type":"input"}],"generation":"J6kYj6IGcXyP3eMIp-WL3A"} type ReplayBatch struct { Cursor Counter `json:"cursor"` Events []SessionEvent `json:"events"` // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` } // RequestRecordPage defines model for RequestRecordPage. type RequestRecordPage struct { Items []ProviderRequestRecord `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // ResetBatch Leading reset and complete snapshot. Later events, if any, follow the snapshot cursor. Envelope cursor advances through every delivered event. // // Examples: {"cursor":0,"events":[{"data":{"reason":"initial"},"type":"reset"}],"generation":"J6kYj6IGcXyP3eMIp-WL3A","snapshot":{"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"composition":{"availability":{},"dependencies":{},"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"quarantine":[]},"configuration_resource":{"etag":"\"session-config-1\"","url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","value":{"effort":null,"family_revision":"family-1","id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":"New session","preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"}},"created_at":"2026-10-02T14:00:00Z","creation":{"resolved":{"effort":null,"model":"example-model","provider_profile":"personal","workspace":"/workspace/project"},"submitted":{"effort":null,"kind":"new","model":null,"name":null,"provider_profile":null,"workspace":"/workspace/project"}},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"family_revision":"family-1","glances":[],"history":{"high_water":0,"items":[],"newer":null,"older":null},"id":"01a0fcea-2b00-7000-8000-000000000001","input_order":0,"kernel":{"build":null,"instance_id":null,"live_job_count":0,"running_jobs":[],"stage":null,"stale":false,"staleness_reasons":[],"state":"none"},"location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"pending_inputs":[],"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","revision":"config-1","root_id":"01a0fcea-2b00-7000-8000-000000000001","selection":{"effective":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"overrides":{"extensions":{},"instructions":{},"mcp":{},"skills":{}}},"status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"usage":{"cache_fade":[],"cache_ttl_seconds":null,"cache_write_tokens":null,"cached_prompt_tokens":null,"completion_tokens":null,"context_window_tokens":null,"elapsed_ms":null,"model":null,"observed_at":null,"prompt_tokens":null,"tokens_per_second":null,"total_tokens":null},"workspace":"/workspace/project","workspace_change":null}} type ResetBatch struct { Cursor Counter `json:"cursor"` Events []SessionEvent `json:"events"` // Generation 128 random bits encoded as unpadded base64url; new for each session actor lifetime. Generation Generation `json:"generation"` // Snapshot Examples: {"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"composition":{"availability":{},"dependencies":{},"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"quarantine":[]},"configuration_resource":{"etag":"\"session-config-1\"","url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","value":{"effort":null,"family_revision":"family-1","id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":"New session","preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"}},"created_at":"2026-10-02T14:00:00Z","creation":{"resolved":{"effort":null,"model":"example-model","provider_profile":"personal","workspace":"/workspace/project"},"submitted":{"effort":null,"kind":"new","model":null,"name":null,"provider_profile":null,"workspace":"/workspace/project"}},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"family_revision":"family-1","glances":[],"history":{"high_water":0,"items":[],"newer":null,"older":null},"id":"01a0fcea-2b00-7000-8000-000000000001","input_order":0,"kernel":{"build":null,"instance_id":null,"live_job_count":0,"running_jobs":[],"stage":null,"stale":false,"staleness_reasons":[],"state":"none"},"location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"pending_inputs":[],"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","revision":"config-1","root_id":"01a0fcea-2b00-7000-8000-000000000001","selection":{"effective":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"overrides":{"extensions":{},"instructions":{},"mcp":{},"skills":{}}},"status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"usage":{"cache_fade":[],"cache_ttl_seconds":null,"cache_write_tokens":null,"cached_prompt_tokens":null,"completion_tokens":null,"context_window_tokens":null,"elapsed_ms":null,"model":null,"observed_at":null,"prompt_tokens":null,"tokens_per_second":null,"total_tokens":null},"workspace":"/workspace/project","workspace_change":null} Snapshot Session `json:"snapshot"` } // ResetEvent defines model for ResetEvent. type ResetEvent struct { Data struct { Reason string `json:"reason"` } `json:"data"` Type string `json:"type"` } // ResourceURL Daemon-relative URL, including any representation query. No foreign origin or fragment. type ResourceURL = string // ResourceValidator defines model for ResourceValidator. type ResourceValidator struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } // SafeReason defines model for SafeReason. type SafeReason struct { Code string `json:"code"` Detail string `json:"detail"` } // ScheduleChange defines model for ScheduleChange. type ScheduleChange struct { Notification Notification `json:"notification"` Resource ScheduleResource `json:"resource"` } // ScheduleCreate defines model for ScheduleCreate. type ScheduleCreate struct { DelaySeconds *int64 `json:"delay_seconds,omitempty"` EverySeconds *int64 `json:"every_seconds,omitempty"` Kind string `json:"kind"` Prompt string `json:"prompt"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // ScheduleJob defines model for ScheduleJob. type ScheduleJob struct { // CreatedAt Null for historical schedules that did not record creation time. CreatedAt *Timestamp `json:"created_at" nullable:"true"` EverySeconds *int64 `json:"every_seconds" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` // NextAt UTC RFC 3339. NextAt Timestamp `json:"next_at"` Prompt string `json:"prompt"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` // UpdatedAt Null until a historical schedule records a new update. UpdatedAt *Timestamp `json:"updated_at" nullable:"true"` } // SchedulePage defines model for SchedulePage. type SchedulePage struct { Glance *Glance `json:"glance,omitempty"` Items []ScheduleResource `json:"items"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` } // SchedulePatch Validate complete candidate: once has null repetition; recurring and heartbeat require every_seconds. type SchedulePatch struct { DelaySeconds *int64 `json:"delay_seconds,omitempty"` EverySeconds *int64 `json:"every_seconds,omitempty" nullable:"true"` Kind *string `json:"kind,omitempty"` Prompt *string `json:"prompt,omitempty"` } // ScheduleResource defines model for ScheduleResource. type ScheduleResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value ScheduleJob `json:"value"` } // SecretPresence defines model for SecretPresence. type SecretPresence struct { BearerToken bool `json:"bearer_token"` Environment []string `json:"environment"` Headers []string `json:"headers"` } // SelectionOverrides defines model for SelectionOverrides. type SelectionOverrides struct { Extensions map[string]*bool `json:"extensions"` Instructions map[string]*bool `json:"instructions"` MCP map[string]*bool `json:"mcp"` Skills map[string]*bool `json:"skills"` } // SelectionPatch Null map entry clears that override. Null entire map clears all overrides of that kind. type SelectionPatch struct { Extensions *map[string]*bool `json:"extensions,omitempty" nullable:"true"` Instructions *map[string]*bool `json:"instructions,omitempty" nullable:"true"` MCP *map[string]*bool `json:"mcp,omitempty" nullable:"true"` Skills *map[string]*bool `json:"skills,omitempty" nullable:"true"` } // Server Examples: {"build":"example-build","capabilities":{"collection_invalidation":1,"durable_inputs":1,"session_replay":1,"storage_report":1,"tool_progress":1},"digest":null,"extensions":[{"name":"work","version":1}],"instance_id":"instance-1","notices":[],"protocol":3,"quota":null,"state":"ready"} type Server struct { Build *string `json:"build" nullable:"true"` Capabilities map[string]int64 `json:"capabilities"` // Digest Content digest of the running code tree; update information, not attachment compatibility. Digest *string `json:"digest" nullable:"true"` Extensions []struct { // Name Opaque identity. Never infer a resource type or route from its contents. Name ID `json:"name"` Version int64 `json:"version"` } `json:"extensions"` // InstanceID Opaque identity. Never infer a resource type or route from its contents. InstanceID ID `json:"instance_id"` Notices []struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Kind string `json:"kind"` Message string `json:"message"` } `json:"notices"` Protocol int64 `json:"protocol"` Quota []QuotaObservation `json:"quota" nullable:"true"` QuotaHistory *QuotaPage `json:"quota_history,omitempty"` State string `json:"state"` } // Session defines model for Session. type Session struct { ActiveOutput []ActiveOutput `json:"active_output"` Activity Activity `json:"activity"` ActivityAt *Timestamp `json:"activity_at" nullable:"true"` Address *string `json:"address" nullable:"true"` AutomaticName string `json:"automatic_name"` Closed bool `json:"closed"` Composition Composition `json:"composition"` ConfigurationResource SessionConfigurationResource `json:"configuration_resource"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` // Creation Null only for stored sessions that predate immutable creation provenance. All newly admitted creations have provenance. Creation *Creation `json:"creation" nullable:"true"` CurrentProgress []ToolProgress `json:"current_progress"` Cursor *Cursor `json:"cursor" nullable:"true"` Depth int64 `json:"depth"` Effort *string `json:"effort" nullable:"true"` // FamilyRevision Opaque identity. Never infer a resource type or route from its contents. FamilyRevision ID `json:"family_revision"` Glances []Glance `json:"glances"` // History Examples: {"high_water":0,"items":[],"newer":null,"older":null} History HistoryPage `json:"history"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` InputOrder Counter `json:"input_order"` Kernel Kernel `json:"kernel"` // Location Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. Location SessionLocation `json:"location"` Model *ID `json:"model" nullable:"true"` Name string `json:"name"` ParentID *ID `json:"parent_id" nullable:"true"` PendingInputs []PendingInput `json:"pending_inputs"` Preferences SessionPreferences `json:"preferences"` Preview Preview `json:"preview"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // RootID Opaque identity. Never infer a resource type or route from its contents. RootID ID `json:"root_id"` Selection SessionSelection `json:"selection"` Status SessionStatus `json:"status"` Usage Usage `json:"usage"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` WorkspaceChange *WorkspaceChange `json:"workspace_change" nullable:"true"` } // SessionBatch defines model for SessionBatch. type SessionBatch = json.RawMessage // SessionChange defines model for SessionChange. type SessionChange struct { Move *struct { AppliedCount Counter `json:"applied_count"` AppliedIDs []ID `json:"applied_ids"` DeferredCount Counter `json:"deferred_count"` DeferredIDs []ID `json:"deferred_ids"` Truncated bool `json:"truncated"` Warnings Warnings `json:"warnings"` } `json:"move" nullable:"true"` Resource SessionConfigurationResource `json:"resource"` // Session Examples: {"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"composition":{"availability":{},"dependencies":{},"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"quarantine":[]},"configuration_resource":{"etag":"\"session-config-1\"","url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","value":{"effort":null,"family_revision":"family-1","id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":"New session","preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"}},"created_at":"2026-10-02T14:00:00Z","creation":{"resolved":{"effort":null,"model":"example-model","provider_profile":"personal","workspace":"/workspace/project"},"submitted":{"effort":null,"kind":"new","model":null,"name":null,"provider_profile":null,"workspace":"/workspace/project"}},"current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"family_revision":"family-1","glances":[],"history":{"high_water":0,"items":[],"newer":null,"older":null},"id":"01a0fcea-2b00-7000-8000-000000000001","input_order":0,"kernel":{"build":null,"instance_id":null,"live_job_count":0,"running_jobs":[],"stage":null,"stale":false,"staleness_reasons":[],"state":"none"},"location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"pending_inputs":[],"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","revision":"config-1","root_id":"01a0fcea-2b00-7000-8000-000000000001","selection":{"effective":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"overrides":{"extensions":{},"instructions":{},"mcp":{},"skills":{}}},"status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"usage":{"cache_fade":[],"cache_ttl_seconds":null,"cache_write_tokens":null,"cached_prompt_tokens":null,"completion_tokens":null,"context_window_tokens":null,"elapsed_ms":null,"model":null,"observed_at":null,"prompt_tokens":null,"tokens_per_second":null,"total_tokens":null},"workspace":"/workspace/project","workspace_change":null} Session Session `json:"session"` } // SessionChangeRequest defines model for SessionChangeRequest. type SessionChangeRequest = json.RawMessage // SessionCommittedEvent defines model for SessionCommittedEvent. type SessionCommittedEvent struct { Data struct { HighWater Counter `json:"high_water"` // ReplacesAllLive Retire all provisional output for a model commit. ReplacesAllLive bool `json:"replaces_all_live"` ReplacesLiveIDs []ID `json:"replaces_live_ids"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionCompactedEvent defines model for SessionCompactedEvent. type SessionCompactedEvent struct { Data CompactionObservation `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionConfiguration Examples: {"effort":null,"family_revision":"family-1","id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":null,"preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"} type SessionConfiguration struct { Effort *string `json:"effort" nullable:"true"` // FamilyRevision Opaque identity. Never infer a resource type or route from its contents. FamilyRevision ID `json:"family_revision"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Model *ID `json:"model" nullable:"true"` // Name Explicit name. Null shows the automatic title for a root, or the family name for a child; the session representation carries the displayed name. Name *string `json:"name" nullable:"true"` Preferences struct { Archived bool `json:"archived"` PinOrder *Counter `json:"pin_order" nullable:"true"` Pinned bool `json:"pinned"` } `json:"preferences"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` Selection SelectionOverrides `json:"selection"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // SessionConfigurationResource defines model for SessionConfigurationResource. type SessionConfigurationResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` // Value Examples: {"effort":null,"family_revision":"family-1","id":"01a0fcea-2b00-7000-8000-000000000001","model":"example-model","name":null,"preferences":{"archived":false,"pin_order":null,"pinned":false},"provider_profile":"personal","revision":"config-1","selection":{"extensions":{},"instructions":{},"mcp":{},"skills":{}},"workspace":"/workspace/project"} Value SessionConfiguration `json:"value"` } // SessionCreationRequest defines model for SessionCreationRequest. type SessionCreationRequest = json.RawMessage // SessionDeletion Counts cover the complete captured operation. ID lists are bounded summaries, never false completion. Refresh the authoritative family or known tombstones if truncated; deletion is never repeated to page a result. type SessionDeletion struct { DeletedCount Counter `json:"deleted_count"` DeletedIDs []ID `json:"deleted_ids"` Remaining []struct { // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Reason SafeReason `json:"reason"` } `json:"remaining"` RemainingCount Counter `json:"remaining_count"` State string `json:"state"` Truncated bool `json:"truncated"` } // SessionErrorEvent defines model for SessionErrorEvent. type SessionErrorEvent struct { Data struct { Code string `json:"code"` Message string `json:"message"` RunID *ID `json:"run_id" nullable:"true"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionEvent defines model for SessionEvent. type SessionEvent = json.RawMessage // SessionInputEvent defines model for SessionInputEvent. type SessionInputEvent struct { Data struct { // Input Examples: {"acceptance_order":1,"accepted_at":"2026-10-02T14:00:00Z","admission":"accepted","blocking_reason":null,"client_id":"draft-1","delivery":"pending","http_status":202,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":null,"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null} Input Input `json:"input"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionInvalidateEvent defines model for SessionInvalidateEvent. type SessionInvalidateEvent struct { Data struct { Kind string `json:"kind"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionLocation Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. type SessionLocation struct { Host *string `json:"host" nullable:"true"` Label *string `json:"label" nullable:"true"` Path string `json:"path"` User *string `json:"user" nullable:"true"` } // SessionMessageEvent defines model for SessionMessageEvent. type SessionMessageEvent struct { Data struct { Entry HistoryEntry `json:"entry"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionNoteEvent defines model for SessionNoteEvent. type SessionNoteEvent struct { Data struct { // EntryID Opaque identity. Never infer a resource type or route from its contents. EntryID ID `json:"entry_id"` Mail *MailMetadata `json:"mail" nullable:"true"` Origin string `json:"origin"` Text string `json:"text"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionPage Examples: {"items":[{"active_output":[],"activity":{"latest_answer":null,"latest_input":null,"lines":[],"observed_at":"2026-10-02T14:00:00Z","output_scalars":0,"output_utf8_bytes":0},"activity_at":"2026-10-02T14:00:00Z","address":null,"automatic_name":"New session","closed":false,"created_at":"2026-10-02T14:00:00Z","current_progress":[],"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"depth":0,"effort":null,"id":"01a0fcea-2b00-7000-8000-000000000001","location":{"host":null,"label":null,"path":"/workspace/project","user":null},"model":"example-model","name":"New session","parent_id":null,"preferences":{"archived":false,"opens":0,"pin_order":null,"pinned":false},"preview":{"text":"","transcript_count":0,"truncated":false},"provider_profile":"personal","root_id":"01a0fcea-2b00-7000-8000-000000000001","status":{"blocking_reason":null,"interrupt_requested":false,"phase":"idle","run_id":null},"workspace":"/workspace/project"}],"next":null} type SessionPage struct { Family *struct { // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` // RootID Opaque identity. Never infer a resource type or route from its contents. RootID ID `json:"root_id"` } `json:"family,omitempty"` Items []SessionSummary `json:"items"` Next *PageToken `json:"next" nullable:"true"` } // SessionPatch Skill and instruction changes require catalog_revision. All fields validate and commit together. // // Examples: {"catalog_revision":"discovery-1","selection":{"extensions":{"browser":null},"skills":{"candidate-1":false}}} type SessionPatch struct { // CatalogRevision Opaque identity. Never infer a resource type or route from its contents. CatalogRevision *ID `json:"catalog_revision,omitempty"` Effort *string `json:"effort,omitempty" nullable:"true"` // Model Opaque identity. Never infer a resource type or route from its contents. Model *ID `json:"model,omitempty"` Name *string `json:"name,omitempty" nullable:"true"` Preferences *PreferencePatch `json:"preferences,omitempty"` // ProviderProfile Opaque identity. Never infer a resource type or route from its contents. ProviderProfile *ID `json:"provider_profile,omitempty"` // Selection Null map entry clears that override. Null entire map clears all overrides of that kind. Selection *SelectionPatch `json:"selection,omitempty"` } // SessionPreferences defines model for SessionPreferences. type SessionPreferences struct { Archived bool `json:"archived"` Opens Counter `json:"opens"` PinOrder *Counter `json:"pin_order" nullable:"true"` Pinned bool `json:"pinned"` } // SessionRead defines model for SessionRead. type SessionRead = json.RawMessage // SessionReloadOutcome defines model for SessionReloadOutcome. type SessionReloadOutcome struct { Failure *SafeReason `json:"failure" nullable:"true"` LoadedRevision *ID `json:"loaded_revision" nullable:"true"` RestartRequired bool `json:"restart_required"` State string `json:"state"` Warnings Warnings `json:"warnings"` } // SessionRetryEvent defines model for SessionRetryEvent. type SessionRetryEvent struct { Data struct { Attempt int64 `json:"attempt"` DelayMs Counter `json:"delay_ms"` Reason SafeReason `json:"reason"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionSSE One parsed SSE event. Decode data as JSON and validate SessionBatch separately; contentSchema is not asserted by ordinary JSON Schema validation. No event, id or retry fields are emitted. // // Examples: {"data":"{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"cursor\":0,\"events\":[{\"type\":\"reset\",\"data\":{\"reason\":\"initial\"}}],\"snapshot\":{\"id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"name\":\"New session\",\"automatic_name\":\"New session\",\"workspace\":\"/workspace/project\",\"location\":{\"host\":null,\"user\":null,\"path\":\"/workspace/project\",\"label\":null},\"parent_id\":null,\"root_id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"address\":null,\"depth\":0,\"closed\":false,\"created_at\":\"2026-10-02T14:00:00Z\",\"activity_at\":\"2026-10-02T14:00:00Z\",\"provider_profile\":\"personal\",\"model\":\"example-model\",\"effort\":null,\"status\":{\"phase\":\"idle\",\"run_id\":null,\"interrupt_requested\":false,\"blocking_reason\":null},\"preview\":{\"text\":\"\",\"transcript_count\":0,\"truncated\":false},\"preferences\":{\"pinned\":false,\"pin_order\":null,\"archived\":false,\"opens\":0},\"current_progress\":[],\"activity\":{\"lines\":[],\"output_scalars\":0,\"output_utf8_bytes\":0,\"observed_at\":\"2026-10-02T14:00:00Z\",\"latest_input\":null,\"latest_answer\":null},\"cursor\":{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"sequence\":0},\"creation\":{\"submitted\":{\"kind\":\"new\",\"workspace\":\"/workspace/project\",\"name\":null,\"provider_profile\":null,\"model\":null,\"effort\":null},\"resolved\":{\"workspace\":\"/workspace/project\",\"provider_profile\":\"personal\",\"model\":\"example-model\",\"effort\":null}},\"revision\":\"config-1\",\"family_revision\":\"family-1\",\"configuration_resource\":{\"url\":\"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration\",\"etag\":\"\\\"session-config-1\\\"\",\"value\":{\"id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"name\":\"New session\",\"workspace\":\"/workspace/project\",\"provider_profile\":\"personal\",\"model\":\"example-model\",\"effort\":null,\"preferences\":{\"pinned\":false,\"pin_order\":null,\"archived\":false},\"selection\":{\"extensions\":{},\"skills\":{},\"instructions\":{},\"mcp\":{}},\"revision\":\"config-1\",\"family_revision\":\"family-1\"}},\"workspace_change\":null,\"selection\":{\"overrides\":{\"extensions\":{},\"skills\":{},\"instructions\":{},\"mcp\":{}},\"effective\":{\"extensions\":{},\"skills\":{},\"instructions\":{},\"mcp\":{}}},\"composition\":{\"desired_revision\":\"composition-1\",\"loaded_revision\":null,\"needs_reload\":true,\"dependencies\":{},\"quarantine\":[],\"availability\":{}},\"kernel\":{\"instance_id\":null,\"state\":\"none\",\"stage\":null,\"build\":null,\"stale\":false,\"staleness_reasons\":[],\"live_job_count\":0,\"running_jobs\":[]},\"pending_inputs\":[],\"input_order\":0,\"usage\":{\"model\":null,\"observed_at\":null,\"prompt_tokens\":null,\"cached_prompt_tokens\":null,\"cache_write_tokens\":null,\"completion_tokens\":null,\"total_tokens\":null,\"elapsed_ms\":null,\"tokens_per_second\":null,\"context_window_tokens\":null,\"cache_ttl_seconds\":null,\"cache_fade\":[]},\"history\":{\"items\":[],\"older\":null,\"newer\":null,\"high_water\":0},\"glances\":[]}}"}, {"data":"{\"generation\":\"J6kYj6IGcXyP3eMIp-WL3A\",\"cursor\":1,\"events\":[{\"type\":\"input\",\"sequence\":1,\"data\":{\"input\":{\"id\":\"01a0fcea-2b00-7000-8000-000000000002\",\"session_id\":\"01a0fcea-2b00-7000-8000-000000000001\",\"kind\":\"message\",\"admission\":\"accepted\",\"http_status\":202,\"problem\":null,\"accepted_at\":\"2026-10-02T14:00:00Z\",\"acceptance_order\":1,\"delivery\":\"pending\",\"blocking_reason\":null,\"transcript_position\":null,\"turn\":null,\"client_id\":\"draft-1\"}}}]}"} type SessionSSE struct { Data string `json:"data"` } // SessionSelection defines model for SessionSelection. type SessionSelection struct { Effective struct { Extensions map[string]bool `json:"extensions"` Instructions map[string]bool `json:"instructions"` MCP map[string]bool `json:"mcp"` Skills map[string]bool `json:"skills"` } `json:"effective"` Overrides SelectionOverrides `json:"overrides"` } // SessionStatus defines model for SessionStatus. type SessionStatus struct { BlockingReason *SafeReason `json:"blocking_reason" nullable:"true"` InterruptRequested bool `json:"interrupt_requested"` Phase string `json:"phase"` RunID *ID `json:"run_id" nullable:"true"` } // SessionStatusEvent defines model for SessionStatusEvent. type SessionStatusEvent struct { Data SessionStatus `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionSummary Live fields and cursor are captured together. Extra response fields may be ignored. type SessionSummary struct { Activity Activity `json:"activity"` ActivityAt *Timestamp `json:"activity_at" nullable:"true"` Address *string `json:"address" nullable:"true"` AutomaticName string `json:"automatic_name"` Closed bool `json:"closed"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` CurrentProgress []ToolProgress `json:"current_progress"` Cursor *Cursor `json:"cursor" nullable:"true"` Depth int64 `json:"depth"` Effort *string `json:"effort" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` // Location Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. Location SessionLocation `json:"location"` Model *ID `json:"model" nullable:"true"` Name string `json:"name"` ParentID *ID `json:"parent_id" nullable:"true"` Preferences SessionPreferences `json:"preferences"` Preview Preview `json:"preview"` ProviderProfile *ID `json:"provider_profile" nullable:"true"` // RootID Opaque identity. Never infer a resource type or route from its contents. RootID ID `json:"root_id"` Status SessionStatus `json:"status"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // SessionTextEvent defines model for SessionTextEvent. type SessionTextEvent struct { Data struct { // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` Text string `json:"text"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionThinkingEvent defines model for SessionThinkingEvent. type SessionThinkingEvent struct { Data struct { // ElapsedMs Completed thinking duration, when observed. ElapsedMs *Counter `json:"elapsed_ms,omitempty"` // MessageID Opaque identity. Never infer a resource type or route from its contents. MessageID ID `json:"message_id"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` Text string `json:"text"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionToolEvent defines model for SessionToolEvent. type SessionToolEvent struct { Data struct { // Arguments Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Arguments DynamicJSON `json:"arguments"` ContentComplete bool `json:"content_complete"` Name string `json:"name"` // ProgressCallID Opaque identity. Never infer a resource type or route from its contents. ProgressCallID ID `json:"progress_call_id"` Reference *ContentReference `json:"reference" nullable:"true"` // Result Explicit domain payload: tool arguments, tool results, provider-private state, or extension data. JSON values of any type are allowed; no core resource uses this as its envelope. Result DynamicJSON `json:"result"` // ToolCallID Opaque identity. Never infer a resource type or route from its contents. ToolCallID ID `json:"tool_call_id"` Trace *ToolTrace `json:"trace" nullable:"true"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionToolProgressEvent defines model for SessionToolProgressEvent. type SessionToolProgressEvent struct { Data struct { Progress *ToolProgress `json:"progress" nullable:"true"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionTurnCompletedEvent defines model for SessionTurnCompletedEvent. type SessionTurnCompletedEvent struct { Data struct { InputCount Counter `json:"input_count"` InputIDs []ID `json:"input_ids"` // RunID Opaque identity. Never infer a resource type or route from its contents. RunID ID `json:"run_id"` State string `json:"state"` Truncated bool `json:"truncated"` } `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // SessionUsageEvent defines model for SessionUsageEvent. type SessionUsageEvent struct { Data Usage `json:"data"` Sequence Counter `json:"sequence"` Type string `json:"type"` } // Settings defines model for Settings. type Settings struct { Capabilities CapabilitySettings `json:"capabilities"` Extensions ExtensionSettings `json:"extensions"` GroupResources struct { Capabilities ResourceValidator `json:"capabilities"` Extensions ResourceValidator `json:"extensions"` MCP ResourceValidator `json:"mcp"` Models ResourceValidator `json:"models"` Providers ResourceValidator `json:"providers"` UI ResourceValidator `json:"ui"` } `json:"group_resources"` MCP MCPSettings `json:"mcp"` Models ModelSettings `json:"models"` Providers ProviderSettings `json:"providers"` UI UISettings `json:"ui"` } // SettingsApplication defines model for SettingsApplication. type SettingsApplication struct { ActiveServiceRevision *ID `json:"active_service_revision" nullable:"true"` // CompositionChanged Whether this save changed the desired composition, so loaded sessions need a reload to apply it. Always false for providers, models and ui. A concurrent save to another composition group can make it true. GET /sessions?needs_reload=true lists the sessions. CompositionChanged bool `json:"composition_changed"` // DesiredRevision Opaque identity. Never infer a resource type or route from its contents. DesiredRevision ID `json:"desired_revision"` Validation string `json:"validation"` Warnings Warnings `json:"warnings"` } // SettingsChange defines model for SettingsChange. type SettingsChange = json.RawMessage // SettingsPatch The group query selects the one applicable patch schema. It is an error to send fields for another group. type SettingsPatch = json.RawMessage // SettingsRead defines model for SettingsRead. type SettingsRead = json.RawMessage // Shutdown defines model for Shutdown. type Shutdown struct { // InstanceID Opaque identity. Never infer a resource type or route from its contents. InstanceID ID `json:"instance_id"` State string `json:"state"` } // ShutdownRequest defines model for ShutdownRequest. type ShutdownRequest struct { // InstanceID Opaque identity. Never infer a resource type or route from its contents. InstanceID ID `json:"instance_id"` TimeoutMs *int64 `json:"timeout_ms,omitempty"` } // SkillInputRequest defines model for SkillInputRequest. type SkillInputRequest struct { Arguments string `json:"arguments"` // CandidateID Opaque identity. Never infer a resource type or route from its contents. CandidateID ID `json:"candidate_id"` // CatalogRevision Opaque identity. Never infer a resource type or route from its contents. CatalogRevision ID `json:"catalog_revision"` ClientID *string `json:"client_id,omitempty"` Kind string `json:"kind"` } // StorageFile defines model for StorageFile. type StorageFile struct { Bytes Counter `json:"bytes"` Category string `json:"category"` CleanupCandidate bool `json:"cleanup_candidate"` CleanupReason *string `json:"cleanup_reason" nullable:"true"` ModifiedAt *Timestamp `json:"modified_at" nullable:"true"` Path string `json:"path"` } // StorageFilePage defines model for StorageFilePage. type StorageFilePage struct { Items []StorageFile `json:"items"` Next *PageToken `json:"next" nullable:"true"` Totals struct { BackupBytes Counter `json:"backup_bytes"` KernelBytes Counter `json:"kernel_bytes"` OtherBytes Counter `json:"other_bytes"` RecentBackupBytes Counter `json:"recent_backup_bytes"` RecentBackupCount Counter `json:"recent_backup_count"` } `json:"totals"` } // StorageReport Examples: {"database":{"free_page_count":0,"main_file_bytes":8192,"page_count":2,"page_size_bytes":4096,"used_bytes":8192,"wal_bytes":0},"files":{"items":[],"next":null,"totals":{"backup_bytes":0,"kernel_bytes":0,"other_bytes":0,"recent_backup_bytes":0,"recent_backup_count":0}},"images":{"bytes":0,"count":0},"measured_at":"2026-10-02T14:00:00Z","sessions":{"items":[],"next":null,"total_count":0,"total_estimated_content_bytes":0}} type StorageReport struct { Database struct { FreePageCount Counter `json:"free_page_count"` MainFileBytes Counter `json:"main_file_bytes"` PageCount Counter `json:"page_count"` PageSizeBytes Counter `json:"page_size_bytes"` UsedBytes Counter `json:"used_bytes"` WalBytes Counter `json:"wal_bytes"` } `json:"database"` Files StorageFilePage `json:"files"` Images struct { Bytes Counter `json:"bytes"` Count Counter `json:"count"` } `json:"images"` // MeasuredAt UTC RFC 3339. MeasuredAt Timestamp `json:"measured_at"` Sessions StorageSessionPage `json:"sessions"` } // StorageSession defines model for StorageSession. type StorageSession struct { ActivityAt *Timestamp `json:"activity_at" nullable:"true"` CreatedAt *Timestamp `json:"created_at" nullable:"true"` EstimatedContentBytes Counter `json:"estimated_content_bytes"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Title string `json:"title"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // StorageSessionPage defines model for StorageSessionPage. type StorageSessionPage struct { Items []StorageSession `json:"items"` Next *PageToken `json:"next" nullable:"true"` TotalCount Counter `json:"total_count"` TotalEstimatedContentBytes Counter `json:"total_estimated_content_bytes"` } // TargetNotification defines model for TargetNotification. type TargetNotification struct { Notification Notification `json:"notification"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` } // TextContent defines model for TextContent. type TextContent struct { Kind string `json:"kind"` Text string `json:"text"` } // Timestamp UTC RFC 3339. type Timestamp = string // TokenObservation defines model for TokenObservation. type TokenObservation struct { Estimated *Counter `json:"estimated" nullable:"true"` Observed *Counter `json:"observed" nullable:"true"` Source *string `json:"source" nullable:"true"` } // ToolActivity defines model for ToolActivity. type ToolActivity struct { // Detail What the person watching sees of the result, as markdown; a web search's answer and sources. Detail *string `json:"detail,omitempty"` Kind string `json:"kind"` Target string `json:"target"` } // ToolProgress Examples: {"call_id":"progress-1","intent":"unknown","name":"python","phase":"generating","preview":{"offset_scalars":0,"text":"print(\"hello\")"},"tool_call_id":null} type ToolProgress struct { // CallID Opaque identity. Never infer a resource type or route from its contents. CallID ID `json:"call_id"` Intent string `json:"intent"` Name string `json:"name"` Phase string `json:"phase"` Preview *ProgressPreview `json:"preview,omitempty"` ToolCallID *string `json:"tool_call_id" nullable:"true"` } // ToolTrace defines model for ToolTrace. type ToolTrace struct { Activities []ToolActivity `json:"activities"` Changes []json.RawMessage `json:"changes"` Truncated bool `json:"truncated"` } // TraceContent defines model for TraceContent. type TraceContent struct { Kind string `json:"kind"` Trace ToolTrace `json:"trace"` } // TreeChild defines model for TreeChild. type TreeChild struct { Changed Counter `json:"changed"` Kind string `json:"kind"` Language *string `json:"language" nullable:"true"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` Name string `json:"name"` } // TreeEntry defines model for TreeEntry. type TreeEntry struct { Changed Counter `json:"changed"` Children []TreeChild `json:"children"` Kind string `json:"kind"` Language *string `json:"language" nullable:"true"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` More Counter `json:"more"` Name string `json:"name"` } // Turn defines model for Turn. type Turn struct { EndedAt *Timestamp `json:"ended_at" nullable:"true"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Outcome *SafeReason `json:"outcome" nullable:"true"` // StartedAt UTC RFC 3339. StartedAt Timestamp `json:"started_at"` State string `json:"state"` } // UISettings defines model for UISettings. type UISettings struct { DismissedNotices []ID `json:"dismissed_notices"` Thinking bool `json:"thinking"` Tools bool `json:"tools"` } // UISettingsChange defines model for UISettingsChange. type UISettingsChange struct { Application SettingsApplication `json:"application"` Group string `json:"group"` Resource UISettingsResource `json:"resource"` } // UISettingsPatch defines model for UISettingsPatch. type UISettingsPatch struct { DismissedNotices []ID `json:"dismissed_notices,omitempty"` Thinking *bool `json:"thinking,omitempty"` Tools *bool `json:"tools,omitempty"` } // UISettingsResource defines model for UISettingsResource. type UISettingsResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value UISettings `json:"value"` } // UUIDv7 Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp expiry. type UUIDv7 = string // Usage defines model for Usage. type Usage struct { CacheFade []struct { // At UTC RFC 3339. At Timestamp `json:"at"` CachedTokens *Counter `json:"cached_tokens" nullable:"true"` } `json:"cache_fade"` CacheTTLSeconds *Counter `json:"cache_ttl_seconds" nullable:"true"` CacheWriteTokens *Counter `json:"cache_write_tokens" nullable:"true"` CachedPromptTokens *Counter `json:"cached_prompt_tokens" nullable:"true"` CompletionTokens *Counter `json:"completion_tokens" nullable:"true"` ContextWindowTokens *Counter `json:"context_window_tokens" nullable:"true"` ElapsedMs *float64 `json:"elapsed_ms" nullable:"true"` Model *ID `json:"model" nullable:"true"` ObservedAt *Timestamp `json:"observed_at" nullable:"true"` PromptTokens *Counter `json:"prompt_tokens" nullable:"true"` TokensPerSecond *float64 `json:"tokens_per_second" nullable:"true"` TotalTokens *Counter `json:"total_tokens" nullable:"true"` } // ValueSource For env, value is a daemon-host environment variable name. type ValueSource struct { Source string `json:"source"` Value string `json:"value"` } // Visit defines model for Visit. type Visit struct { Opens Counter `json:"opens"` // SessionID Opaque identity. Never infer a resource type or route from its contents. SessionID ID `json:"session_id"` // VisitID Opaque identity. Never infer a resource type or route from its contents. VisitID ID `json:"visit_id"` } // Warnings defines model for Warnings. type Warnings = []SafeReason // WebSearchProvider defines model for WebSearchProvider. type WebSearchProvider struct { Enabled bool `json:"enabled"` Label string `json:"label"` // Name Opaque identity. Never infer a resource type or route from its contents. Name ID `json:"name"` Position int64 `json:"position"` } // WebSearchProviderChange defines model for WebSearchProviderChange. type WebSearchProviderChange struct { Resource WebSearchProviderResource `json:"resource"` } // WebSearchProviderChangeRequest defines model for WebSearchProviderChangeRequest. type WebSearchProviderChangeRequest struct { Change string `json:"change"` } // WebSearchProviderPage defines model for WebSearchProviderPage. type WebSearchProviderPage struct { Items []WebSearchProviderResource `json:"items"` Next any `json:"next" nullable:"true"` Page PageDescriptor `json:"page"` } // WebSearchProviderResource defines model for WebSearchProviderResource. type WebSearchProviderResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value WebSearchProvider `json:"value"` } // WorkChange Examples: {"notification":{"code":null,"detail":null,"state":"not_requested"},"resource":{"etag":"\"work-revision-1\"","url":"/extensions/work/items/work-1?workspace=%2Fworkspace%2Fproject","value":{"created_at":"2026-10-02T14:00:00Z","id":"work-1","notes":"","parent_id":null,"revision":"work-revision-1","run_id":null,"session_id":null,"status":"open","title":"Fix the parser","updated_at":"2026-10-02T14:00:00Z","workspace":"/workspace/project"}}} type WorkChange struct { Notification Notification `json:"notification"` Resource WorkResource `json:"resource"` } // WorkCreate Examples: {"title":"Fix the parser"} type WorkCreate struct { Notes *string `json:"notes,omitempty"` // NotifySessionID Opaque identity. Never infer a resource type or route from its contents. NotifySessionID *ID `json:"notify_session_id,omitempty"` ParentID *ID `json:"parent_id,omitempty" nullable:"true"` RunID *ID `json:"run_id,omitempty" nullable:"true"` SessionID *ID `json:"session_id,omitempty" nullable:"true"` Title string `json:"title"` } // WorkItem defines model for WorkItem. type WorkItem struct { // CreatedAt UTC RFC 3339. CreatedAt Timestamp `json:"created_at"` // ID Opaque identity. Never infer a resource type or route from its contents. ID ID `json:"id"` Notes string `json:"notes"` ParentID *ID `json:"parent_id" nullable:"true"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` RunID *ID `json:"run_id" nullable:"true"` SessionID *ID `json:"session_id" nullable:"true"` Status string `json:"status"` Title string `json:"title"` // UpdatedAt UTC RFC 3339. UpdatedAt Timestamp `json:"updated_at"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // WorkPage defines model for WorkPage. type WorkPage struct { Glance *Glance `json:"glance,omitempty"` Items []WorkResource `json:"items"` Next *PageToken `json:"next" nullable:"true"` Page *PageDescriptor `json:"page,omitempty"` } // WorkPatch defines model for WorkPatch. type WorkPatch struct { Notes *string `json:"notes,omitempty"` // NotifySessionID Opaque identity. Never infer a resource type or route from its contents. NotifySessionID *ID `json:"notify_session_id,omitempty"` RunID *ID `json:"run_id,omitempty" nullable:"true"` SessionID *ID `json:"session_id,omitempty" nullable:"true"` Status *string `json:"status,omitempty"` Title *string `json:"title,omitempty"` } // WorkResource defines model for WorkResource. type WorkResource struct { // ETag Strong opaque validator for the complete canonical representation. ETag ETag `json:"etag"` // URL Daemon-relative URL, including any representation query. No foreign origin or fragment. URL ResourceURL `json:"url"` Value WorkItem `json:"value"` } // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. type Workspace = string // WorkspaceChange defines model for WorkspaceChange. type WorkspaceChange struct { // Active Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Active Workspace `json:"active"` // Desired Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Desired Workspace `json:"desired"` // Revision Opaque identity. Never infer a resource type or route from its contents. Revision ID `json:"revision"` State string `json:"state"` } // WorkspaceDirectory defines model for WorkspaceDirectory. type WorkspaceDirectory struct { // Directory Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Directory Workspace `json:"directory"` Home *Workspace `json:"home" nullable:"true"` Host *Host `json:"host" nullable:"true"` Items []struct { Hidden bool `json:"hidden"` // Location Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Location Workspace `json:"location"` ModifiedAt *Timestamp `json:"modified_at" nullable:"true"` Name string `json:"name"` Vcs *string `json:"vcs" nullable:"true"` } `json:"items"` Next *PageToken `json:"next" nullable:"true"` Parent *Workspace `json:"parent" nullable:"true"` Preview *WorkspacePreview `json:"preview,omitempty"` } // WorkspaceMoveRequest Examples: {"family_revision":"family-1","workspace":"/workspace/other-project"} type WorkspaceMoveRequest struct { // FamilyRevision Opaque identity. Never infer a resource type or route from its contents. FamilyRevision ID `json:"family_revision"` // Workspace Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. Workspace Workspace `json:"workspace"` } // WorkspacePreview defines model for WorkspacePreview. type WorkspacePreview struct { Languages []struct { Bytes Counter `json:"bytes"` Color *string `json:"color" nullable:"true"` Name string `json:"name"` Share float64 `json:"share"` } `json:"languages"` More Counter `json:"more"` Repository json.RawMessage `json:"repository" nullable:"true"` RepositoryDiagnostic *SafeReason `json:"repository_diagnostic" nullable:"true"` Tree []TreeEntry `json:"tree"` } // WorkspaceRead defines model for WorkspaceRead. type WorkspaceRead = json.RawMessage // IfMatch Strong opaque validator for the complete canonical representation. type IfMatch = ETag // IfNoneMatch defines model for IfNoneMatch. type IfNoneMatch = string // Limit defines model for Limit. type Limit = int64 // Next Opaque continuation, tied to the query and representation; never authority. type Next = PageToken // Problem400 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem400 = Problem // Problem401 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem401 = Problem // Problem403 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem403 = Problem // Problem404 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem404 = Problem // Problem405 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem405 = Problem // Problem406 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem406 = Problem // Problem409 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem409 = Problem // Problem410 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem410 = Problem // Problem412 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem412 = Problem // Problem413 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem413 = Problem // Problem415 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem415 = Problem // Problem428 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem428 = Problem // Problem429 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem429 = Problem // Problem503 Examples: {"code":"queue_full","decision":{"input":{"acceptance_order":null,"accepted_at":null,"admission":"rejected","blocking_reason":null,"client_id":"draft-1","delivery":null,"http_status":429,"id":"01a0fcea-2b00-7000-8000-000000000002","kind":"message","problem":{"code":"queue_full","detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"},"session_id":"01a0fcea-2b00-7000-8000-000000000001","transcript_position":null,"turn":null},"kind":"input"},"detail":"This session already has 32 waiting inputs.","status":429,"title":"Queue full","type":"about:blank"} type Problem503 = Problem // AnswerLoginParams defines parameters for AnswerLogin. type AnswerLoginParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // UnlinkWorkspaceParams defines parameters for UnlinkWorkspace. type UnlinkWorkspaceParams struct { Workspace Workspace `form:"workspace" json:"workspace"` Member Workspace `form:"member" json:"member"` View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetLinkGroupParams defines parameters for GetLinkGroup. type GetLinkGroupParams struct { Workspace Workspace `form:"workspace" json:"workspace"` View *string `form:"view,omitempty" json:"view,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // MergeLinkGroupsParams defines parameters for MergeLinkGroups. type MergeLinkGroupsParams struct { Workspace Workspace `form:"workspace" json:"workspace"` View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListPaperclipsParams defines parameters for ListPaperclips. type ListPaperclipsParams struct { Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeletePaperclipsParams defines parameters for DeletePaperclips. type DeletePaperclipsParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // PatchPaperclipsParams defines parameters for PatchPaperclips. type PatchPaperclipsParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // StopJobJSONBody defines parameters for StopJob. type StopJobJSONBody = map[string]interface{} // ListScheduleParams defines parameters for ListSchedule. type ListScheduleParams struct { SessionID ID `form:"session_id" json:"session_id"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeleteScheduleParams defines parameters for DeleteSchedule. type DeleteScheduleParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // PatchScheduleParams defines parameters for PatchSchedule. type PatchScheduleParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListHooksParams defines parameters for ListHooks. type ListHooksParams struct { SessionID *ID `form:"session_id,omitempty" json:"session_id,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeleteHookParams defines parameters for DeleteHook. type DeleteHookParams struct { View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetHookParams defines parameters for GetHook. type GetHookParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` } // PatchHookParams defines parameters for PatchHook. type PatchHookParams struct { View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListHookDeliveriesParams defines parameters for ListHookDeliveries. type ListHookDeliveriesParams struct { State *string `form:"state,omitempty" json:"state,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeliverWebhookParams defines parameters for DeliverWebhook. type DeliverWebhookParams struct { // XAlbedoEventID Optional sender identity scoped to hook and exact body hash. XAlbedoEventID *string `json:"X-Albedo-Event-Id,omitempty"` } // RotateHookSecretParams defines parameters for RotateHookSecret. type RotateHookSecretParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // PatchHookPermissionParams defines parameters for PatchHookPermission. type PatchHookPermissionParams struct { // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListWorkParams defines parameters for ListWork. type ListWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // CreateWorkParams defines parameters for CreateWork. type CreateWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` } // DeleteWorkParams defines parameters for DeleteWork. type DeleteWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` // NotifySessionID Queue the deletion note for this session after the durable edit. NotifySessionID *ID `form:"notify_session_id,omitempty" json:"notify_session_id,omitempty"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetWorkParams defines parameters for GetWork. type GetWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` } // PatchWorkParams defines parameters for PatchWork. type PatchWorkParams struct { Workspace Workspace `form:"workspace" json:"workspace"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // ListHostsParams defines parameters for ListHosts. type ListHostsParams struct { Target *ID `form:"target,omitempty" json:"target,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // ListModelsParams defines parameters for ListModels. type ListModelsParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` // Extension Cache-policy matching only; defaults to the empty selector. Extension *string `form:"extension,omitempty" json:"extension,omitempty"` // Host Cache-policy matching only; defaults to the empty selector. Host *string `form:"host,omitempty" json:"host,omitempty"` Model *ID `form:"model,omitempty" json:"model,omitempty"` ProviderProfile *ID `form:"provider_profile,omitempty" json:"provider_profile,omitempty"` Provider *ID `form:"provider,omitempty" json:"provider,omitempty"` Endpoint *string `form:"endpoint,omitempty" json:"endpoint,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetServerParams defines parameters for GetServer. type GetServerParams struct { Include *string `form:"include,omitempty" json:"include,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` // QuotaProvider Exact provider ID to filter quota history. Requires include=quota_history, quota_account, and quota_limit. QuotaProvider *string `form:"quota_provider,omitempty" json:"quota_provider,omitempty"` // QuotaAccount Exact account label to filter quota history. Requires include=quota_history, quota_provider, and quota_limit. QuotaAccount *string `form:"quota_account,omitempty" json:"quota_account,omitempty"` // QuotaLimit Exact limit ID to filter quota history. Requires include=quota_history, quota_provider, and quota_account. QuotaLimit *string `form:"quota_limit,omitempty" json:"quota_limit,omitempty"` // QuotaSince Filter quota history to observations at or after this RFC 3339 UTC timestamp. Requires include=quota_history and the limit filter trio. QuotaSince *Timestamp `form:"quota_since,omitempty" json:"quota_since,omitempty"` } // ListSessionsParams defines parameters for ListSessions. type ListSessionsParams struct { Scope *string `form:"scope,omitempty" json:"scope,omitempty"` ParentID *ID `form:"parent_id,omitempty" json:"parent_id,omitempty"` FamilyID *ID `form:"family_id,omitempty" json:"family_id,omitempty"` Workspace *Workspace `form:"workspace,omitempty" json:"workspace,omitempty"` Search *string `form:"search,omitempty" json:"search,omitempty"` Archived *bool `form:"archived,omitempty" json:"archived,omitempty"` NeedsReload *bool `form:"needs_reload,omitempty" json:"needs_reload,omitempty"` Sort *string `form:"sort,omitempty" json:"sort,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // DeleteSessionParams defines parameters for DeleteSession. type DeleteSessionParams struct { View string `form:"view" json:"view"` Scope *string `form:"scope,omitempty" json:"scope,omitempty"` FamilyRevision *ID `form:"family_revision,omitempty" json:"family_revision,omitempty"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetSessionParams defines parameters for GetSession. type GetSessionParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` Tail *int64 `form:"tail,omitempty" json:"tail,omitempty"` AfterGeneration *Generation `form:"after_generation,omitempty" json:"after_generation,omitempty"` AfterSeq *Counter `form:"after_seq,omitempty" json:"after_seq,omitempty"` } // PatchSessionParams defines parameters for PatchSession. type PatchSessionParams struct { View string `form:"view" json:"view"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // CreateSessionParams defines parameters for CreateSession. type CreateSessionParams struct { // IfNoneMatch Conditional creation only. IfNoneMatch IfNoneMatch `json:"If-None-Match"` } // GetActiveOutputContentParams defines parameters for GetActiveOutputContent. type GetActiveOutputContentParams struct { Snapshot PageToken `form:"snapshot" json:"snapshot"` Next *PageToken `form:"next,omitempty" json:"next,omitempty"` } // GetCatalogParams defines parameters for GetCatalog. type GetCatalogParams struct { Kind *string `form:"kind,omitempty" json:"kind,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetContextParams defines parameters for GetContext. type GetContextParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` SnapshotID *ID `form:"snapshot_id,omitempty" json:"snapshot_id,omitempty"` SectionID *ID `form:"section_id,omitempty" json:"section_id,omitempty"` Page *Counter `form:"page,omitempty" json:"page,omitempty"` After *Counter `form:"after,omitempty" json:"after,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetHistoryParams defines parameters for GetHistory. type GetHistoryParams struct { View *string `form:"view,omitempty" json:"view,omitempty"` Before *Counter `form:"before,omitempty" json:"before,omitempty"` After *Counter `form:"after,omitempty" json:"after,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` Limit *int64 `form:"limit,omitempty" json:"limit,omitempty"` } // GetHistoryContentParams defines parameters for GetHistoryContent. type GetHistoryContentParams struct { Next *Next `form:"next,omitempty" json:"next,omitempty"` } // GetSettingsParams defines parameters for GetSettings. type GetSettingsParams struct { Group *string `form:"group,omitempty" json:"group,omitempty"` } // PatchSettingsParams defines parameters for PatchSettings. type PatchSettingsParams struct { Group string `form:"group" json:"group"` // IfMatch Observed canonical representation validator. Wildcards and weak validators are not accepted. IfMatch IfMatch `json:"If-Match"` } // GetStorageParams defines parameters for GetStorage. type GetStorageParams struct { SessionsNext *PageToken `form:"sessions_next,omitempty" json:"sessions_next,omitempty"` FilesNext *PageToken `form:"files_next,omitempty" json:"files_next,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` } // GetWorkspacesParams defines parameters for GetWorkspaces. type GetWorkspacesParams struct { Location *Workspace `form:"location,omitempty" json:"location,omitempty"` Include *string `form:"include,omitempty" json:"include,omitempty"` Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` Next *Next `form:"next,omitempty" json:"next,omitempty"` } // AnswerLoginApplicationMergePatchPlusJSONRequestBody defines body for AnswerLogin for application/merge-patch+json ContentType. type AnswerLoginApplicationMergePatchPlusJSONRequestBody = LoginPatch // CreateLoginJSONRequestBody defines body for CreateLogin for application/json ContentType. type CreateLoginJSONRequestBody = LoginRequest // MergeLinkGroupsJSONRequestBody defines body for MergeLinkGroups for application/json ContentType. type MergeLinkGroupsJSONRequestBody = LinkMerge // CreatePaperclipsJSONRequestBody defines body for CreatePaperclips for application/json ContentType. type CreatePaperclipsJSONRequestBody = PaperclipCreate // PatchPaperclipsApplicationMergePatchPlusJSONRequestBody defines body for PatchPaperclips for application/merge-patch+json ContentType. type PatchPaperclipsApplicationMergePatchPlusJSONRequestBody = PaperclipPatch // CreateProxyCompletionJSONRequestBody defines body for CreateProxyCompletion for application/json ContentType. type CreateProxyCompletionJSONRequestBody = ProxyCompletionRequest // StopJobJSONRequestBody defines body for StopJob for application/json ContentType. type StopJobJSONRequestBody = StopJobJSONBody // CreateScheduleJSONRequestBody defines body for CreateSchedule for application/json ContentType. type CreateScheduleJSONRequestBody = ScheduleCreate // PatchScheduleApplicationMergePatchPlusJSONRequestBody defines body for PatchSchedule for application/merge-patch+json ContentType. type PatchScheduleApplicationMergePatchPlusJSONRequestBody = SchedulePatch // ChangeWebSearchProviderJSONRequestBody defines body for ChangeWebSearchProvider for application/json ContentType. type ChangeWebSearchProviderJSONRequestBody = WebSearchProviderChangeRequest // CreateHookJSONRequestBody defines body for CreateHook for application/json ContentType. type CreateHookJSONRequestBody = HookCreate // PatchHookApplicationMergePatchPlusJSONRequestBody defines body for PatchHook for application/merge-patch+json ContentType. type PatchHookApplicationMergePatchPlusJSONRequestBody = HookPatch // RotateHookSecretJSONRequestBody defines body for RotateHookSecret for application/json ContentType. type RotateHookSecretJSONRequestBody = HookSecretRequest // PatchHookPermissionApplicationMergePatchPlusJSONRequestBody defines body for PatchHookPermission for application/merge-patch+json ContentType. type PatchHookPermissionApplicationMergePatchPlusJSONRequestBody = HookPermissionPatch // CreateWorkJSONRequestBody defines body for CreateWork for application/json ContentType. type CreateWorkJSONRequestBody = WorkCreate // PatchWorkApplicationMergePatchPlusJSONRequestBody defines body for PatchWork for application/merge-patch+json ContentType. type PatchWorkApplicationMergePatchPlusJSONRequestBody = WorkPatch // ProbeHostJSONRequestBody defines body for ProbeHost for application/json ContentType. type ProbeHostJSONRequestBody = EmptyRequest // ShutdownServerJSONRequestBody defines body for ShutdownServer for application/json ContentType. type ShutdownServerJSONRequestBody = ShutdownRequest // PatchSessionApplicationMergePatchPlusJSONRequestBody defines body for PatchSession for application/merge-patch+json ContentType. type PatchSessionApplicationMergePatchPlusJSONRequestBody = SessionChangeRequest // CreateSessionJSONRequestBody defines body for CreateSession for application/json ContentType. type CreateSessionJSONRequestBody = SessionCreationRequest // CompactSessionJSONRequestBody defines body for CompactSession for application/json ContentType. type CompactSessionJSONRequestBody = CompactionRequest // PutInputJSONRequestBody defines body for PutInput for application/json ContentType. type PutInputJSONRequestBody = InputRequest // CancelInputJSONRequestBody defines body for CancelInput for application/json ContentType. type CancelInputJSONRequestBody = EmptyRequest // InterruptSessionJSONRequestBody defines body for InterruptSession for application/json ContentType. type InterruptSessionJSONRequestBody = InterruptRequest // UpgradeKernelJSONRequestBody defines body for UpgradeKernel for application/json ContentType. type UpgradeKernelJSONRequestBody = EmptyRequest // ReloadSessionJSONRequestBody defines body for ReloadSession for application/json ContentType. type ReloadSessionJSONRequestBody = ReloadRequest // RecordVisitJSONRequestBody defines body for RecordVisit for application/json ContentType. type RecordVisitJSONRequestBody = EmptyRequest // PatchSettingsApplicationMergePatchPlusJSONRequestBody defines body for PatchSettings for application/merge-patch+json ContentType. type PatchSettingsApplicationMergePatchPlusJSONRequestBody = SettingsPatch // RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. // // The standard http.Client implements this interface. type HttpRequestDoer interface { Do(req *http.Request) (*http.Response, error) } // Client which conforms to the OpenAPI3 specification for this service. type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn } // ClientOption allows setting custom parameters during construction type ClientOption func(*Client) error // Creates a new Client, with reasonable defaults func NewClient(server string, opts ...ClientOption) (*Client, error) { // create a client with sane default values client := Client{ Server: server, } // mutate client and add all optional params for _, o := range opts { if err := o(&client); err != nil { return nil, err } } // ensure the server URL always has a trailing slash if !strings.HasSuffix(client.Server, "/") { client.Server += "/" } // create httpClient, if not already present if client.Client == nil { client.Client = &http.Client{} } return &client, nil } // WithHTTPClient allows overriding the default Doer, which is // automatically created using http.Client. This is useful for tests. func WithHTTPClient(doer HttpRequestDoer) ClientOption { return func(c *Client) error { c.Client = doer return nil } } // WithRequestEditorFn allows setting up a callback function, which will be // called right before sending the request. This can be used to mutate the request. func WithRequestEditorFn(fn RequestEditorFn) ClientOption { return func(c *Client) error { c.RequestEditors = append(c.RequestEditors, fn) return nil } } // The interface specification for the client above. type ClientInterface interface { // GetAuth Read login choices and redacted accounts // // Requires capability `provider_auth: 1`. // // Corresponds with GET /auth (the `GetAuth` operationId). GetAuth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteAccount Remove an unreferenced provider account // // Reject if a saved provider profile references it. Does not interrupt captured credentials in an active request. Account IDs are never reused. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/accounts/{account_id} (the `DeleteAccount` operationId). DeleteAccount(ctx context.Context, accountID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // CancelLogin Cancel a login idempotently // // Cancellation stops only this flow; completed accounts remain saved. No If-Match is needed for identity-scoped cancellation. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/logins/{login_id} (the `CancelLogin` operationId). CancelLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // GetLogin Inspect a provider login // // No credential or submitted form echo. Terminal records remain fifteen minutes; unfinished flows expire at their provider deadline. Requires capability `provider_auth: 1`. // // Corresponds with GET /auth/logins/{login_id} (the `GetLogin` operationId). GetLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // AnswerLoginWithBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). AnswerLoginWithBody(ctx context.Context, loginID ID, params *AnswerLoginParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // AnswerLoginWithApplicationMergePatchPlusJSONBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). AnswerLoginWithApplicationMergePatchPlusJSONBody(ctx context.Context, loginID ID, params *AnswerLoginParams, body AnswerLoginApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateLoginWithBody Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). CreateLoginWithBody(ctx context.Context, loginID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateLogin Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). CreateLogin(ctx context.Context, loginID UUIDv7, body CreateLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // UnlinkWorkspace Remove a member from the observed group // // Check membership at commit. Creates a singleton group; deletes no work or memory. Human-only. // // Corresponds with DELETE /extensions/links/groups (the `UnlinkWorkspace` operationId). UnlinkWorkspace(ctx context.Context, params *UnlinkWorkspaceParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetLinkGroup Read linked membership and presence // // Only configuration view has the canonical membership ETag. Presence does not change that validator. // // Corresponds with GET /extensions/links/groups (the `GetLinkGroup` operationId). GetLinkGroup(ctx context.Context, params *GetLinkGroupParams, reqEditors ...RequestEditorFn) (*http.Response, error) // MergeLinkGroupsWithBody Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). MergeLinkGroupsWithBody(ctx context.Context, params *MergeLinkGroupsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // MergeLinkGroups Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). MergeLinkGroups(ctx context.Context, params *MergeLinkGroupsParams, body MergeLinkGroupsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListPaperclips List paperclips resources // // Requires enabled extension paperclips. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/paperclips/items (the `ListPaperclips` operationId). ListPaperclips(ctx context.Context, params *ListPaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePaperclipsWithBody Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). CreatePaperclipsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePaperclips Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). CreatePaperclips(ctx context.Context, body CreatePaperclipsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeletePaperclips Delete a paperclips resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/paperclips/items/{item_id} (the `DeletePaperclips` operationId). DeletePaperclips(ctx context.Context, itemID ID, params *DeletePaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetPaperclips Read one paperclips resource // // Corresponds with GET /extensions/paperclips/items/{item_id} (the `GetPaperclips` operationId). GetPaperclips(ctx context.Context, itemID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchPaperclipsWithBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). PatchPaperclipsWithBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchPaperclipsWithApplicationMergePatchPlusJSONBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). PatchPaperclipsWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, body PatchPaperclipsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateProxyCompletionWithBody Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). CreateProxyCompletionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateProxyCompletion Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). CreateProxyCompletion(ctx context.Context, body CreateProxyCompletionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListProxyModels List saved-profile OpenAI model IDs // // External OpenAI envelope. Bearer required unless operator explicitly configured anonymous loopback access. // // Corresponds with GET /extensions/proxy/v1/models (the `ListProxyModels` operationId). ListProxyModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ListJobs Read bounded live job observations and the jobs page // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs (the `ListJobs` operationId). ListJobs(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // StopJobWithBody Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). StopJobWithBody(ctx context.Context, sessionID ID, jobID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // StopJob Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). StopJob(ctx context.Context, sessionID ID, jobID ID, body StopJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSchedule List schedule resources // // Requires enabled extension schedule. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/schedule/jobs (the `ListSchedule` operationId). ListSchedule(ctx context.Context, params *ListScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateScheduleWithBody Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). CreateScheduleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSchedule Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). CreateSchedule(ctx context.Context, body CreateScheduleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSchedule Delete a schedule resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/schedule/jobs/{job_id} (the `DeleteSchedule` operationId). DeleteSchedule(ctx context.Context, jobID ID, params *DeleteScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSchedule Read one schedule resource // // Corresponds with GET /extensions/schedule/jobs/{job_id} (the `GetSchedule` operationId). GetSchedule(ctx context.Context, jobID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchScheduleWithBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). PatchScheduleWithBody(ctx context.Context, jobID ID, params *PatchScheduleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchScheduleWithApplicationMergePatchPlusJSONBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). PatchScheduleWithApplicationMergePatchPlusJSONBody(ctx context.Context, jobID ID, params *PatchScheduleParams, body PatchScheduleApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListWebSearchProviders List web search providers in the order a search tries them // // Requires enabled extension web-search. The global order lives in extensions.json. // // Corresponds with GET /extensions/web-search/providers (the `ListWebSearchProviders` operationId). ListWebSearchProviders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ChangeWebSearchProviderWithBody Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). ChangeWebSearchProviderWithBody(ctx context.Context, name ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ChangeWebSearchProvider Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). ChangeWebSearchProvider(ctx context.Context, name ID, body ChangeWebSearchProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDelivery Read an accepted delivery payload // // Corresponds with GET /extensions/webhooks/deliveries/{delivery_id} (the `GetDelivery` operationId). GetDelivery(ctx context.Context, deliveryID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // ListHooks List hooks without secrets // // Corresponds with GET /extensions/webhooks/hooks (the `ListHooks` operationId). ListHooks(ctx context.Context, params *ListHooksParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateHookWithBody Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). CreateHookWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateHook Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). CreateHook(ctx context.Context, body CreateHookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteHook Delete a hook while retaining accepted deliveries // // Corresponds with DELETE /extensions/webhooks/hooks/{hook_id} (the `DeleteHook` operationId). DeleteHook(ctx context.Context, hookID ID, params *DeleteHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHook Read hook state or canonical configuration // // ETag is present only on configuration view. Ordinary read exposes the configuration resource and validator plus runtime observations. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id} (the `GetHook` operationId). GetHook(ctx context.Context, hookID ID, params *GetHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookWithBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). PatchHookWithBody(ctx context.Context, hookID ID, params *PatchHookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookWithApplicationMergePatchPlusJSONBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). PatchHookWithApplicationMergePatchPlusJSONBody(ctx context.Context, hookID ID, params *PatchHookParams, body PatchHookApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListHookDeliveries Read accepted hook delivery metadata // // Historical reads remain available after hook deletion while retained deliveries exist. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id}/deliveries (the `ListHookDeliveries` operationId). ListHookDeliveries(ctx context.Context, hookID ID, params *ListHookDeliveriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeliverWebhookWithBody Accept signed external data durably // // Authenticate configured HMAC-SHA256 over the exact raw body. A daemon bearer is not a substitute. Signature header name and prefix come from hook configuration. Same event ID and body returns original admission; changed body conflicts. Pending inbox limit 1000. Raw body maximum 65536 bytes. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/deliveries (the `DeliverWebhook` operationId). DeliverWebhookWithBody(ctx context.Context, hookID ID, params *DeliverWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RotateHookSecretWithBody Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). RotateHookSecretWithBody(ctx context.Context, hookID ID, params *RotateHookSecretParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RotateHookSecret Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). RotateHookSecret(ctx context.Context, hookID ID, params *RotateHookSecretParams, body RotateHookSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHookPermission Read agent hook-management permission // // Absent stored permission reads false with its initial canonical validator. // // Corresponds with GET /extensions/webhooks/permissions/{session_id} (the `GetHookPermission` operationId). GetHookPermission(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookPermissionWithBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). PatchHookPermissionWithBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchHookPermissionWithApplicationMergePatchPlusJSONBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). PatchHookPermissionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, body PatchHookPermissionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListWork List work resources // // Requires enabled extension work. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/work/items (the `ListWork` operationId). ListWork(ctx context.Context, params *ListWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateWorkWithBody Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). CreateWorkWithBody(ctx context.Context, params *CreateWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateWork Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). CreateWork(ctx context.Context, params *CreateWorkParams, body CreateWorkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteWork Delete a work resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/work/items/{item_id} (the `DeleteWork` operationId). DeleteWork(ctx context.Context, itemID ID, params *DeleteWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetWork Read one work resource // // Corresponds with GET /extensions/work/items/{item_id} (the `GetWork` operationId). GetWork(ctx context.Context, itemID ID, params *GetWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchWorkWithBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). PatchWorkWithBody(ctx context.Context, itemID ID, params *PatchWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchWorkWithApplicationMergePatchPlusJSONBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). PatchWorkWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchWorkParams, body PatchWorkApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListHosts Read known SSH hosts and cached state // // Requires capability `host_probes: 1`. // // Corresponds with GET /hosts (the `ListHosts` operationId). ListHosts(ctx context.Context, params *ListHostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ProbeHostWithBody Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes any type of body and a specified content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). ProbeHostWithBody(ctx context.Context, host ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ProbeHost Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). ProbeHost(ctx context.Context, host ID, body ProbeHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListModels Read provider model metadata // // In catalogue view, exactly one of provider_profile/provider is required. Endpoint is allowed only with provider. Unknown facts are null. A manual unlisted ID remains usable. Optional model returns one metadata row, including cap_key, for an unlisted manual ID; unknown facts stay null. // // Corresponds with GET /models (the `ListModels` operationId). ListModels(ctx context.Context, params *ListModelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetServer Read daemon identity and capabilities // // No startup or replacement. Authentication and protocol failures remain actionable errors. Pagination is valid only with include=quota_history. // // Corresponds with GET /server (the `GetServer` operationId). GetServer(ctx context.Context, params *GetServerParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ShutdownServerWithBody Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes any type of body and a specified content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). ShutdownServerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ShutdownServer Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes a body of the `application/json` content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). ShutdownServer(ctx context.Context, body ShutdownServerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListSessions Browse sessions or watch collection changes // // JSON defaults to roots, or all with parent/family. Parent and family are exclusive. Explicit roots with either is invalid. SSE accepts the same scope filters, excluding sort/limit/next; no cursor or replay. Subscribe, wait for ready, then read pages. Closure or overflow repeats this flow. // // Corresponds with GET /sessions (the `ListSessions` operationId). ListSessions(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteSession Delete a leaf or captured subtree // // Leaf requires idle and no children. Subtree requires family_revision, gates new children, interrupts captured members and deletes deepest first. Partial outcomes are explicit. Refresh before confirming a new attempt; never automatically replay after transport loss. // // Corresponds with DELETE /sessions/{session_id} (the `DeleteSession` operationId). DeleteSession(ctx context.Context, sessionID ID, params *DeleteSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSession Read or watch one session // // JSON defaults to complete Session. Configuration JSON excludes tail and replay parameters. SSE accepts tail and after_generation/after_seq, without view. Initial subscription omits both cursors; reconnect keeps the fully consumed pair. A missing generation requests reset. after_generation without after_seq is invalid. Neither auth failure nor closure starts a daemon. // // Corresponds with GET /sessions/{session_id} (the `GetSession` operationId). GetSession(ctx context.Context, sessionID ID, params *GetSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSessionWithBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change with family_revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). PatchSessionWithBody(ctx context.Context, sessionID ID, params *PatchSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSessionWithApplicationMergePatchPlusJSONBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change with family_revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). PatchSessionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchSessionParams, body PatchSessionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSessionWithBody Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). CreateSessionWithBody(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateSession Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). CreateSession(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, body CreateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetActiveOutputContent Read unfinished output at a captured snapshot cutoff // // Pages contain at most 262144 UTF-8 bytes and remain within the captured cutoff. Preserve the required snapshot query when following next. // // Corresponds with GET /sessions/{session_id}/active-output/{content_id} (the `GetActiveOutputContent` operationId). GetActiveOutputContent(ctx context.Context, sessionID ID, contentID ID, params *GetActiveOutputContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetCatalog Discover candidates, loaded commands and pages // // Discovery and loaded composition are separate. Reads do not reload. Continuation identifies its section; candidate revision guards discovery-based selection. Requires capability `catalog: 1`. // // Corresponds with GET /sessions/{session_id}/catalog (the `GetCatalog` operationId). GetCatalog(ctx context.Context, sessionID ID, params *GetCatalogParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CompactSessionWithBody Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). CompactSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CompactSession Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). CompactSession(ctx context.Context, sessionID ID, body CompactSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetContext Inspect prepared context or request records // // Summary never prepares a request. Section requires snapshot_id, section_id, page and forbids request-pagination fields. Requests accepts after/limit/next. Stale snapshot is 410 context_changed, never another section. Requires capability `context: 1`. // // Corresponds with GET /sessions/{session_id}/context (the `GetContext` operationId). GetContext(ctx context.Context, sessionID ID, params *GetContextParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistory Page history or fork checkpoints // // Use only one of before/after/next. Durable positions are independent of actor replay. Pages are ascending and preserve complete display groups where bounded. // // Corresponds with GET /sessions/{session_id}/history (the `GetHistory` operationId). GetHistory(ctx context.Context, sessionID ID, params *GetHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistoryContent Read full content in bounded pieces // // Follow next until null. UTF-8 pieces end at character boundaries. Reconstruct stored content, not shortened previews. Image fields are not paged here; their references name the image resource. // // Corresponds with GET /sessions/{session_id}/history/{entry_id} (the `GetHistoryContent` operationId). GetHistoryContent(ctx context.Context, sessionID ID, entryID ID, params *GetHistoryContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetHistoryImage Read one image field as its own bytes // // Image references in history point here. The body is the stored image itself, not base64, and is never content-coded. // // Corresponds with GET /sessions/{session_id}/history/{entry_id}/{field} (the `GetHistoryImage` operationId). GetHistoryImage(ctx context.Context, sessionID ID, entryID ID, field string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInput Read a durable input outcome // // Available after session deletion. Accepted is not consumed or answered. Retain pending and unfinished-turn identities; terminal decisions last seven days. Unknown old UUIDv7 returns 410, never a fresh admission. // // Corresponds with GET /sessions/{session_id}/inputs/{input_id} (the `GetInput` operationId). GetInput(ctx context.Context, sessionID ID, inputID ID, reqEditors ...RequestEditorFn) (*http.Response, error) // PutInputWithBody Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). PutInputWithBody(ctx context.Context, sessionID ID, inputID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PutInput Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). PutInput(ctx context.Context, sessionID ID, inputID UUIDv7, body PutInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CancelInputWithBody Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). CancelInputWithBody(ctx context.Context, sessionID ID, inputID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CancelInput Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). CancelInput(ctx context.Context, sessionID ID, inputID ID, body CancelInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // InterruptSessionWithBody Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). InterruptSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // InterruptSession Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). InterruptSession(ctx context.Context, sessionID ID, body InterruptSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // UpgradeKernelWithBody Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). UpgradeKernelWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // UpgradeKernel Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). UpgradeKernel(ctx context.Context, sessionID ID, body UpgradeKernelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ReloadSessionWithBody Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). ReloadSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ReloadSession Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). ReloadSession(ctx context.Context, sessionID ID, body ReloadSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RecordVisitWithBody Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). RecordVisitWithBody(ctx context.Context, sessionID ID, visitID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // RecordVisit Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). RecordVisit(ctx context.Context, sessionID ID, visitID UUIDv7, body RecordVisitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSettings Read shared settings or one canonical group // // Without group, return Settings and observed group validators. With group, return that group only; the ETag covers that representation. // // Corresponds with GET /settings (the `GetSettings` operationId). GetSettings(ctx context.Context, params *GetSettingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSettingsWithBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). PatchSettingsWithBody(ctx context.Context, params *PatchSettingsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // PatchSettingsWithApplicationMergePatchPlusJSONBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). PatchSettingsWithApplicationMergePatchPlusJSONBody(ctx context.Context, params *PatchSettingsParams, body PatchSettingsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetStorage Read storage accounting // // Each section has its own continuation. Totals cover complete storage. Paths never authorize local mutation. Requires capability `storage_report: 1`. // // Corresponds with GET /storage (the `GetStorage` operationId). GetStorage(ctx context.Context, params *GetStorageParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetWorkspaces Browse recent locations or a directory // // Without location return recent workspaces. include=preview requires location. Paths resolve on the daemon host; cached host state does not perform SSH sign-in. Requires capability `workspace_browsing: 1`. // // Corresponds with GET /workspaces (the `GetWorkspaces` operationId). GetWorkspaces(ctx context.Context, params *GetWorkspacesParams, reqEditors ...RequestEditorFn) (*http.Response, error) } // GetAuth Read login choices and redacted accounts // // Requires capability `provider_auth: 1`. // // Corresponds with GET /auth (the `GetAuth` operationId). func (c *Client) GetAuth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetAuthRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteAccount Remove an unreferenced provider account // // Reject if a saved provider profile references it. Does not interrupt captured credentials in an active request. Account IDs are never reused. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/accounts/{account_id} (the `DeleteAccount` operationId). func (c *Client) DeleteAccount(ctx context.Context, accountID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteAccountRequest(c.Server, accountID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CancelLogin Cancel a login idempotently // // Cancellation stops only this flow; completed accounts remain saved. No If-Match is needed for identity-scoped cancellation. Requires capability `provider_auth: 1`. // // Corresponds with DELETE /auth/logins/{login_id} (the `CancelLogin` operationId). func (c *Client) CancelLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCancelLoginRequest(c.Server, loginID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetLogin Inspect a provider login // // No credential or submitted form echo. Terminal records remain fifteen minutes; unfinished flows expire at their provider deadline. Requires capability `provider_auth: 1`. // // Corresponds with GET /auth/logins/{login_id} (the `GetLogin` operationId). func (c *Client) GetLogin(ctx context.Context, loginID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLoginRequest(c.Server, loginID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AnswerLoginWithBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). func (c *Client) AnswerLoginWithBody(ctx context.Context, loginID ID, params *AnswerLoginParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAnswerLoginRequestWithBody(c.Server, loginID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AnswerLoginWithApplicationMergePatchPlusJSONBody Supply manual callback or code // // Requires capability `provider_auth: 1`. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /auth/logins/{login_id} (the `AnswerLogin` operationId). func (c *Client) AnswerLoginWithApplicationMergePatchPlusJSONBody(ctx context.Context, loginID ID, params *AnswerLoginParams, body AnswerLoginApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAnswerLoginRequestWithApplicationMergePatchPlusJSONBody(c.Server, loginID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateLoginWithBody Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes any type of body and a specified content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). func (c *Client) CreateLoginWithBody(ctx context.Context, loginID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateLoginRequestWithBody(c.Server, loginID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateLogin Start or recover an identified provider login // // UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted failures; a new flow needs a new ID. Requires capability `provider_auth: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /auth/logins/{login_id} (the `CreateLogin` operationId). func (c *Client) CreateLogin(ctx context.Context, loginID UUIDv7, body CreateLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateLoginRequest(c.Server, loginID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // UnlinkWorkspace Remove a member from the observed group // // Check membership at commit. Creates a singleton group; deletes no work or memory. Human-only. // // Corresponds with DELETE /extensions/links/groups (the `UnlinkWorkspace` operationId). func (c *Client) UnlinkWorkspace(ctx context.Context, params *UnlinkWorkspaceParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUnlinkWorkspaceRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetLinkGroup Read linked membership and presence // // Only configuration view has the canonical membership ETag. Presence does not change that validator. // // Corresponds with GET /extensions/links/groups (the `GetLinkGroup` operationId). func (c *Client) GetLinkGroup(ctx context.Context, params *GetLinkGroupParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLinkGroupRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // MergeLinkGroupsWithBody Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). func (c *Client) MergeLinkGroupsWithBody(ctx context.Context, params *MergeLinkGroupsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMergeLinkGroupsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // MergeLinkGroups Merge two observed workspace groups // // Check both observed validators in one owner commit. Human-only; domain commit and notifications are separate. No automatic lost-response retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/links/groups (the `MergeLinkGroups` operationId). func (c *Client) MergeLinkGroups(ctx context.Context, params *MergeLinkGroupsParams, body MergeLinkGroupsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMergeLinkGroupsRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListPaperclips List paperclips resources // // Requires enabled extension paperclips. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/paperclips/items (the `ListPaperclips` operationId). func (c *Client) ListPaperclips(ctx context.Context, params *ListPaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListPaperclipsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreatePaperclipsWithBody Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). func (c *Client) CreatePaperclipsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePaperclipsRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreatePaperclips Create a paperclips resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/paperclips/items (the `CreatePaperclips` operationId). func (c *Client) CreatePaperclips(ctx context.Context, body CreatePaperclipsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePaperclipsRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeletePaperclips Delete a paperclips resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/paperclips/items/{item_id} (the `DeletePaperclips` operationId). func (c *Client) DeletePaperclips(ctx context.Context, itemID ID, params *DeletePaperclipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeletePaperclipsRequest(c.Server, itemID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetPaperclips Read one paperclips resource // // Corresponds with GET /extensions/paperclips/items/{item_id} (the `GetPaperclips` operationId). func (c *Client) GetPaperclips(ctx context.Context, itemID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPaperclipsRequest(c.Server, itemID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchPaperclipsWithBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). func (c *Client) PatchPaperclipsWithBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchPaperclipsRequestWithBody(c.Server, itemID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchPaperclipsWithApplicationMergePatchPlusJSONBody Edit a paperclips resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/paperclips/items/{item_id} (the `PatchPaperclips` operationId). func (c *Client) PatchPaperclipsWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchPaperclipsParams, body PatchPaperclipsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchPaperclipsRequestWithApplicationMergePatchPlusJSONBody(c.Server, itemID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateProxyCompletionWithBody Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). func (c *Client) CreateProxyCompletionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateProxyCompletionRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateProxyCompletion Run a stateless OpenAI chat completion // // Caller supplies full history. Tool IDs carry opaque provider state and must be echoed exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply only representable generation options; proxy transport documentation defines these differences. No automatic replay after request admission. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/proxy/v1/chat/completions (the `CreateProxyCompletion` operationId). func (c *Client) CreateProxyCompletion(ctx context.Context, body CreateProxyCompletionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateProxyCompletionRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListProxyModels List saved-profile OpenAI model IDs // // External OpenAI envelope. Bearer required unless operator explicitly configured anonymous loopback access. // // Corresponds with GET /extensions/proxy/v1/models (the `ListProxyModels` operationId). func (c *Client) ListProxyModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListProxyModelsRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListJobs Read bounded live job observations and the jobs page // // Corresponds with GET /extensions/run/sessions/{session_id}/jobs (the `ListJobs` operationId). func (c *Client) ListJobs(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListJobsRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // StopJobWithBody Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). func (c *Client) StopJobWithBody(ctx context.Context, sessionID ID, jobID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewStopJobRequestWithBody(c.Server, sessionID, jobID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // StopJob Explicitly stop one observed process group // // No automatic retry after response loss. Read the job collection before confirming another attempt. A successful response confirms the supervisor verdict, not just signal delivery. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/run/sessions/{session_id}/jobs/{job_id}/stop (the `StopJob` operationId). func (c *Client) StopJob(ctx context.Context, sessionID ID, jobID ID, body StopJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewStopJobRequest(c.Server, sessionID, jobID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListSchedule List schedule resources // // Requires enabled extension schedule. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/schedule/jobs (the `ListSchedule` operationId). func (c *Client) ListSchedule(ctx context.Context, params *ListScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListScheduleRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateScheduleWithBody Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). func (c *Client) CreateScheduleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateScheduleRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateSchedule Create a schedule resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/schedule/jobs (the `CreateSchedule` operationId). func (c *Client) CreateSchedule(ctx context.Context, body CreateScheduleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateScheduleRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteSchedule Delete a schedule resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/schedule/jobs/{job_id} (the `DeleteSchedule` operationId). func (c *Client) DeleteSchedule(ctx context.Context, jobID ID, params *DeleteScheduleParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteScheduleRequest(c.Server, jobID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSchedule Read one schedule resource // // Corresponds with GET /extensions/schedule/jobs/{job_id} (the `GetSchedule` operationId). func (c *Client) GetSchedule(ctx context.Context, jobID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetScheduleRequest(c.Server, jobID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchScheduleWithBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). func (c *Client) PatchScheduleWithBody(ctx context.Context, jobID ID, params *PatchScheduleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchScheduleRequestWithBody(c.Server, jobID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchScheduleWithApplicationMergePatchPlusJSONBody Edit a schedule resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/schedule/jobs/{job_id} (the `PatchSchedule` operationId). func (c *Client) PatchScheduleWithApplicationMergePatchPlusJSONBody(ctx context.Context, jobID ID, params *PatchScheduleParams, body PatchScheduleApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchScheduleRequestWithApplicationMergePatchPlusJSONBody(c.Server, jobID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListWebSearchProviders List web search providers in the order a search tries them // // Requires enabled extension web-search. The global order lives in extensions.json. // // Corresponds with GET /extensions/web-search/providers (the `ListWebSearchProviders` operationId). func (c *Client) ListWebSearchProviders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWebSearchProvidersRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ChangeWebSearchProviderWithBody Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). func (c *Client) ChangeWebSearchProviderWithBody(ctx context.Context, name ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewChangeWebSearchProviderRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ChangeWebSearchProvider Move a web search provider up or down, or turn it on or off // // A move past either end leaves the order as it was. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/web-search/providers/{name} (the `ChangeWebSearchProvider` operationId). func (c *Client) ChangeWebSearchProvider(ctx context.Context, name ID, body ChangeWebSearchProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewChangeWebSearchProviderRequest(c.Server, name, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetDelivery Read an accepted delivery payload // // Corresponds with GET /extensions/webhooks/deliveries/{delivery_id} (the `GetDelivery` operationId). func (c *Client) GetDelivery(ctx context.Context, deliveryID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDeliveryRequest(c.Server, deliveryID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListHooks List hooks without secrets // // Corresponds with GET /extensions/webhooks/hooks (the `ListHooks` operationId). func (c *Client) ListHooks(ctx context.Context, params *ListHooksParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListHooksRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateHookWithBody Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). func (c *Client) CreateHookWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateHookRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateHook Create a hook and disclose its secret once // // Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks (the `CreateHook` operationId). func (c *Client) CreateHook(ctx context.Context, body CreateHookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateHookRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteHook Delete a hook while retaining accepted deliveries // // Corresponds with DELETE /extensions/webhooks/hooks/{hook_id} (the `DeleteHook` operationId). func (c *Client) DeleteHook(ctx context.Context, hookID ID, params *DeleteHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteHookRequest(c.Server, hookID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHook Read hook state or canonical configuration // // ETag is present only on configuration view. Ordinary read exposes the configuration resource and validator plus runtime observations. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id} (the `GetHook` operationId). func (c *Client) GetHook(ctx context.Context, hookID ID, params *GetHookParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHookRequest(c.Server, hookID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookWithBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). func (c *Client) PatchHookWithBody(ctx context.Context, hookID ID, params *PatchHookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookRequestWithBody(c.Server, hookID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookWithApplicationMergePatchPlusJSONBody Edit the observed hook configuration // // Target session and secret are not writable. Agent callers need that session permission; HTTP bearer clients are operators. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/hooks/{hook_id} (the `PatchHook` operationId). func (c *Client) PatchHookWithApplicationMergePatchPlusJSONBody(ctx context.Context, hookID ID, params *PatchHookParams, body PatchHookApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookRequestWithApplicationMergePatchPlusJSONBody(c.Server, hookID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListHookDeliveries Read accepted hook delivery metadata // // Historical reads remain available after hook deletion while retained deliveries exist. // // Corresponds with GET /extensions/webhooks/hooks/{hook_id}/deliveries (the `ListHookDeliveries` operationId). func (c *Client) ListHookDeliveries(ctx context.Context, hookID ID, params *ListHookDeliveriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListHookDeliveriesRequest(c.Server, hookID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeliverWebhookWithBody Accept signed external data durably // // Authenticate configured HMAC-SHA256 over the exact raw body. A daemon bearer is not a substitute. Signature header name and prefix come from hook configuration. Same event ID and body returns original admission; changed body conflicts. Pending inbox limit 1000. Raw body maximum 65536 bytes. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/deliveries (the `DeliverWebhook` operationId). func (c *Client) DeliverWebhookWithBody(ctx context.Context, hookID ID, params *DeliverWebhookParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeliverWebhookRequestWithBody(c.Server, hookID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RotateHookSecretWithBody Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). func (c *Client) RotateHookSecretWithBody(ctx context.Context, hookID ID, params *RotateHookSecretParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRotateHookSecretRequestWithBody(c.Server, hookID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RotateHookSecret Rotate and disclose the hook secret once // // If-Match is the observed hook configuration validator. Missing secret generates one. No automatic retry after a lost response. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/webhooks/hooks/{hook_id}/secret (the `RotateHookSecret` operationId). func (c *Client) RotateHookSecret(ctx context.Context, hookID ID, params *RotateHookSecretParams, body RotateHookSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRotateHookSecretRequest(c.Server, hookID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHookPermission Read agent hook-management permission // // Absent stored permission reads false with its initial canonical validator. // // Corresponds with GET /extensions/webhooks/permissions/{session_id} (the `GetHookPermission` operationId). func (c *Client) GetHookPermission(ctx context.Context, sessionID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHookPermissionRequest(c.Server, sessionID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookPermissionWithBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). func (c *Client) PatchHookPermissionWithBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookPermissionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchHookPermissionWithApplicationMergePatchPlusJSONBody Set agent hook-management permission // // Only operator callers can grant permission. Omission retains it; turning off management keeps existing hooks enabled. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/webhooks/permissions/{session_id} (the `PatchHookPermission` operationId). func (c *Client) PatchHookPermissionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchHookPermissionParams, body PatchHookPermissionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchHookPermissionRequestWithApplicationMergePatchPlusJSONBody(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListWork List work resources // // Requires enabled extension work. Lists may include bounded page descriptors and glances. // // Corresponds with GET /extensions/work/items (the `ListWork` operationId). func (c *Client) ListWork(ctx context.Context, params *ListWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWorkRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateWorkWithBody Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes any type of body and a specified content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). func (c *Client) CreateWorkWithBody(ctx context.Context, params *CreateWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateWorkRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateWork Create a work resource // // No automatic lost-response retry. Notification outcome does not undo a committed domain edit. // // Takes a body of the `application/json` content type. // // Corresponds with POST /extensions/work/items (the `CreateWork` operationId). func (c *Client) CreateWork(ctx context.Context, params *CreateWorkParams, body CreateWorkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateWorkRequest(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteWork Delete a work resource // // Committed deletion remains successful if notification fails. Work items with children cannot be deleted. // // Corresponds with DELETE /extensions/work/items/{item_id} (the `DeleteWork` operationId). func (c *Client) DeleteWork(ctx context.Context, itemID ID, params *DeleteWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteWorkRequest(c.Server, itemID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetWork Read one work resource // // Corresponds with GET /extensions/work/items/{item_id} (the `GetWork` operationId). func (c *Client) GetWork(ctx context.Context, itemID ID, params *GetWorkParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetWorkRequest(c.Server, itemID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchWorkWithBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). func (c *Client) PatchWorkWithBody(ctx context.Context, itemID ID, params *PatchWorkParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchWorkRequestWithBody(c.Server, itemID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchWorkWithApplicationMergePatchPlusJSONBody Edit a work resource // // Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /extensions/work/items/{item_id} (the `PatchWork` operationId). func (c *Client) PatchWorkWithApplicationMergePatchPlusJSONBody(ctx context.Context, itemID ID, params *PatchWorkParams, body PatchWorkApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchWorkRequestWithApplicationMergePatchPlusJSONBody(c.Server, itemID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListHosts Read known SSH hosts and cached state // // Requires capability `host_probes: 1`. // // Corresponds with GET /hosts (the `ListHosts` operationId). func (c *Client) ListHosts(ctx context.Context, params *ListHostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListHostsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ProbeHostWithBody Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes any type of body and a specified content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). func (c *Client) ProbeHostWithBody(ctx context.Context, host ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewProbeHostRequestWithBody(c.Server, host, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ProbeHost Start or join a host probe // // Coalesce repeated probes. Authentication remains an explicit operator handoff; no background SSH sign-in. Requires capability `host_probes: 1`. // // Takes a body of the `application/json` content type. // // Corresponds with POST /hosts/{host}/probe (the `ProbeHost` operationId). func (c *Client) ProbeHost(ctx context.Context, host ID, body ProbeHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewProbeHostRequest(c.Server, host, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListModels Read provider model metadata // // In catalogue view, exactly one of provider_profile/provider is required. Endpoint is allowed only with provider. Unknown facts are null. A manual unlisted ID remains usable. Optional model returns one metadata row, including cap_key, for an unlisted manual ID; unknown facts stay null. // // Corresponds with GET /models (the `ListModels` operationId). func (c *Client) ListModels(ctx context.Context, params *ListModelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListModelsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetServer Read daemon identity and capabilities // // No startup or replacement. Authentication and protocol failures remain actionable errors. Pagination is valid only with include=quota_history. // // Corresponds with GET /server (the `GetServer` operationId). func (c *Client) GetServer(ctx context.Context, params *GetServerParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetServerRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ShutdownServerWithBody Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes any type of body and a specified content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). func (c *Client) ShutdownServerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewShutdownServerRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ShutdownServer Drain the identified daemon // // No automatic recovery or replay. The local launcher alone may offer replacement. // // Takes a body of the `application/json` content type. // // Corresponds with POST /server/shutdown (the `ShutdownServer` operationId). func (c *Client) ShutdownServer(ctx context.Context, body ShutdownServerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewShutdownServerRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListSessions Browse sessions or watch collection changes // // JSON defaults to roots, or all with parent/family. Parent and family are exclusive. Explicit roots with either is invalid. SSE accepts the same scope filters, excluding sort/limit/next; no cursor or replay. Subscribe, wait for ready, then read pages. Closure or overflow repeats this flow. // // Corresponds with GET /sessions (the `ListSessions` operationId). func (c *Client) ListSessions(ctx context.Context, params *ListSessionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListSessionsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteSession Delete a leaf or captured subtree // // Leaf requires idle and no children. Subtree requires family_revision, gates new children, interrupts captured members and deletes deepest first. Partial outcomes are explicit. Refresh before confirming a new attempt; never automatically replay after transport loss. // // Corresponds with DELETE /sessions/{session_id} (the `DeleteSession` operationId). func (c *Client) DeleteSession(ctx context.Context, sessionID ID, params *DeleteSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteSessionRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSession Read or watch one session // // JSON defaults to complete Session. Configuration JSON excludes tail and replay parameters. SSE accepts tail and after_generation/after_seq, without view. Initial subscription omits both cursors; reconnect keeps the fully consumed pair. A missing generation requests reset. after_generation without after_seq is invalid. Neither auth failure nor closure starts a daemon. // // Corresponds with GET /sessions/{session_id} (the `GetSession` operationId). func (c *Client) GetSession(ctx context.Context, sessionID ID, params *GetSessionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSessionRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSessionWithBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change with family_revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). func (c *Client) PatchSessionWithBody(ctx context.Context, sessionID ID, params *PatchSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSessionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSessionWithApplicationMergePatchPlusJSONBody Edit configuration or move workspace // // Use the observed configuration URL and validator. Workspace is a standalone change with family_revision. Busy target fails before commit; busy descendants follow a committed parent move at idle. Other configuration fields commit together. No automatic lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /sessions/{session_id} (the `PatchSession` operationId). func (c *Client) PatchSessionWithApplicationMergePatchPlusJSONBody(ctx context.Context, sessionID ID, params *PatchSessionParams, body PatchSessionApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSessionRequestWithApplicationMergePatchPlusJSONBody(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateSessionWithBody Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). func (c *Client) CreateSessionWithBody(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSessionRequestWithBody(c.Server, sessionID, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateSession Create a new, forked or child session // // Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted intent after response loss. An existing resource returns 412; GET creation.submitted proves original intent. Child membership and task admission commit together. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id} (the `CreateSession` operationId). func (c *Client) CreateSession(ctx context.Context, sessionID UUIDv7, params *CreateSessionParams, body CreateSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateSessionRequest(c.Server, sessionID, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetActiveOutputContent Read unfinished output at a captured snapshot cutoff // // Pages contain at most 262144 UTF-8 bytes and remain within the captured cutoff. Preserve the required snapshot query when following next. // // Corresponds with GET /sessions/{session_id}/active-output/{content_id} (the `GetActiveOutputContent` operationId). func (c *Client) GetActiveOutputContent(ctx context.Context, sessionID ID, contentID ID, params *GetActiveOutputContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetActiveOutputContentRequest(c.Server, sessionID, contentID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetCatalog Discover candidates, loaded commands and pages // // Discovery and loaded composition are separate. Reads do not reload. Continuation identifies its section; candidate revision guards discovery-based selection. Requires capability `catalog: 1`. // // Corresponds with GET /sessions/{session_id}/catalog (the `GetCatalog` operationId). func (c *Client) GetCatalog(ctx context.Context, sessionID ID, params *GetCatalogParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetCatalogRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CompactSessionWithBody Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). func (c *Client) CompactSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCompactSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CompactSession Compact model context while retaining history // // Idle required. Selecting a strategy can succeed even if compaction later fails; report both. Full durable history stays intact. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/compaction (the `CompactSession` operationId). func (c *Client) CompactSession(ctx context.Context, sessionID ID, body CompactSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCompactSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetContext Inspect prepared context or request records // // Summary never prepares a request. Section requires snapshot_id, section_id, page and forbids request-pagination fields. Requests accepts after/limit/next. Stale snapshot is 410 context_changed, never another section. Requires capability `context: 1`. // // Corresponds with GET /sessions/{session_id}/context (the `GetContext` operationId). func (c *Client) GetContext(ctx context.Context, sessionID ID, params *GetContextParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetContextRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistory Page history or fork checkpoints // // Use only one of before/after/next. Durable positions are independent of actor replay. Pages are ascending and preserve complete display groups where bounded. // // Corresponds with GET /sessions/{session_id}/history (the `GetHistory` operationId). func (c *Client) GetHistory(ctx context.Context, sessionID ID, params *GetHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryRequest(c.Server, sessionID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistoryContent Read full content in bounded pieces // // Follow next until null. UTF-8 pieces end at character boundaries. Reconstruct stored content, not shortened previews. Image fields are not paged here; their references name the image resource. // // Corresponds with GET /sessions/{session_id}/history/{entry_id} (the `GetHistoryContent` operationId). func (c *Client) GetHistoryContent(ctx context.Context, sessionID ID, entryID ID, params *GetHistoryContentParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryContentRequest(c.Server, sessionID, entryID, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetHistoryImage Read one image field as its own bytes // // Image references in history point here. The body is the stored image itself, not base64, and is never content-coded. // // Corresponds with GET /sessions/{session_id}/history/{entry_id}/{field} (the `GetHistoryImage` operationId). func (c *Client) GetHistoryImage(ctx context.Context, sessionID ID, entryID ID, field string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHistoryImageRequest(c.Server, sessionID, entryID, field) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetInput Read a durable input outcome // // Available after session deletion. Accepted is not consumed or answered. Retain pending and unfinished-turn identities; terminal decisions last seven days. Unknown old UUIDv7 returns 410, never a fresh admission. // // Corresponds with GET /sessions/{session_id}/inputs/{input_id} (the `GetInput` operationId). func (c *Client) GetInput(ctx context.Context, sessionID ID, inputID ID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetInputRequest(c.Server, sessionID, inputID) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutInputWithBody Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). func (c *Client) PutInputWithBody(ctx context.Context, sessionID ID, inputID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutInputRequestWithBody(c.Server, sessionID, inputID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PutInput Admit immutable identified input // // Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. Preserve the exact intent and identity while recovering an uncertain response. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/inputs/{input_id} (the `PutInput` operationId). func (c *Client) PutInput(ctx context.Context, sessionID ID, inputID UUIDv7, body PutInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPutInputRequest(c.Server, sessionID, inputID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CancelInputWithBody Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). func (c *Client) CancelInputWithBody(ctx context.Context, sessionID ID, inputID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCancelInputRequestWithBody(c.Server, sessionID, inputID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CancelInput Cancel or interrupt only this input // // Never interrupts a later unrelated turn. shared_running leaves a shared turn running; retry only inspects or acts on this same input. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/inputs/{input_id}/cancel (the `CancelInput` operationId). func (c *Client) CancelInput(ctx context.Context, sessionID ID, inputID ID, body CancelInputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCancelInputRequest(c.Server, sessionID, inputID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // InterruptSessionWithBody Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). func (c *Client) InterruptSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewInterruptSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // InterruptSession Interrupt a captured run and waiting prefix // // Capture run_id and through_input_order from the installed session. Retry cannot interrupt a later run or cancel newer inputs. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/interrupt (the `InterruptSession` operationId). func (c *Client) InterruptSession(ctx context.Context, sessionID ID, body InterruptSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewInterruptSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // UpgradeKernelWithBody Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). func (c *Client) UpgradeKernelWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpgradeKernelRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // UpgradeKernel Explicitly upgrade an idle kernel // // Stage and validate before swap. Report external jobs stopped during an unsuccessful upgrade; do not claim them restored. No automatic retry. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/kernel/upgrade (the `UpgradeKernel` operationId). func (c *Client) UpgradeKernel(ctx context.Context, sessionID ID, body UpgradeKernelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpgradeKernelRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReloadSessionWithBody Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes any type of body and a specified content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). func (c *Client) ReloadSessionWithBody(ctx context.Context, sessionID ID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReloadSessionRequestWithBody(c.Server, sessionID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ReloadSession Reload composition, models or both // // Session reload requires idle. Both targets return separate outcomes, preserving confirmed success when the other fails. Lost-response replay is not automatic. // // Takes a body of the `application/json` content type. // // Corresponds with POST /sessions/{session_id}/reload (the `ReloadSession` operationId). func (c *Client) ReloadSession(ctx context.Context, sessionID ID, body ReloadSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReloadSessionRequest(c.Server, sessionID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RecordVisitWithBody Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes any type of body and a specified content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). func (c *Client) RecordVisitWithBody(ctx context.Context, sessionID ID, visitID UUIDv7, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRecordVisitRequestWithBody(c.Server, sessionID, visitID, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RecordVisit Count one deliberate opening // // Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. // // Takes a body of the `application/json` content type. // // Corresponds with PUT /sessions/{session_id}/visits/{visit_id} (the `RecordVisit` operationId). func (c *Client) RecordVisit(ctx context.Context, sessionID ID, visitID UUIDv7, body RecordVisitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRecordVisitRequest(c.Server, sessionID, visitID, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetSettings Read shared settings or one canonical group // // Without group, return Settings and observed group validators. With group, return that group only; the ETag covers that representation. // // Corresponds with GET /settings (the `GetSettings` operationId). func (c *Client) GetSettings(ctx context.Context, params *GetSettingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSettingsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSettingsWithBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes any type of body and a specified content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). func (c *Client) PatchSettingsWithBody(ctx context.Context, params *PatchSettingsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSettingsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // PatchSettingsWithApplicationMergePatchPlusJSONBody Atomically edit one settings group // // Query group selects its corresponding schema. Omitted fields keep values. Null removes only nullable fields or map entries. Candidate validation precedes the complete group commit. No lost-response retry. // // Takes a body of the `application/merge-patch+json` content type. // // Corresponds with PATCH /settings (the `PatchSettings` operationId). func (c *Client) PatchSettingsWithApplicationMergePatchPlusJSONBody(ctx context.Context, params *PatchSettingsParams, body PatchSettingsApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchSettingsRequestWithApplicationMergePatchPlusJSONBody(c.Server, params, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetStorage Read storage accounting // // Each section has its own continuation. Totals cover complete storage. Paths never authorize local mutation. Requires capability `storage_report: 1`. // // Corresponds with GET /storage (the `GetStorage` operationId). func (c *Client) GetStorage(ctx context.Context, params *GetStorageParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetStorageRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // GetWorkspaces Browse recent locations or a directory // // Without location return recent workspaces. include=preview requires location. Paths resolve on the daemon host; cached host state does not perform SSH sign-in. Requires capability `workspace_browsing: 1`. // // Corresponds with GET /workspaces (the `GetWorkspaces` operationId). func (c *Client) GetWorkspaces(ctx context.Context, params *GetWorkspacesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetWorkspacesRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // NewGetAuthRequest constructs an http.Request for the GetAuth method func NewGetAuthRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteAccountRequest constructs an http.Request for the DeleteAccount method func NewDeleteAccountRequest(server string, accountID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "account_id", accountID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/accounts/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCancelLoginRequest constructs an http.Request for the CancelLogin method func NewCancelLoginRequest(server string, loginID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetLoginRequest constructs an http.Request for the GetLogin method func NewGetLoginRequest(server string, loginID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewAnswerLoginRequestWithApplicationMergePatchPlusJSONBody calls the generic AnswerLogin builder with application/merge-patch+json body func NewAnswerLoginRequestWithApplicationMergePatchPlusJSONBody(server string, loginID ID, params *AnswerLoginParams, body AnswerLoginApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewAnswerLoginRequestWithBody(server, loginID, params, "application/merge-patch+json", bodyReader) } // NewAnswerLoginRequestWithBody constructs an http.Request for the AnswerLogin method, with any body, and a specified content type func NewAnswerLoginRequestWithBody(server string, loginID ID, params *AnswerLoginParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewCreateLoginRequest calls the generic CreateLogin builder with application/json body func NewCreateLoginRequest(server string, loginID UUIDv7, body CreateLoginJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateLoginRequestWithBody(server, loginID, "application/json", bodyReader) } // NewCreateLoginRequestWithBody constructs an http.Request for the CreateLogin method, with any body, and a specified content type func NewCreateLoginRequestWithBody(server string, loginID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "login_id", loginID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/auth/logins/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewUnlinkWorkspaceRequest constructs an http.Request for the UnlinkWorkspace method func NewUnlinkWorkspaceRequest(server string, params *UnlinkWorkspaceParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/links/groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if queryFrag, err := runtime.StyleParamWithOptions("form", true, "member", params.Member, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetLinkGroupRequest constructs an http.Request for the GetLinkGroup method func NewGetLinkGroupRequest(server string, params *GetLinkGroupParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/links/groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewMergeLinkGroupsRequest calls the generic MergeLinkGroups builder with application/json body func NewMergeLinkGroupsRequest(server string, params *MergeLinkGroupsParams, body MergeLinkGroupsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewMergeLinkGroupsRequestWithBody(server, params, "application/json", bodyReader) } // NewMergeLinkGroupsRequestWithBody constructs an http.Request for the MergeLinkGroups method, with any body, and a specified content type func NewMergeLinkGroupsRequestWithBody(server string, params *MergeLinkGroupsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/links/groups") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListPaperclipsRequest constructs an http.Request for the ListPaperclips method func NewListPaperclipsRequest(server string, params *ListPaperclipsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreatePaperclipsRequest calls the generic CreatePaperclips builder with application/json body func NewCreatePaperclipsRequest(server string, body CreatePaperclipsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreatePaperclipsRequestWithBody(server, "application/json", bodyReader) } // NewCreatePaperclipsRequestWithBody constructs an http.Request for the CreatePaperclips method, with any body, and a specified content type func NewCreatePaperclipsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeletePaperclipsRequest constructs an http.Request for the DeletePaperclips method func NewDeletePaperclipsRequest(server string, itemID ID, params *DeletePaperclipsParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetPaperclipsRequest constructs an http.Request for the GetPaperclips method func NewGetPaperclipsRequest(server string, itemID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchPaperclipsRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchPaperclips builder with application/merge-patch+json body func NewPatchPaperclipsRequestWithApplicationMergePatchPlusJSONBody(server string, itemID ID, params *PatchPaperclipsParams, body PatchPaperclipsApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchPaperclipsRequestWithBody(server, itemID, params, "application/merge-patch+json", bodyReader) } // NewPatchPaperclipsRequestWithBody constructs an http.Request for the PatchPaperclips method, with any body, and a specified content type func NewPatchPaperclipsRequestWithBody(server string, itemID ID, params *PatchPaperclipsParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/paperclips/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewCreateProxyCompletionRequest calls the generic CreateProxyCompletion builder with application/json body func NewCreateProxyCompletionRequest(server string, body CreateProxyCompletionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateProxyCompletionRequestWithBody(server, "application/json", bodyReader) } // NewCreateProxyCompletionRequestWithBody constructs an http.Request for the CreateProxyCompletion method, with any body, and a specified content type func NewCreateProxyCompletionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/proxy/v1/chat/completions") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListProxyModelsRequest constructs an http.Request for the ListProxyModels method func NewListProxyModelsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/proxy/v1/models") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListJobsRequest constructs an http.Request for the ListJobs method func NewListJobsRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/run/sessions/%s/jobs", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewStopJobRequest calls the generic StopJob builder with application/json body func NewStopJobRequest(server string, sessionID ID, jobID ID, body StopJobJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewStopJobRequestWithBody(server, sessionID, jobID, "application/json", bodyReader) } // NewStopJobRequestWithBody constructs an http.Request for the StopJob method, with any body, and a specified content type func NewStopJobRequestWithBody(server string, sessionID ID, jobID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/run/sessions/%s/jobs/%s/stop", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListScheduleRequest constructs an http.Request for the ListSchedule method func NewListScheduleRequest(server string, params *ListScheduleParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session_id", params.SessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateScheduleRequest calls the generic CreateSchedule builder with application/json body func NewCreateScheduleRequest(server string, body CreateScheduleJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateScheduleRequestWithBody(server, "application/json", bodyReader) } // NewCreateScheduleRequestWithBody constructs an http.Request for the CreateSchedule method, with any body, and a specified content type func NewCreateScheduleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteScheduleRequest constructs an http.Request for the DeleteSchedule method func NewDeleteScheduleRequest(server string, jobID ID, params *DeleteScheduleParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetScheduleRequest constructs an http.Request for the GetSchedule method func NewGetScheduleRequest(server string, jobID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchScheduleRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchSchedule builder with application/merge-patch+json body func NewPatchScheduleRequestWithApplicationMergePatchPlusJSONBody(server string, jobID ID, params *PatchScheduleParams, body PatchScheduleApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchScheduleRequestWithBody(server, jobID, params, "application/merge-patch+json", bodyReader) } // NewPatchScheduleRequestWithBody constructs an http.Request for the PatchSchedule method, with any body, and a specified content type func NewPatchScheduleRequestWithBody(server string, jobID ID, params *PatchScheduleParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "job_id", jobID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/schedule/jobs/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListWebSearchProvidersRequest constructs an http.Request for the ListWebSearchProviders method func NewListWebSearchProvidersRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/web-search/providers") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewChangeWebSearchProviderRequest calls the generic ChangeWebSearchProvider builder with application/json body func NewChangeWebSearchProviderRequest(server string, name ID, body ChangeWebSearchProviderJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewChangeWebSearchProviderRequestWithBody(server, name, "application/json", bodyReader) } // NewChangeWebSearchProviderRequestWithBody constructs an http.Request for the ChangeWebSearchProvider method, with any body, and a specified content type func NewChangeWebSearchProviderRequestWithBody(server string, name ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/web-search/providers/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetDeliveryRequest constructs an http.Request for the GetDelivery method func NewGetDeliveryRequest(server string, deliveryID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "delivery_id", deliveryID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/deliveries/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListHooksRequest constructs an http.Request for the ListHooks method func NewListHooksRequest(server string, params *ListHooksParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.SessionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "session_id", *params.SessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateHookRequest calls the generic CreateHook builder with application/json body func NewCreateHookRequest(server string, body CreateHookJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateHookRequestWithBody(server, "application/json", bodyReader) } // NewCreateHookRequestWithBody constructs an http.Request for the CreateHook method, with any body, and a specified content type func NewCreateHookRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteHookRequest constructs an http.Request for the DeleteHook method func NewDeleteHookRequest(server string, hookID ID, params *DeleteHookParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetHookRequest constructs an http.Request for the GetHook method func NewGetHookRequest(server string, hookID ID, params *GetHookParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchHookRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchHook builder with application/merge-patch+json body func NewPatchHookRequestWithApplicationMergePatchPlusJSONBody(server string, hookID ID, params *PatchHookParams, body PatchHookApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchHookRequestWithBody(server, hookID, params, "application/merge-patch+json", bodyReader) } // NewPatchHookRequestWithBody constructs an http.Request for the PatchHook method, with any body, and a specified content type func NewPatchHookRequestWithBody(server string, hookID ID, params *PatchHookParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListHookDeliveriesRequest constructs an http.Request for the ListHookDeliveries method func NewListHookDeliveriesRequest(server string, hookID ID, params *ListHookDeliveriesParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s/deliveries", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.State != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "state", *params.State, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeliverWebhookRequestWithBody constructs an http.Request for the DeliverWebhook method, with any body, and a specified content type func NewDeliverWebhookRequestWithBody(server string, hookID ID, params *DeliverWebhookParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s/deliveries", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { if params.XAlbedoEventID != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "X-Albedo-Event-Id", *params.XAlbedoEventID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("X-Albedo-Event-Id", headerParam0) } } return req, nil } // NewRotateHookSecretRequest calls the generic RotateHookSecret builder with application/json body func NewRotateHookSecretRequest(server string, hookID ID, params *RotateHookSecretParams, body RotateHookSecretJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewRotateHookSecretRequestWithBody(server, hookID, params, "application/json", bodyReader) } // NewRotateHookSecretRequestWithBody constructs an http.Request for the RotateHookSecret method, with any body, and a specified content type func NewRotateHookSecretRequestWithBody(server string, hookID ID, params *RotateHookSecretParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "hook_id", hookID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/hooks/%s/secret", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetHookPermissionRequest constructs an http.Request for the GetHookPermission method func NewGetHookPermissionRequest(server string, sessionID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/permissions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchHookPermissionRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchHookPermission builder with application/merge-patch+json body func NewPatchHookPermissionRequestWithApplicationMergePatchPlusJSONBody(server string, sessionID ID, params *PatchHookPermissionParams, body PatchHookPermissionApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchHookPermissionRequestWithBody(server, sessionID, params, "application/merge-patch+json", bodyReader) } // NewPatchHookPermissionRequestWithBody constructs an http.Request for the PatchHookPermission method, with any body, and a specified content type func NewPatchHookPermissionRequestWithBody(server string, sessionID ID, params *PatchHookPermissionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/webhooks/permissions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListWorkRequest constructs an http.Request for the ListWork method func NewListWorkRequest(server string, params *ListWorkParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateWorkRequest calls the generic CreateWork builder with application/json body func NewCreateWorkRequest(server string, params *CreateWorkParams, body CreateWorkJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateWorkRequestWithBody(server, params, "application/json", bodyReader) } // NewCreateWorkRequestWithBody constructs an http.Request for the CreateWork method, with any body, and a specified content type func NewCreateWorkRequestWithBody(server string, params *CreateWorkParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteWorkRequest constructs an http.Request for the DeleteWork method func NewDeleteWorkRequest(server string, itemID ID, params *DeleteWorkParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.NotifySessionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "notify_session_id", *params.NotifySessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetWorkRequest constructs an http.Request for the GetWork method func NewGetWorkRequest(server string, itemID ID, params *GetWorkParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchWorkRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchWork builder with application/merge-patch+json body func NewPatchWorkRequestWithApplicationMergePatchPlusJSONBody(server string, itemID ID, params *PatchWorkParams, body PatchWorkApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchWorkRequestWithBody(server, itemID, params, "application/merge-patch+json", bodyReader) } // NewPatchWorkRequestWithBody constructs an http.Request for the PatchWork method, with any body, and a specified content type func NewPatchWorkRequestWithBody(server string, itemID ID, params *PatchWorkParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "item_id", itemID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/extensions/work/items/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewListHostsRequest constructs an http.Request for the ListHosts method func NewListHostsRequest(server string, params *ListHostsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/hosts") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Target != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "target", *params.Target, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewProbeHostRequest calls the generic ProbeHost builder with application/json body func NewProbeHostRequest(server string, host ID, body ProbeHostJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewProbeHostRequestWithBody(server, host, "application/json", bodyReader) } // NewProbeHostRequestWithBody constructs an http.Request for the ProbeHost method, with any body, and a specified content type func NewProbeHostRequestWithBody(server string, host ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "host", host, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/hosts/%s/probe", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListModelsRequest constructs an http.Request for the ListModels method func NewListModelsRequest(server string, params *ListModelsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/models") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Extension != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "extension", *params.Extension, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Host != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "host", *params.Host, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Model != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "model", *params.Model, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.ProviderProfile != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "provider_profile", *params.ProviderProfile, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Provider != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "provider", *params.Provider, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Endpoint != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "endpoint", *params.Endpoint, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uri"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetServerRequest constructs an http.Request for the GetServer method func NewGetServerRequest(server string, params *GetServerParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/server") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Include != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include", *params.Include, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaProvider != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_provider", *params.QuotaProvider, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaAccount != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_account", *params.QuotaAccount, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaLimit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_limit", *params.QuotaLimit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.QuotaSince != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "quota_since", *params.QuotaSince, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewShutdownServerRequest calls the generic ShutdownServer builder with application/json body func NewShutdownServerRequest(server string, body ShutdownServerJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewShutdownServerRequestWithBody(server, "application/json", bodyReader) } // NewShutdownServerRequestWithBody constructs an http.Request for the ShutdownServer method, with any body, and a specified content type func NewShutdownServerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/server/shutdown") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListSessionsRequest constructs an http.Request for the ListSessions method func NewListSessionsRequest(server string, params *ListSessionsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Scope != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "scope", *params.Scope, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.ParentID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "parent_id", *params.ParentID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.FamilyID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "family_id", *params.FamilyID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Workspace != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "workspace", *params.Workspace, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Search != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "search", *params.Search, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Archived != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "archived", *params.Archived, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.NeedsReload != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "needs_reload", *params.NeedsReload, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Sort != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort", *params.Sort, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteSessionRequest constructs an http.Request for the DeleteSession method func NewDeleteSessionRequest(server string, sessionID ID, params *DeleteSessionParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Scope != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "scope", *params.Scope, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.FamilyRevision != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "family_revision", *params.FamilyRevision, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetSessionRequest constructs an http.Request for the GetSession method func NewGetSessionRequest(server string, sessionID ID, params *GetSessionParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Tail != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tail", *params.Tail, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.AfterGeneration != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after_generation", *params.AfterGeneration, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.AfterSeq != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after_seq", *params.AfterSeq, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchSessionRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchSession builder with application/merge-patch+json body func NewPatchSessionRequestWithApplicationMergePatchPlusJSONBody(server string, sessionID ID, params *PatchSessionParams, body PatchSessionApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchSessionRequestWithBody(server, sessionID, params, "application/merge-patch+json", bodyReader) } // NewPatchSessionRequestWithBody constructs an http.Request for the PatchSession method, with any body, and a specified content type func NewPatchSessionRequestWithBody(server string, sessionID ID, params *PatchSessionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewCreateSessionRequest calls the generic CreateSession builder with application/json body func NewCreateSessionRequest(server string, sessionID UUIDv7, params *CreateSessionParams, body CreateSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateSessionRequestWithBody(server, sessionID, params, "application/json", bodyReader) } // NewCreateSessionRequestWithBody constructs an http.Request for the CreateSession method, with any body, and a specified content type func NewCreateSessionRequestWithBody(server string, sessionID UUIDv7, params *CreateSessionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-None-Match", params.IfNoneMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-None-Match", headerParam0) } return req, nil } // NewGetActiveOutputContentRequest constructs an http.Request for the GetActiveOutputContent method func NewGetActiveOutputContentRequest(server string, sessionID ID, contentID ID, params *GetActiveOutputContentParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "content_id", contentID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/active-output/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "snapshot", params.Snapshot, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetCatalogRequest constructs an http.Request for the GetCatalog method func NewGetCatalogRequest(server string, sessionID ID, params *GetCatalogParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/catalog", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Kind != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "kind", *params.Kind, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCompactSessionRequest calls the generic CompactSession builder with application/json body func NewCompactSessionRequest(server string, sessionID ID, body CompactSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCompactSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewCompactSessionRequestWithBody constructs an http.Request for the CompactSession method, with any body, and a specified content type func NewCompactSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/compaction", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetContextRequest constructs an http.Request for the GetContext method func NewGetContextRequest(server string, sessionID ID, params *GetContextParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/context", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.SnapshotID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "snapshot_id", *params.SnapshotID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.SectionID != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "section_id", *params.SectionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Page != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.After != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after", *params.After, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryRequest constructs an http.Request for the GetHistory method func NewGetHistoryRequest(server string, sessionID ID, params *GetHistoryParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.View != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "view", *params.View, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Before != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "before", *params.Before, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.After != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "after", *params.After, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryContentRequest constructs an http.Request for the GetHistoryContent method func NewGetHistoryContentRequest(server string, sessionID ID, entryID ID, params *GetHistoryContentParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "entry_id", entryID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetHistoryImageRequest constructs an http.Request for the GetHistoryImage method func NewGetHistoryImageRequest(server string, sessionID ID, entryID ID, field string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "entry_id", entryID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam2 string pathParam2, err = runtime.StyleParamWithOptions("simple", false, "field", field, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/history/%s/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetInputRequest constructs an http.Request for the GetInput method func NewGetInputRequest(server string, sessionID ID, inputID ID) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "input_id", inputID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/inputs/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPutInputRequest calls the generic PutInput builder with application/json body func NewPutInputRequest(server string, sessionID ID, inputID UUIDv7, body PutInputJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPutInputRequestWithBody(server, sessionID, inputID, "application/json", bodyReader) } // NewPutInputRequestWithBody constructs an http.Request for the PutInput method, with any body, and a specified content type func NewPutInputRequestWithBody(server string, sessionID ID, inputID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "input_id", inputID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/inputs/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewCancelInputRequest calls the generic CancelInput builder with application/json body func NewCancelInputRequest(server string, sessionID ID, inputID ID, body CancelInputJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCancelInputRequestWithBody(server, sessionID, inputID, "application/json", bodyReader) } // NewCancelInputRequestWithBody constructs an http.Request for the CancelInput method, with any body, and a specified content type func NewCancelInputRequestWithBody(server string, sessionID ID, inputID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "input_id", inputID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/inputs/%s/cancel", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewInterruptSessionRequest calls the generic InterruptSession builder with application/json body func NewInterruptSessionRequest(server string, sessionID ID, body InterruptSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewInterruptSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewInterruptSessionRequestWithBody constructs an http.Request for the InterruptSession method, with any body, and a specified content type func NewInterruptSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/interrupt", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewUpgradeKernelRequest calls the generic UpgradeKernel builder with application/json body func NewUpgradeKernelRequest(server string, sessionID ID, body UpgradeKernelJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewUpgradeKernelRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewUpgradeKernelRequestWithBody constructs an http.Request for the UpgradeKernel method, with any body, and a specified content type func NewUpgradeKernelRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/kernel/upgrade", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewReloadSessionRequest calls the generic ReloadSession builder with application/json body func NewReloadSessionRequest(server string, sessionID ID, body ReloadSessionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewReloadSessionRequestWithBody(server, sessionID, "application/json", bodyReader) } // NewReloadSessionRequestWithBody constructs an http.Request for the ReloadSession method, with any body, and a specified content type func NewReloadSessionRequestWithBody(server string, sessionID ID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/reload", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewRecordVisitRequest calls the generic RecordVisit builder with application/json body func NewRecordVisitRequest(server string, sessionID ID, visitID UUIDv7, body RecordVisitJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewRecordVisitRequestWithBody(server, sessionID, visitID, "application/json", bodyReader) } // NewRecordVisitRequestWithBody constructs an http.Request for the RecordVisit method, with any body, and a specified content type func NewRecordVisitRequestWithBody(server string, sessionID ID, visitID UUIDv7, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "session_id", sessionID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "visit_id", visitID, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/sessions/%s/visits/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetSettingsRequest constructs an http.Request for the GetSettings method func NewGetSettingsRequest(server string, params *GetSettingsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/settings") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Group != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "group", *params.Group, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewPatchSettingsRequestWithApplicationMergePatchPlusJSONBody calls the generic PatchSettings builder with application/merge-patch+json body func NewPatchSettingsRequestWithApplicationMergePatchPlusJSONBody(server string, params *PatchSettingsParams, body PatchSettingsApplicationMergePatchPlusJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewPatchSettingsRequestWithBody(server, params, "application/merge-patch+json", bodyReader) } // NewPatchSettingsRequestWithBody constructs an http.Request for the PatchSettings method, with any body, and a specified content type func NewPatchSettingsRequestWithBody(server string, params *PatchSettingsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/settings") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if queryFrag, err := runtime.StyleParamWithOptions("form", true, "group", params.Group, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) if params != nil { var headerParam0 string headerParam0, err = runtime.StyleParamWithOptions("simple", false, "If-Match", params.IfMatch, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""}) if err != nil { return nil, err } req.Header.Set("If-Match", headerParam0) } return req, nil } // NewGetStorageRequest constructs an http.Request for the GetStorage method func NewGetStorageRequest(server string, params *GetStorageParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/storage") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.SessionsNext != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sessions_next", *params.SessionsNext, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.FilesNext != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "files_next", *params.FilesNext, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetWorkspacesRequest constructs an http.Request for the GetWorkspaces method func NewGetWorkspacesRequest(server string, params *GetWorkspacesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/workspaces") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Location != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "location", *params.Location, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Include != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include", *params.Include, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Next != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "next", *params.Next, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { for _, r := range c.RequestEditors { if err := r(ctx, req); err != nil { return err } } for _, r := range additionalEditors { if err := r(ctx, req); err != nil { return err } } return nil } // Response decoding is owned by the daemon adapter.